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.
- package/README.md +3 -4
- package/dist/cli/commands.mjs +2 -0
- package/dist/cli/environment-builder.mjs +5 -0
- package/dist/cli/program.mjs +10 -4
- package/dist/generators/angular/entity-files-angular.js +6 -7
- package/dist/generators/angular/resources/package.json +17 -17
- package/dist/generators/angular/templates/src/main/webapp/app/account/activate/activate.component.spec.ts.ejs +4 -3
- package/dist/generators/angular/templates/src/main/webapp/app/account/activate/activate.service.spec.ts.ejs +3 -2
- package/dist/generators/angular/templates/src/main/webapp/app/account/password/password.component.spec.ts.ejs +4 -5
- package/dist/generators/angular/templates/src/main/webapp/app/account/password/password.service.spec.ts.ejs +3 -2
- package/dist/generators/angular/templates/src/main/webapp/app/account/password-reset/finish/password-reset-finish.component.spec.ts.ejs +4 -3
- package/dist/generators/angular/templates/src/main/webapp/app/account/password-reset/finish/password-reset-finish.service.spec.ts.ejs +3 -2
- package/dist/generators/angular/templates/src/main/webapp/app/account/password-reset/init/password-reset-init.component.spec.ts.ejs +3 -3
- package/dist/generators/angular/templates/src/main/webapp/app/account/password-reset/init/password-reset-init.service.spec.ts.ejs +3 -2
- package/dist/generators/angular/templates/src/main/webapp/app/account/register/register.component.spec.ts.ejs +2 -3
- package/dist/generators/angular/templates/src/main/webapp/app/account/register/register.service.spec.ts.ejs +3 -2
- package/dist/generators/angular/templates/src/main/webapp/app/account/sessions/sessions.component.spec.ts.ejs +3 -3
- package/dist/generators/angular/templates/src/main/webapp/app/account/settings/settings.component.spec.ts.ejs +3 -4
- package/dist/generators/angular/templates/src/main/webapp/app/admin/configuration/configuration.component.spec.ts.ejs +3 -3
- package/dist/generators/angular/templates/src/main/webapp/app/admin/configuration/configuration.service.spec.ts.ejs +3 -2
- package/dist/generators/angular/templates/src/main/webapp/app/admin/health/health.component.spec.ts.ejs +4 -4
- package/dist/generators/angular/templates/src/main/webapp/app/admin/health/health.service.spec.ts.ejs +3 -2
- package/dist/generators/angular/templates/src/main/webapp/app/admin/health/modal/health-modal.component.spec.ts.ejs +3 -3
- package/dist/generators/angular/templates/src/main/webapp/app/admin/logs/logs.component.spec.ts.ejs +4 -3
- package/dist/generators/angular/templates/src/main/webapp/app/admin/logs/logs.service.spec.ts.ejs +3 -2
- package/dist/generators/angular/templates/src/main/webapp/app/admin/metrics/blocks/jvm-threads/jvm-threads.component.ts.ejs +1 -1
- package/dist/generators/angular/templates/src/main/webapp/app/admin/metrics/blocks/metrics-modal-threads/metrics-modal-threads.component.spec.ts.ejs +3 -3
- package/dist/generators/angular/templates/src/main/webapp/app/admin/metrics/metrics.component.spec.ts.ejs +3 -2
- package/dist/generators/angular/templates/src/main/webapp/app/admin/metrics/metrics.service.spec.ts.ejs +3 -2
- package/dist/generators/angular/templates/src/main/webapp/app/admin/user-management/delete/user-management-delete-dialog.component.spec.ts.ejs +3 -3
- package/dist/generators/angular/templates/src/main/webapp/app/admin/user-management/list/user-management.component.html.ejs +1 -1
- package/dist/generators/angular/templates/src/main/webapp/app/admin/user-management/list/user-management.component.spec.ts.ejs +3 -4
- package/dist/generators/angular/templates/src/main/webapp/app/admin/user-management/service/user-management.service.spec.ts.ejs +3 -3
- package/dist/generators/angular/templates/src/main/webapp/app/admin/user-management/update/user-management-update.component.spec.ts.ejs +3 -2
- package/dist/generators/angular/templates/src/main/webapp/app/app-page-title-strategy.ts.ejs +1 -1
- package/dist/generators/angular/templates/src/main/webapp/app/app.component.ts.ejs +0 -1
- package/dist/generators/angular/templates/src/main/webapp/app/app.config.ts.ejs +2 -2
- package/dist/generators/angular/templates/src/main/webapp/app/config/uib-pagination.config.ts.ejs +1 -1
- package/dist/generators/angular/templates/src/main/webapp/app/core/auth/account.service.spec.ts.ejs +7 -5
- package/dist/generators/angular/templates/src/main/webapp/app/core/auth/auth-jwt.service.spec.ts.ejs +3 -2
- package/dist/generators/angular/templates/src/main/webapp/app/core/interceptor/auth-expired.interceptor.ts.ejs +3 -3
- package/dist/generators/angular/templates/src/main/webapp/app/core/interceptor/auth.interceptor.ts.ejs +2 -2
- package/dist/generators/angular/templates/src/main/webapp/app/core/interceptor/error-handler.interceptor.ts.ejs +1 -1
- package/dist/generators/angular/templates/src/main/webapp/app/core/util/alert.service.spec.ts.ejs +6 -6
- package/dist/generators/angular/templates/src/main/webapp/app/entities/_entityFolder_/delete/_entityFile_-delete-dialog.component.spec.ts.ejs +3 -4
- package/dist/generators/angular/templates/src/main/webapp/app/entities/_entityFolder_/list/_entityFile_.component.html.ejs +1 -1
- package/dist/generators/angular/templates/src/main/webapp/app/entities/_entityFolder_/list/_entityFile_.component.spec.ts.ejs +2 -3
- package/dist/generators/angular/templates/src/main/webapp/app/entities/_entityFolder_/list/_entityFile_.component.ts.ejs +2 -2
- package/dist/generators/angular/templates/src/main/webapp/app/entities/_entityFolder_/route/_entityFile_-routing-resolve.service.spec.ts.ejs +2 -3
- package/dist/generators/angular/templates/src/main/webapp/app/entities/_entityFolder_/service/_entityFile_.service.spec.ts.ejs +5 -3
- package/dist/generators/angular/templates/src/main/webapp/app/entities/_entityFolder_/update/_entityFile_-update.component.spec.ts.ejs +2 -3
- package/dist/generators/angular/templates/src/main/webapp/app/layouts/error/error.component.ts.ejs +2 -2
- package/dist/generators/angular/templates/src/main/webapp/app/layouts/navbar/active-menu.directive.ts.ejs +3 -3
- package/dist/generators/angular/templates/src/main/webapp/app/layouts/navbar/navbar.component.spec.ts.ejs +3 -3
- package/dist/generators/angular/templates/src/main/webapp/app/layouts/profiles/page-ribbon.component.spec.ts.ejs +3 -2
- package/dist/generators/angular/templates/src/main/webapp/app/shared/auth/has-any-authority.directive.spec.ts.ejs +3 -3
- package/dist/generators/angular/templates/src/main/webapp/app/shared/language/find-language-from-key.pipe.ts.ejs +1 -1
- package/dist/generators/angular/templates/src/main/webapp/app/shared/language/translation.module.ts.ejs +2 -2
- package/dist/generators/angular/templates/src/main/webapp/app/shared/sort/sort-by.directive.spec.ts.ejs +10 -10
- package/dist/generators/angular/templates/src/main/webapp/app/shared/sort/sort-by.directive.ts.ejs +6 -7
- package/dist/generators/angular/templates/src/main/webapp/app/shared/sort/sort.directive.spec.ts.ejs +4 -4
- package/dist/generators/angular/templates/src/main/webapp/content/scss/global.scss.ejs +2 -0
- package/dist/generators/base/command.js +1 -0
- package/dist/generators/base/generator.js +7 -12
- package/dist/generators/base/internal/command.js +13 -0
- package/dist/generators/base/internal/index.js +1 -0
- package/dist/generators/base/shared-data.js +74 -2
- package/dist/generators/base/support/config.js +1 -1
- package/dist/generators/base/support/jhipster7-context.js +155 -52
- package/dist/generators/base-application/generator.js +1 -1
- package/dist/generators/base-core/generator.js +93 -55
- package/dist/generators/bootstrap/generator.js +1 -1
- package/dist/generators/bootstrap/support/eslint-worker.js +14 -12
- package/dist/generators/bootstrap/support/multi-step-transform/template-file.js +6 -1
- package/dist/generators/bootstrap-application/generator.js +1 -1
- package/dist/generators/bootstrap-application-client/generator.js +5 -1
- package/dist/generators/ci-cd/generator.js +1 -1
- package/dist/generators/ci-cd/templates/docker-registry.yml.ejs +0 -1
- package/dist/generators/ci-cd/templates/jenkins/jenkins.yml.ejs +0 -1
- package/dist/generators/client/generator.js +2 -3
- package/dist/generators/client/resources/package.json +3 -3
- package/dist/generators/client/support/filter-entities.js +1 -1
- package/dist/generators/client/templates/.eslintignore.ejs +9 -5
- package/dist/generators/client/templates/README.md.jhi.client.ejs +29 -20
- package/dist/generators/client/templates/src/main/webapp/index.html.ejs +1 -1
- package/dist/generators/common/resources/package.json +1 -1
- package/dist/generators/docker/templates/docker/keycloak.yml.ejs +2 -1
- package/dist/generators/docker/templates/docker/mariadb.yml.ejs +1 -1
- package/dist/generators/docker/templates/docker/mysql.yml.ejs +1 -2
- package/dist/generators/docker/templates/docker/realm-config/keycloak-health-check.sh +2 -2
- package/dist/generators/docker-compose/templates/docker-compose.yml.ejs +1 -0
- package/dist/generators/docker-compose/templates/realm-config/keycloak-health-check.sh +2 -2
- package/dist/generators/feign-client/templates/src/main/java/_package_/client/AuthorizationHeaderUtil.java.ejs +1 -1
- package/dist/generators/gatling/generator.js +0 -1
- package/dist/generators/generate-blueprint/files.js +3 -1
- package/dist/generators/generate-blueprint/generator.js +17 -7
- package/dist/generators/generate-blueprint/resources/package.json +2 -0
- package/dist/generators/generate-blueprint/templates/.blueprint/github-build-matrix/generator.mjs.ejs +2 -6
- package/dist/generators/generate-blueprint/templates/.github/workflows/build-cache.yml.ejs +39 -0
- package/dist/generators/generate-blueprint/templates/.github/workflows/samples.yml.ejs +105 -0
- package/dist/generators/generate-blueprint/templates/.prettierignore.jhi.blueprint.ejs +1 -1
- package/dist/generators/generate-blueprint/templates/eslint.config.js.ejs +33 -0
- package/dist/generators/generator-constants.js +2 -2
- package/dist/generators/gradle/templates/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/dist/generators/heroku/generator.js +1 -1
- package/dist/generators/info/support/extract-info.js +60 -0
- package/dist/generators/info/support/index.js +1 -0
- package/dist/generators/init/resources/.node-version +1 -1
- package/dist/generators/init/resources/package.json +2 -2
- package/dist/generators/java/generators/bootstrap/generator.js +9 -2
- package/dist/generators/java/generators/build-tool/command.js +2 -2
- package/dist/generators/java/generators/node/templates/npmw +1 -5
- package/dist/generators/java/support/add-java-annotation.js +1 -1
- package/dist/generators/jdl/generator.js +6 -6
- package/dist/generators/kubernetes/templates/db/mysql.yml.ejs +1 -0
- package/dist/generators/languages/generator.js +1 -0
- package/dist/generators/liquibase/templates/src/main/java/_package_/config/LiquibaseConfiguration.java.ejs +1 -1
- package/dist/generators/maven/command.js +15 -0
- package/dist/generators/maven/generator.js +6 -1
- package/dist/generators/maven/index.js +1 -0
- package/dist/generators/maven/internal/xml-store.js +7 -6
- package/dist/generators/maven/support/pom-store.js +24 -9
- package/dist/generators/maven/templates/.mvn/wrapper/maven-wrapper.properties +1 -1
- package/dist/generators/react/entity-files-react.js +7 -7
- package/dist/generators/react/resources/package.json +12 -12
- package/dist/generators/react/templates/src/main/webapp/app/app.tsx.ejs +9 -0
- package/dist/generators/react/templates/src/main/webapp/app/config/translation.ts.ejs +4 -0
- package/dist/generators/react/templates/src/main/webapp/app/modules/home/home.tsx.ejs +15 -1
- package/dist/generators/react/templates/src/main/webapp/app/modules/login/login-redirect.tsx.ejs +4 -0
- package/dist/generators/react/templates/src/main/webapp/app/modules/login/logout.tsx.ejs +5 -3
- package/dist/generators/react/templates/src/main/webapp/app/routes.tsx.ejs +1 -1
- package/dist/generators/react/templates/src/main/webapp/app/shared/auth/private-route.spec.tsx.ejs +1 -1
- package/dist/generators/react/templates/src/main/webapp/app/shared/auth/private-route.tsx.ejs +1 -1
- package/dist/generators/react/templates/src/main/webapp/app/shared/layout/header/header.tsx.ejs +0 -9
- package/dist/generators/react/templates/src/main/webapp/app/shared/layout/menus/account.spec.tsx.ejs +1 -3
- package/dist/generators/react/templates/src/main/webapp/app/shared/layout/menus/account.tsx.ejs +29 -6
- package/dist/generators/react/templates/src/main/webapp/app/shared/util/url-utils.ts.ejs +1 -1
- package/dist/generators/server/generator.js +7 -5
- package/dist/generators/server/resources/Dockerfile +5 -5
- package/dist/generators/server/resources/gradle/libs.versions.toml +5 -5
- package/dist/generators/server/resources/pom.xml +11 -11
- package/dist/generators/server/templates/gradle/profile_dev.gradle.ejs +1 -1
- package/dist/generators/server/templates/gradle/profile_prod.gradle.ejs +1 -1
- package/dist/generators/server/templates/pom.xml.ejs +0 -26
- package/dist/generators/server/templates/src/main/java/_package_/config/AsyncConfiguration.java.ejs +1 -1
- package/dist/generators/server/templates/src/main/java/_package_/config/SecurityJwtConfiguration.java.ejs +1 -1
- package/dist/generators/server/templates/src/main/java/_package_/config/WebConfigurer.java.ejs +1 -1
- package/dist/generators/server/templates/src/main/java/_package_/security/DomainUserDetailsService.java.ejs +1 -1
- package/dist/generators/server/templates/src/main/java/_package_/security/PersistentTokenRememberMeServices.java.ejs +1 -1
- package/dist/generators/server/templates/src/main/java/_package_/security/oauth2/AudienceValidator.java.ejs +1 -1
- package/dist/generators/server/templates/src/main/java/_package_/service/MailService.java.ejs +1 -1
- package/dist/generators/server/templates/src/main/java/_package_/service/dto/UserDTO.java.ejs +11 -0
- package/dist/generators/server/templates/src/main/java/_package_/web/rest/AccountResource.java.ejs +1 -1
- package/dist/generators/server/templates/src/main/java/_package_/web/rest/AccountResource_oauth2.java.ejs +1 -1
- package/dist/generators/server/templates/src/main/java/_package_/web/rest/AccountResource_skipUserManagement.java.ejs +1 -1
- package/dist/generators/server/templates/src/main/java/_package_/web/rest/AuthenticateController.java.ejs +1 -1
- package/dist/generators/server/templates/src/main/resources/config/application-dev.yml.ejs +1 -1
- package/dist/generators/server/templates/src/main/resources/config/application.yml.ejs +1 -1
- package/dist/generators/server/templates/src/main/resources/config/bootstrap.yml.ejs +1 -1
- package/dist/generators/spring-boot/generator.js +4 -2
- package/dist/generators/spring-boot/resources/spring-boot-dependencies.pom +105 -105
- package/dist/generators/spring-boot/templates/src/main/java/_package_/_entityPackage_/service/UserService.java.ejs +1 -1
- package/dist/generators/spring-boot/templates/src/main/java/_package_/_entityPackage_/service/_entityClass_QueryService.java.ejs +1 -1
- package/dist/generators/spring-boot/templates/src/main/java/_package_/_entityPackage_/service/impl/_entityClass_ServiceImpl.java.ejs +1 -1
- package/dist/generators/spring-boot/templates/src/main/java/_package_/_entityPackage_/web/rest/PublicUserResource.java.ejs +1 -1
- package/dist/generators/spring-boot/templates/src/main/java/_package_/_entityPackage_/web/rest/UserResource.java.ejs +1 -1
- package/dist/generators/spring-boot/templates/src/main/java/_package_/_entityPackage_/web/rest/_entityClass_Resource.java.ejs +1 -1
- package/dist/generators/spring-cache/resources/gradle/libs.versions.toml +1 -1
- package/dist/generators/spring-cache/templates/src/main/java/_package_/config/CacheConfiguration.java.ejs +3 -3
- package/dist/generators/spring-cloud/generators/gateway/command.js +5 -0
- package/dist/generators/spring-cloud-stream/generators/kafka/templates/src/main/java/_package_/broker/KafkaConsumer_imperative.java.ejs +1 -1
- package/dist/generators/spring-cloud-stream/generators/kafka/templates/src/main/java/_package_/broker/KafkaConsumer_reactive.java.ejs +1 -1
- package/dist/generators/spring-cloud-stream/generators/kafka/templates/src/main/java/_package_/web/rest/KafkaResource_imperative.java.ejs +1 -1
- package/dist/generators/spring-cloud-stream/generators/kafka/templates/src/main/java/_package_/web/rest/KafkaResource_reactive.java.ejs +1 -1
- package/dist/generators/spring-data-couchbase/templates/src/main/java/_package_/config/DatabaseConfiguration.java.ejs +1 -1
- package/dist/generators/spring-data-neo4j/templates/src/main/java/_package_/config/DatabaseConfiguration.java_neo4j.ejs +18 -2
- package/dist/generators/spring-data-relational/templates/src/main/java/_package_/config/DatabaseConfiguration.java.ejs +1 -1
- package/dist/generators/vue/entity-files-vue.js +7 -7
- package/dist/generators/vue/resources/package.json +11 -11
- package/dist/generators/vue/templates/.eslintrc.cjs.ejs +7 -0
- package/dist/lib/eslint/base.js +25 -0
- package/dist/lib/eslint/recommended.js +22 -0
- package/dist/testing/github.js +32 -0
- package/dist/testing/helpers.js +9 -0
- package/dist/testing/index.js +2 -0
- package/dist/testing/sample-config.js +31 -0
- package/dist/types/cli/commands.d.mts +2 -0
- package/dist/types/cli/environment-builder.d.mts +1 -0
- package/dist/types/generators/base/api.d.ts +14 -7
- package/dist/types/generators/base/internal/command.d.ts +2 -0
- package/dist/types/generators/base/internal/index.d.ts +1 -0
- package/dist/types/generators/base/shared-data.d.ts +10 -1
- package/dist/types/generators/base/types.d.ts +12 -0
- package/dist/types/generators/base-application/types.d.ts +11 -0
- package/dist/types/generators/base-core/generator.d.ts +2 -1
- package/dist/types/generators/generator-constants.d.ts +1 -1
- package/dist/types/generators/info/support/extract-info.d.ts +14 -0
- package/dist/types/generators/info/support/index.d.ts +1 -0
- package/dist/types/generators/java/types.d.ts +12 -0
- package/dist/types/generators/maven/internal/xml-store.d.ts +3 -2
- package/dist/types/generators/maven/support/pom-store.d.ts +5 -2
- package/dist/types/generators/maven/types.d.ts +1 -0
- package/dist/types/generators/server/types.d.ts +2 -1
- package/dist/types/lib/eslint/base.d.ts +20 -0
- package/dist/types/lib/eslint/recommended.d.ts +20 -0
- package/dist/types/testing/github.d.ts +11 -0
- package/dist/types/testing/helpers.d.ts +8 -0
- package/dist/types/testing/index.d.ts +2 -0
- package/dist/types/testing/sample-config.d.ts +4 -0
- package/package.json +22 -18
- package/dist/generators/generate-blueprint/templates/.eslintrc.json.ejs +0 -35
|
@@ -33,6 +33,7 @@ services:
|
|
|
33
33
|
- KC_HTTP_PORT=9080
|
|
34
34
|
- KC_HTTPS_PORT=9443
|
|
35
35
|
- KC_HEALTH_ENABLED=true
|
|
36
|
+
- KC_HTTP_MANAGEMENT_PORT=9990
|
|
36
37
|
# If you want to expose these ports outside your dev PC,
|
|
37
38
|
# remove the "127.0.0.1:" prefix
|
|
38
39
|
ports:
|
|
@@ -42,5 +43,5 @@ services:
|
|
|
42
43
|
test: 'bash /opt/keycloak/health-check.sh'
|
|
43
44
|
interval: 5s
|
|
44
45
|
timeout: 5s
|
|
45
|
-
retries:
|
|
46
|
+
retries: 40
|
|
46
47
|
start_period: 10s
|
|
@@ -32,7 +32,7 @@ services:
|
|
|
32
32
|
# remove the "127.0.0.1:" prefix
|
|
33
33
|
ports:
|
|
34
34
|
- 127.0.0.1:3306:3306
|
|
35
|
-
command: mariadbd --lower_case_table_names=1 --
|
|
35
|
+
command: mariadbd --lower_case_table_names=1 --character_set_server=utf8mb4 --explicit_defaults_for_timestamp
|
|
36
36
|
healthcheck:
|
|
37
37
|
test: ["CMD", "/usr/local/bin/healthcheck.sh", "--connect", "--innodb_initialized"]
|
|
38
38
|
interval: 5s
|
|
@@ -23,7 +23,6 @@ services:
|
|
|
23
23
|
image: <%- dockerContainers.mysql %>
|
|
24
24
|
volumes:
|
|
25
25
|
- ./config/mysql:/etc/mysql/conf.d
|
|
26
|
-
# - ~/volumes/jhipster/<%= baseName %>/mysql/:/var/lib/mysql/
|
|
27
26
|
environment:
|
|
28
27
|
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
|
|
29
28
|
- MYSQL_DATABASE=<%= baseName.toLowerCase() %>
|
|
@@ -31,7 +30,7 @@ services:
|
|
|
31
30
|
# remove the "127.0.0.1:" prefix
|
|
32
31
|
ports:
|
|
33
32
|
- 127.0.0.1:3306:3306
|
|
34
|
-
command: mysqld --lower_case_table_names=1 --character_set_server=utf8mb4 --explicit_defaults_for_timestamp
|
|
33
|
+
command: mysqld --lower_case_table_names=1 --skip-mysqlx --character_set_server=utf8mb4 --explicit_defaults_for_timestamp
|
|
35
34
|
healthcheck:
|
|
36
35
|
test: ["CMD", "mysql", "-e", "SHOW DATABASES;"]
|
|
37
36
|
interval: 5s
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
exec 3<>/dev/tcp/localhost/
|
|
2
|
+
exec 3<>/dev/tcp/localhost/9990
|
|
3
3
|
|
|
4
|
-
echo -e "GET /health/ready HTTP/1.1\nhost: localhost:
|
|
4
|
+
echo -e "GET /health/ready HTTP/1.1\nhost: localhost:9990\n" >&3
|
|
5
5
|
|
|
6
6
|
timeout --preserve-status 1 cat <&3 | grep -m 1 status | grep -m 1 UP
|
|
7
7
|
ERROR=$?
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
exec 3<>/dev/tcp/localhost/
|
|
2
|
+
exec 3<>/dev/tcp/localhost/9990
|
|
3
3
|
|
|
4
|
-
echo -e "GET /health/ready HTTP/1.1\nhost: localhost:
|
|
4
|
+
echo -e "GET /health/ready HTTP/1.1\nhost: localhost:9990\n" >&3
|
|
5
5
|
|
|
6
6
|
timeout --preserve-status 1 cat <&3 | grep -m 1 status | grep -m 1 UP
|
|
7
7
|
ERROR=$?
|
|
@@ -56,7 +56,7 @@ public class AuthorizationHeaderUtil {
|
|
|
56
56
|
|
|
57
57
|
private final OAuth2AuthorizedClientService clientService;
|
|
58
58
|
private final RestTemplateBuilder restTemplateBuilder;
|
|
59
|
-
private final Logger log = LoggerFactory.getLogger(AuthorizationHeaderUtil.class);
|
|
59
|
+
private static final Logger log = LoggerFactory.getLogger(AuthorizationHeaderUtil.class);
|
|
60
60
|
|
|
61
61
|
public AuthorizationHeaderUtil(OAuth2AuthorizedClientService clientService, RestTemplateBuilder restTemplateBuilder) {
|
|
62
62
|
this.clientService = clientService;
|
|
@@ -71,7 +71,6 @@ export default class GatlingGenerator extends BaseApplicationGenerator {
|
|
|
71
71
|
additionalContent: `
|
|
72
72
|
<configuration>
|
|
73
73
|
<runMultipleSimulations>true</runMultipleSimulations>
|
|
74
|
-
<resourcesFolder>\${project.basedir}/src/test/gatling/conf</resourcesFolder>
|
|
75
74
|
</configuration>
|
|
76
75
|
`,
|
|
77
76
|
},
|
|
@@ -22,9 +22,9 @@ export const files = {
|
|
|
22
22
|
{
|
|
23
23
|
condition: ctx => !ctx[LOCAL_BLUEPRINT_OPTION],
|
|
24
24
|
templates: [
|
|
25
|
-
'.eslintrc.json',
|
|
26
25
|
'.github/workflows/generator.yml',
|
|
27
26
|
'.prettierignore.jhi.blueprint',
|
|
27
|
+
'eslint.config.js',
|
|
28
28
|
'README.md',
|
|
29
29
|
'tsconfig.json',
|
|
30
30
|
'vitest.config.ts',
|
|
@@ -41,6 +41,8 @@ export const files = {
|
|
|
41
41
|
'.blueprint/github-build-matrix/build-matrix.mjs',
|
|
42
42
|
'.blueprint/github-build-matrix/generator.mjs',
|
|
43
43
|
'.blueprint/github-build-matrix/index.mjs',
|
|
44
|
+
'.github/workflows/build-cache.yml',
|
|
45
|
+
'.github/workflows/samples.yml',
|
|
44
46
|
],
|
|
45
47
|
},
|
|
46
48
|
{
|
|
@@ -27,6 +27,7 @@ import { packageJson } from '../../lib/index.js';
|
|
|
27
27
|
import { SKIP_COMMIT_HOOK } from '../init/constants.js';
|
|
28
28
|
import { BLUEPRINT_API_VERSION, NODE_VERSION } from '../generator-constants.js';
|
|
29
29
|
const { GENERATOR_PROJECT_NAME, GENERATOR_INIT } = GENERATOR_LIST;
|
|
30
|
+
const defaultPublishedFiles = ['generators', '!**/__*', '!**/*.snap', '!**/*.spec.?(c|m)js'];
|
|
30
31
|
export default class extends BaseGenerator {
|
|
31
32
|
async _beforeQueue() {
|
|
32
33
|
if (!this.fromBlueprint) {
|
|
@@ -136,7 +137,7 @@ export default class extends BaseGenerator {
|
|
|
136
137
|
return this.delegateTasksToBlueprint(() => this.loading);
|
|
137
138
|
}
|
|
138
139
|
get preparing() {
|
|
139
|
-
return {
|
|
140
|
+
return this.asPreparingTaskGroup({
|
|
140
141
|
prepareCommands() {
|
|
141
142
|
this.application.commands = [];
|
|
142
143
|
this.application.nodeVersion = NODE_VERSION;
|
|
@@ -159,13 +160,16 @@ export default class extends BaseGenerator {
|
|
|
159
160
|
this.application.cliName = cliName ?? `jhipster-${baseName}`;
|
|
160
161
|
}
|
|
161
162
|
},
|
|
162
|
-
};
|
|
163
|
+
});
|
|
163
164
|
}
|
|
164
165
|
get [BaseGenerator.PREPARING]() {
|
|
165
166
|
return this.delegateTasksToBlueprint(() => this.preparing);
|
|
166
167
|
}
|
|
167
168
|
get writing() {
|
|
168
|
-
return {
|
|
169
|
+
return this.asWritingTaskGroup({
|
|
170
|
+
async cleanup({ control }) {
|
|
171
|
+
await control.cleanupFiles({ '8.5.1': ['.eslintrc.json'] });
|
|
172
|
+
},
|
|
169
173
|
async writing() {
|
|
170
174
|
this.application.sampleWritten = this.jhipsterConfig.sampleWritten;
|
|
171
175
|
await this.writeFiles({
|
|
@@ -206,7 +210,7 @@ export default class extends BaseGenerator {
|
|
|
206
210
|
subGeneratorStorage.set(WRITTEN, true);
|
|
207
211
|
}
|
|
208
212
|
},
|
|
209
|
-
};
|
|
213
|
+
});
|
|
210
214
|
}
|
|
211
215
|
get [BaseGenerator.WRITING]() {
|
|
212
216
|
return this.delegateTasksToBlueprint(() => this.writing);
|
|
@@ -226,7 +230,7 @@ export default class extends BaseGenerator {
|
|
|
226
230
|
name: `generator-jhipster-${this.jhipsterConfig.baseName}`,
|
|
227
231
|
keywords: ['yeoman-generator', 'jhipster-blueprint', BLUEPRINT_API_VERSION],
|
|
228
232
|
type: 'module',
|
|
229
|
-
files:
|
|
233
|
+
files: defaultPublishedFiles,
|
|
230
234
|
scripts: {
|
|
231
235
|
ejslint: 'ejslint generators/**/*.ejs',
|
|
232
236
|
lint: 'eslint .',
|
|
@@ -239,8 +243,8 @@ export default class extends BaseGenerator {
|
|
|
239
243
|
devDependencies: {
|
|
240
244
|
'ejs-lint': `${mainDependencies['ejs-lint']}`,
|
|
241
245
|
eslint: `${mainDependencies.eslint}`,
|
|
246
|
+
globals: `${mainDependencies.globals}`,
|
|
242
247
|
'eslint-config-prettier': `${mainDependencies['eslint-config-prettier']}`,
|
|
243
|
-
'eslint-plugin-import': `${mainDependencies['eslint-plugin-import']}`,
|
|
244
248
|
'eslint-plugin-prettier': `${mainDependencies['eslint-plugin-prettier']}`,
|
|
245
249
|
vitest: mainDependencies.vitest,
|
|
246
250
|
prettier: `${mainDependencies.prettier}`,
|
|
@@ -263,7 +267,7 @@ export default class extends BaseGenerator {
|
|
|
263
267
|
bin: {
|
|
264
268
|
[cliName]: 'cli/cli.cjs',
|
|
265
269
|
},
|
|
266
|
-
files: ['cli',
|
|
270
|
+
files: ['cli', ...defaultPublishedFiles],
|
|
267
271
|
});
|
|
268
272
|
},
|
|
269
273
|
addGeneratorJHipsterDependency() {
|
|
@@ -278,6 +282,9 @@ export default class extends BaseGenerator {
|
|
|
278
282
|
peerDependencies: {
|
|
279
283
|
'generator-jhipster': `^${packagejs.version}`,
|
|
280
284
|
},
|
|
285
|
+
engines: {
|
|
286
|
+
'generator-jhipster': `^${packagejs.version}`,
|
|
287
|
+
},
|
|
281
288
|
});
|
|
282
289
|
}
|
|
283
290
|
else {
|
|
@@ -285,6 +292,9 @@ export default class extends BaseGenerator {
|
|
|
285
292
|
dependencies: {
|
|
286
293
|
'generator-jhipster': `${packagejs.version}`,
|
|
287
294
|
},
|
|
295
|
+
engines: {
|
|
296
|
+
'generator-jhipster': `${packagejs.version}`,
|
|
297
|
+
},
|
|
288
298
|
});
|
|
289
299
|
}
|
|
290
300
|
},
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { existsSync, appendFileSync } from 'node:fs';
|
|
2
2
|
import os from 'node:os';
|
|
3
3
|
import BaseGenerator from 'generator-jhipster/generators/base';
|
|
4
|
+
import { setGithubTaskOutput } from 'generator-jhipster/testing';
|
|
4
5
|
import { buildMatrix } from './build-matrix.mjs';
|
|
5
6
|
|
|
6
7
|
export default class extends BaseGenerator {
|
|
@@ -12,12 +13,7 @@ export default class extends BaseGenerator {
|
|
|
12
13
|
return this.asWritingTaskGroup({
|
|
13
14
|
async buildMatrix() {
|
|
14
15
|
const matrix = await buildMatrix(this.templatePath('../../generate-sample/templates/samples'));
|
|
15
|
-
|
|
16
|
-
const filePath = process.env['GITHUB_OUTPUT'];
|
|
17
|
-
console.log(matrixoutput);
|
|
18
|
-
if (filePath && existsSync(filePath)) {
|
|
19
|
-
appendFileSync(filePath, matrixoutput, { encoding: 'utf8' });
|
|
20
|
-
}
|
|
16
|
+
setGithubTaskOutput('matrix', matrix);
|
|
21
17
|
},
|
|
22
18
|
});
|
|
23
19
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
name: build-cache
|
|
2
|
+
on:
|
|
3
|
+
workflow_dispatch:
|
|
4
|
+
schedule:
|
|
5
|
+
- cron: '0 0 * * 0'
|
|
6
|
+
jobs:
|
|
7
|
+
build-cache:
|
|
8
|
+
runs-on: ubuntu-latest
|
|
9
|
+
defaults:
|
|
10
|
+
run:
|
|
11
|
+
working-directory: ${{ github.workspace }}/app
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
|
+
with:
|
|
15
|
+
path: generator-jhipster-<%= baseName %>
|
|
16
|
+
- uses: jhipster/actions/setup-runner@v0
|
|
17
|
+
with:
|
|
18
|
+
node-version: 20
|
|
19
|
+
binary-dir: ${{ github.workspace }}/generator-jhipster-<%= baseName %>/cli/
|
|
20
|
+
- uses: jhipster/actions/cache-npm-dependencies@v0
|
|
21
|
+
with:
|
|
22
|
+
generator-path: generator-jhipster-<%= baseName %>
|
|
23
|
+
if: always()
|
|
24
|
+
- run: cli.cjs generate-sample --all
|
|
25
|
+
continue-on-error: true
|
|
26
|
+
- run: npm run backend:build-cache --workspaces
|
|
27
|
+
continue-on-error: true
|
|
28
|
+
- uses: jhipster/actions/save-cache@v0
|
|
29
|
+
if: always()
|
|
30
|
+
with:
|
|
31
|
+
key: ${{ github.run_id }}
|
|
32
|
+
npm: true
|
|
33
|
+
maven: true
|
|
34
|
+
gradle: true
|
|
35
|
+
- uses: jhipster/actions/restore-cache@v0
|
|
36
|
+
with:
|
|
37
|
+
npm: true
|
|
38
|
+
maven: true
|
|
39
|
+
gradle: true
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
name: Verify Sample Projects
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches:
|
|
5
|
+
- 'main'
|
|
6
|
+
- '**maintenance'
|
|
7
|
+
paths-ignore:
|
|
8
|
+
- 'package*.json'
|
|
9
|
+
pull_request:
|
|
10
|
+
branches:
|
|
11
|
+
- '*'
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
jobs:
|
|
15
|
+
build-matrix:
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
outputs:
|
|
18
|
+
matrix: ${{ steps.build.outputs.matrix }}
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v4
|
|
21
|
+
- uses: actions/setup-node@v4
|
|
22
|
+
with:
|
|
23
|
+
node-version: <%- nodeVersion.split('.', 2)[0] %>
|
|
24
|
+
- id: build
|
|
25
|
+
run: |
|
|
26
|
+
npm install
|
|
27
|
+
./cli/cli.cjs github-build-matrix
|
|
28
|
+
samples:
|
|
29
|
+
name: ${{ matrix.sample-name }}
|
|
30
|
+
runs-on: ubuntu-latest
|
|
31
|
+
needs: build-matrix
|
|
32
|
+
defaults:
|
|
33
|
+
run:
|
|
34
|
+
working-directory: ${{ github.workspace }}/app
|
|
35
|
+
timeout-minutes: 30
|
|
36
|
+
strategy:
|
|
37
|
+
fail-fast: false
|
|
38
|
+
matrix: ${{fromJson(needs.build-matrix.outputs.matrix)}}
|
|
39
|
+
steps:
|
|
40
|
+
- uses: actions/checkout@v4
|
|
41
|
+
with:
|
|
42
|
+
path: generator-jhipster-<%= baseName %>
|
|
43
|
+
fetch-depth: 2
|
|
44
|
+
- uses: jhipster/actions/setup-runner@v0
|
|
45
|
+
with:
|
|
46
|
+
java-version: ${{ matrix.java-version }}
|
|
47
|
+
node-version: ${{ matrix.node-version }}
|
|
48
|
+
maven-cache: true
|
|
49
|
+
gradle-cache: true
|
|
50
|
+
binary-dir: ${{ github.workspace }}/generator-jhipster-<%= baseName %>/cli/
|
|
51
|
+
- name: 'Install blueprint'
|
|
52
|
+
run: npm install
|
|
53
|
+
working-directory: ${{ github.workspace }}/generator-jhipster-<%= baseName %>
|
|
54
|
+
- name: 'Generate Project'
|
|
55
|
+
run: cli.cjs generate-sample ${{ matrix.sample-name }} --skip-jhipster-dependencies --force
|
|
56
|
+
- uses: jhipster/actions/compare-sample@v0
|
|
57
|
+
id: compare
|
|
58
|
+
if: >-
|
|
59
|
+
github.event.pull_request &&
|
|
60
|
+
!contains(github.event.pull_request.labels.*.name, 'pr: disable-compare')
|
|
61
|
+
with:
|
|
62
|
+
generator-path: generator-jhipster-<%= baseName %>
|
|
63
|
+
cmd: cli.cjs generate-sample ${{ matrix.sample-name }} --skip-jhipster-dependencies --force --skip-install
|
|
64
|
+
- run: npm run ci:backend:test
|
|
65
|
+
if: steps.compare.outputs.equals != 'true'
|
|
66
|
+
id: backend
|
|
67
|
+
- run: npm run ci:frontend:test --if-present
|
|
68
|
+
if: steps.compare.outputs.equals != 'true'
|
|
69
|
+
- run: npm run ci:e2e:package
|
|
70
|
+
if: steps.compare.outputs.equals != 'true'
|
|
71
|
+
- run: npm run ci:e2e:prepare
|
|
72
|
+
if: steps.compare.outputs.equals != 'true'
|
|
73
|
+
- run: npm run ci:e2e:run --if-present
|
|
74
|
+
if: steps.compare.outputs.equals != 'true'
|
|
75
|
+
id: e2e
|
|
76
|
+
- name: 'BACKEND: Store failure logs'
|
|
77
|
+
uses: actions/upload-artifact@v4
|
|
78
|
+
if: always() && steps.backend.outcome == 'failure'
|
|
79
|
+
with:
|
|
80
|
+
name: log-${{ matrix.sample-name }}
|
|
81
|
+
path: |
|
|
82
|
+
${{ github.workspace }}/app/build/test-results/**/*.xml
|
|
83
|
+
${{ github.workspace }}/app/target/surefire-reports
|
|
84
|
+
- name: 'E2E: Store failure screenshots'
|
|
85
|
+
uses: actions/upload-artifact@v4
|
|
86
|
+
if: always() && steps.e2e.outcome == 'failure'
|
|
87
|
+
with:
|
|
88
|
+
name: screenshots-${{ matrix.sample-name }}
|
|
89
|
+
path: ${{ github.workspace }}/app/**/cypress/screenshots
|
|
90
|
+
- name: Dump docker logs
|
|
91
|
+
if: always()
|
|
92
|
+
uses: jwalton/gh-docker-logs@v2
|
|
93
|
+
check-samples:
|
|
94
|
+
permissions:
|
|
95
|
+
contents: none
|
|
96
|
+
runs-on: ubuntu-latest
|
|
97
|
+
needs: [samples]
|
|
98
|
+
if: always()
|
|
99
|
+
steps:
|
|
100
|
+
- run: |
|
|
101
|
+
echo '${{ toJSON(needs) }}'
|
|
102
|
+
if [ 'skipped' == '${{ needs.samples.result }}' ] || [ 'success' == '${{ needs.samples.result }}' ] || [ 'closed' == '${{ github.event.action }}' ]; then
|
|
103
|
+
exit 0
|
|
104
|
+
fi
|
|
105
|
+
exit 1
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<%#
|
|
2
|
+
Copyright 2013-2024 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 globals from 'globals';
|
|
20
|
+
import prettierRecommended from 'eslint-plugin-prettier/recommended';
|
|
21
|
+
import jhipsterRecommended from 'generator-jhipster/eslint/recommended';
|
|
22
|
+
|
|
23
|
+
export default [
|
|
24
|
+
{
|
|
25
|
+
languageOptions: {
|
|
26
|
+
globals: {
|
|
27
|
+
...globals.node,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
jhipsterRecommended,
|
|
32
|
+
prettierRecommended,
|
|
33
|
+
];
|
|
@@ -21,10 +21,10 @@ import { join } from 'path';
|
|
|
21
21
|
import { fileURLToPath } from 'url';
|
|
22
22
|
export const BLUEPRINT_API_VERSION = 'jhipster-8';
|
|
23
23
|
// jhipster-bom version
|
|
24
|
-
export const JHIPSTER_DEPENDENCIES_VERSION = '8.
|
|
24
|
+
export const JHIPSTER_DEPENDENCIES_VERSION = '8.6.0';
|
|
25
25
|
// Version of Java
|
|
26
26
|
export const JAVA_VERSION = '17';
|
|
27
|
-
export const JAVA_COMPATIBLE_VERSIONS = ['17', '18', '19', '20', '21'];
|
|
27
|
+
export const JAVA_COMPATIBLE_VERSIONS = ['17', '18', '19', '20', '21', '22'];
|
|
28
28
|
// Force spring milestone repository. Spring Boot milestones are detected.
|
|
29
29
|
export const ADD_SPRING_MILESTONE_REPOSITORY = false;
|
|
30
30
|
// Version of Node, NPM
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
distributionBase=GRADLE_USER_HOME
|
|
2
2
|
distributionPath=wrapper/dists
|
|
3
|
-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.
|
|
3
|
+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
|
|
4
4
|
zipStoreBase=GRADLE_USER_HOME
|
|
5
5
|
zipStorePath=wrapper/dists
|
|
@@ -476,7 +476,7 @@ export default class HerokuGenerator extends BaseGenerator {
|
|
|
476
476
|
* @param {string} other - explicit other thing: build, dependencies...
|
|
477
477
|
*/
|
|
478
478
|
addMavenProfile(profileId, other) {
|
|
479
|
-
createPomStorage(this).addProfile({ id: profileId, content: other });
|
|
479
|
+
createPomStorage(this, { sortFile: false }).addProfile({ id: profileId, content: other });
|
|
480
480
|
}
|
|
481
481
|
/**
|
|
482
482
|
* @param {string} command
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { GENERATOR_JHIPSTER } from '../../generator-constants.js';
|
|
2
|
+
export const extractDataFromInfo = (info) => {
|
|
3
|
+
const regexp = /<summary>(?<title>(?:(?!<\/summary>).)+)<\/summary>\s+<pre>(?<body>(?:(?!<\/pre>).)+)/gs;
|
|
4
|
+
let yoRcContent;
|
|
5
|
+
let jdlEntitiesDefinitions;
|
|
6
|
+
let jdlDefinitions;
|
|
7
|
+
let workspacesFolders;
|
|
8
|
+
const files = [];
|
|
9
|
+
for (const match of info.matchAll(regexp)) {
|
|
10
|
+
const { title, body } = match.groups ?? {};
|
|
11
|
+
if (title?.trim() && body?.trim()) {
|
|
12
|
+
if (title.includes('.yo-rc.json file')) {
|
|
13
|
+
if (title.includes(' for ')) {
|
|
14
|
+
const folder = title.split(' for ')[1].trim();
|
|
15
|
+
files.push({ filename: `${folder}/.yo-rc.json`, content: body.trim() });
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
yoRcContent = body.trim();
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
else if (title.includes('JDL entity definitions')) {
|
|
22
|
+
jdlEntitiesDefinitions = body.trim();
|
|
23
|
+
}
|
|
24
|
+
else if (title.includes('JDL definitions')) {
|
|
25
|
+
// JDL definitions can be be a placehoder
|
|
26
|
+
if (body.includes('application')) {
|
|
27
|
+
jdlDefinitions = body.trim();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
let yoRcBlank = true;
|
|
33
|
+
let yoRcValid = false;
|
|
34
|
+
if (yoRcContent) {
|
|
35
|
+
yoRcBlank = false;
|
|
36
|
+
try {
|
|
37
|
+
let content = JSON.parse(yoRcContent);
|
|
38
|
+
content = GENERATOR_JHIPSTER in content ? content : { [GENERATOR_JHIPSTER]: content };
|
|
39
|
+
workspacesFolders = content[GENERATOR_JHIPSTER].appsFolders;
|
|
40
|
+
yoRcContent = JSON.stringify(content);
|
|
41
|
+
yoRcValid = true;
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
// eslint-disable-next-line no-console
|
|
45
|
+
console.log('Invalid .yo-rc.json file', error);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (jdlDefinitions) {
|
|
49
|
+
files.push({ filename: 'app.jdl', content: jdlDefinitions });
|
|
50
|
+
yoRcContent = undefined;
|
|
51
|
+
jdlEntitiesDefinitions = undefined;
|
|
52
|
+
}
|
|
53
|
+
if (jdlEntitiesDefinitions) {
|
|
54
|
+
files.push({ filename: 'entities.jdl', content: jdlEntitiesDefinitions });
|
|
55
|
+
}
|
|
56
|
+
if (yoRcContent) {
|
|
57
|
+
files.push({ filename: '.yo-rc.json', content: yoRcContent });
|
|
58
|
+
}
|
|
59
|
+
return { yoRcContent, jdlEntitiesDefinitions, jdlDefinitions, yoRcBlank, yoRcValid, files, workspacesFolders };
|
|
60
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
20.
|
|
1
|
+
20.15.0
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
import { isFileStateModified } from 'mem-fs-editor/state';
|
|
20
20
|
import BaseApplicationGenerator from '../../../base-application/index.js';
|
|
21
21
|
import { JAVA_COMPATIBLE_VERSIONS } from '../../../generator-constants.js';
|
|
22
|
-
import { packageInfoTransform, generatedAnnotationTransform, checkJava, isReservedJavaKeyword, matchMainJavaFiles, javaMainPackageTemplatesBlock, } from '../../support/index.js';
|
|
22
|
+
import { packageInfoTransform, generatedAnnotationTransform, checkJava, isReservedJavaKeyword, matchMainJavaFiles, javaMainPackageTemplatesBlock, addJavaImport, addJavaAnnotation, } from '../../support/index.js';
|
|
23
23
|
export default class BootstrapGenerator extends BaseApplicationGenerator {
|
|
24
24
|
packageInfoFile;
|
|
25
25
|
async beforeQueue() {
|
|
@@ -87,6 +87,9 @@ export default class BootstrapGenerator extends BaseApplicationGenerator {
|
|
|
87
87
|
source.hasJavaProperty = (property) => application.javaProperties[property] !== undefined;
|
|
88
88
|
source.hasJavaManagedProperty = (property) => application.javaManagedProperties[property] !== undefined;
|
|
89
89
|
},
|
|
90
|
+
needles({ source }) {
|
|
91
|
+
source.editJavaFile = (file, { staticImports = [], imports = [], annotations = [] }, ...editFileCallback) => this.editFile(file, ...staticImports.map(classPath => addJavaImport(classPath, { staticImport: true })), ...imports.map(classPath => addJavaImport(classPath)), ...annotations.map(annotation => addJavaAnnotation(annotation)), ...editFileCallback);
|
|
92
|
+
},
|
|
90
93
|
});
|
|
91
94
|
}
|
|
92
95
|
get [BaseApplicationGenerator.PREPARING]() {
|
|
@@ -102,7 +105,7 @@ export default class BootstrapGenerator extends BaseApplicationGenerator {
|
|
|
102
105
|
application.domains = entityPackages;
|
|
103
106
|
},
|
|
104
107
|
generatedAnnotation({ application }) {
|
|
105
|
-
if (this.jhipsterConfig.withGeneratedFlag) {
|
|
108
|
+
if (this.jhipsterConfig.withGeneratedFlag && application.backendTypeJavaAny) {
|
|
106
109
|
this.queueTransformStream({
|
|
107
110
|
name: 'adding @GeneratedByJHipster annotations',
|
|
108
111
|
filter: file => isFileStateModified(file) && file.path.startsWith(this.destinationPath()) && file.path.endsWith('.java'),
|
|
@@ -111,6 +114,8 @@ export default class BootstrapGenerator extends BaseApplicationGenerator {
|
|
|
111
114
|
}
|
|
112
115
|
},
|
|
113
116
|
generatedPackageInfo({ application }) {
|
|
117
|
+
if (!application.backendTypeJavaAny)
|
|
118
|
+
return;
|
|
114
119
|
const { srcMainJava } = application;
|
|
115
120
|
if (this.packageInfoFile && srcMainJava) {
|
|
116
121
|
const mainPackageMatch = matchMainJavaFiles(srcMainJava);
|
|
@@ -145,6 +150,8 @@ export default class BootstrapGenerator extends BaseApplicationGenerator {
|
|
|
145
150
|
get writing() {
|
|
146
151
|
return this.asWritingTaskGroup({
|
|
147
152
|
async writing({ application }) {
|
|
153
|
+
if (!application.backendTypeJavaAny)
|
|
154
|
+
return;
|
|
148
155
|
await this.writeFiles({
|
|
149
156
|
blocks: [
|
|
150
157
|
javaMainPackageTemplatesBlock({
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* limitations under the License.
|
|
18
18
|
*/
|
|
19
19
|
import { buildToolTypes } from '../../../../jdl/index.js';
|
|
20
|
-
import { GENERATOR_GRADLE } from '../../../generator-list.js';
|
|
20
|
+
import { GENERATOR_GRADLE, GENERATOR_MAVEN } from '../../../generator-list.js';
|
|
21
21
|
const { GRADLE, MAVEN } = buildToolTypes;
|
|
22
22
|
const command = {
|
|
23
23
|
options: {},
|
|
@@ -40,6 +40,6 @@ const command = {
|
|
|
40
40
|
scope: 'storage',
|
|
41
41
|
},
|
|
42
42
|
},
|
|
43
|
-
import: [GENERATOR_GRADLE],
|
|
43
|
+
import: [GENERATOR_GRADLE, GENERATOR_MAVEN],
|
|
44
44
|
};
|
|
45
45
|
export default command;
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
#!/bin/sh
|
|
2
2
|
|
|
3
|
-
basedir
|
|
3
|
+
basedir=$(dirname "$0")
|
|
4
4
|
|
|
5
5
|
if [ -f "$basedir/mvnw" ]; then
|
|
6
6
|
bindir="$basedir/target/node"
|
|
7
7
|
repodir="$basedir/target/node/node_modules"
|
|
8
8
|
installCommand="$basedir/mvnw --batch-mode -ntp -Pwebapp frontend:install-node-and-npm@install-node-and-npm"
|
|
9
|
-
|
|
10
|
-
PATH="$basedir/$builddir/:$PATH"
|
|
11
|
-
NPM_EXE="$basedir/$builddir/node_modules/npm/bin/npm-cli.js"
|
|
12
|
-
NODE_EXE="$basedir/$builddir/node"
|
|
13
9
|
elif [ -f "$basedir/gradlew" ]; then
|
|
14
10
|
bindir="$basedir/build/node/bin"
|
|
15
11
|
repodir="$basedir/build/node/lib/node_modules"
|
|
@@ -40,7 +40,7 @@ const addJavaAnnotationToContent = (content, annotationDef) => {
|
|
|
40
40
|
throw new Error(`Annotation already exists: ${annotation} replace is not implemented yet.`);
|
|
41
41
|
}
|
|
42
42
|
// add the annotation before class or interface
|
|
43
|
-
content = content.replace(/\n([a-w ]*(class|@?interface|enum) )
|
|
43
|
+
content = content.replace(/\n([a-w ]*(class|@?interface|enum) )/, `\n@${annotationToAdd}\n$1`);
|
|
44
44
|
}
|
|
45
45
|
return content;
|
|
46
46
|
};
|