diff --git a/.blueprint/cli/commands.mjs b/.blueprint/cli/commands.mjs index 73cc020b6..d0dcb5f54 100644 --- a/.blueprint/cli/commands.mjs +++ b/.blueprint/cli/commands.mjs @@ -22,6 +22,10 @@ const defaultCommands = { desc: 'Generate a test sample', blueprint: '@jhipster/jhipster-dev', }, + 'github-build-matrix': { + desc: 'Build a matrix of jobs for github actions', + blueprint: '@jhipster/jhipster-dev', + }, synchronize: { desc: 'Synchronize templates from generator-jhipster', blueprint: '@jhipster/jhipster-dev', diff --git a/.blueprint/generate-sample/command.mjs b/.blueprint/generate-sample/command.mjs index 368b48ff8..c5e9b9e58 100644 --- a/.blueprint/generate-sample/command.mjs +++ b/.blueprint/generate-sample/command.mjs @@ -17,14 +17,8 @@ * limitations under the License. */ import { existsSync, readdirSync } from 'node:fs'; +import { entitiesByType, workflowSamples } from '../generate-sample/support/index.mjs'; import { getSamples } from './get-samples.mjs'; -import { entitiesByType, workflowSamples } from './support/index.mjs'; - -const updateSampleName = sample => - sample.replace('ngx', 'ng').replace('ms-ng-eureka-oauth2-mongodb-caffeine', 'ms-ng-oauth2-mongodb-caffeine'); - -const revertSampleName = sample => - sample.replace('ng-', 'ngx-').replace('ms-ng-oauth2-mongodb-caffeine', 'ms-ng-eureka-oauth2-mongodb-caffeine'); /** * @type {import('generator-jhipster').JHipsterCommandDefinition} @@ -43,6 +37,18 @@ const command = { message: 'which sample do you want to generate?', choices: async () => getSamples(gen.templatePath(gen.samplesFolder)), }), + configure: gen => { + const sample = workflowSamples[gen.sampleName]; + if (!sample) { + throw new Error(`Sample ${gen.sampleName} not found`); + } + + gen.sampleName = undefined; + gen.appSample = sample['app-sample']; + gen.jdlSamples = sample['jdl-samples']; + gen.jdlEntities = sample['jdl-entity']; + gen.entityType = sample.entity; + }, scope: 'generator', }, all: { @@ -81,11 +87,9 @@ const command = { }, configure: gen => { if (gen.appSample && gen.appSample !== 'jdl') { - gen.appSample = revertSampleName(gen.appSample); - let { appSample } = gen; appSample = workflowSamples[appSample]?.['app-sample'] ?? appSample; - gen.samplesFolder = `json-samples/${updateSampleName(appSample)}`; + gen.samplesFolder = `_json-samples/${appSample}`; gen.entrypointGenerator = 'app'; } }, @@ -98,9 +102,13 @@ const command = { env: 'JHI_JDL_APP', }, configure: gen => { - if (gen.jdlSamples) { - const [app, ...entities] = gen.jdlSamples.split(','); - gen.samplesFolder = `jdl-samples/${updateSampleName(app)}`; + let { jdlSamples } = gen; + if (!jdlSamples && gen.appSample) { + jdlSamples = workflowSamples[gen.appSample]?.['jdl-samples']; + } + if (jdlSamples) { + const [app, ...entities] = jdlSamples.split(','); + gen.samplesFolder = `_jdl-samples/${app}`; gen.generatorArgs = '*.jdl'; if (entities && entities.length > 0) { gen.supportingSamples.push(...entities.map(entity => `${entity}.jdl`)); diff --git a/.blueprint/generate-sample/generator.mjs b/.blueprint/generate-sample/generator.mjs index 7397421bf..d6e30e2bb 100644 --- a/.blueprint/generate-sample/generator.mjs +++ b/.blueprint/generate-sample/generator.mjs @@ -68,7 +68,7 @@ export default class extends BaseGenerator { if (supportingSamples && supportingSamples.length > 0) { this.log.info(`Copying support samples ${supportingSamples}`); this.copyTemplate(supportingSamples, '', { - fromBasePath: this.templatePath('supporting-samples'), + fromBasePath: this.templatePath('_supporting-samples'), globOptions: { dot: true }, }); } diff --git a/.blueprint/generate-sample/support/workflow-samples.mjs b/.blueprint/generate-sample/support/workflow-samples.mjs index d1ed64348..f92deb563 100644 --- a/.blueprint/generate-sample/support/workflow-samples.mjs +++ b/.blueprint/generate-sample/support/workflow-samples.mjs @@ -1,7 +1,14 @@ import { readFileSync } from 'fs'; -const angularSamples = readFileSync(new URL('../../../test-integration/workflow-samples/angular.json', import.meta.url), 'utf8'); -const reactSamples = readFileSync(new URL('../../../test-integration/workflow-samples/react.json', import.meta.url), 'utf8'); +const prepareSamples = samples => Object.fromEntries(samples.map(({ name, ...sample }) => [name, sample])); +const addSamplesGroup = (samples, samplesGroup) => samples.map(sample => ({ ...sample, 'samples-group': samplesGroup })); -const samples = [...JSON.parse(angularSamples).include, ...JSON.parse(reactSamples).include]; -export const workflowSamples = Object.fromEntries(samples.map(({ name, ...sample }) => [name, sample])); +const angularJson = readFileSync(new URL('../templates/_workflow-samples/angular.json', import.meta.url), 'utf8'); +const angularWorkflowSamples = addSamplesGroup(JSON.parse(angularJson).include, 'angular'); + +const reactJson = readFileSync(new URL('../templates/_workflow-samples/react.json', import.meta.url), 'utf8'); +const reactWorkflowSamples = addSamplesGroup(JSON.parse(reactJson).include, 'react'); + +export const workflowSamples = prepareSamples([...angularWorkflowSamples, ...reactWorkflowSamples]); +export const angularSamples = prepareSamples(angularWorkflowSamples); +export const reactSamples = prepareSamples(reactWorkflowSamples); diff --git a/.blueprint/generate-sample/templates/jdl-samples/jdl-default/app.jdl b/.blueprint/generate-sample/templates/_jdl-samples/jdl-default/app.jdl similarity index 100% rename from .blueprint/generate-sample/templates/jdl-samples/jdl-default/app.jdl rename to .blueprint/generate-sample/templates/_jdl-samples/jdl-default/app.jdl diff --git a/.blueprint/generate-sample/templates/jdl-samples/mf-ng-eureka-jwt-psql-ehcache/blog-store.jdl b/.blueprint/generate-sample/templates/_jdl-samples/mf-ng-eureka-jwt-psql-ehcache/blog-store.jdl similarity index 100% rename from .blueprint/generate-sample/templates/jdl-samples/mf-ng-eureka-jwt-psql-ehcache/blog-store.jdl rename to .blueprint/generate-sample/templates/_jdl-samples/mf-ng-eureka-jwt-psql-ehcache/blog-store.jdl diff --git a/.blueprint/generate-sample/templates/jdl-samples/ms-mf-ng-consul-oauth2-neo4j/blog-store.jdl b/.blueprint/generate-sample/templates/_jdl-samples/ms-mf-ng-consul-oauth2-neo4j/blog-store.jdl similarity index 100% rename from .blueprint/generate-sample/templates/jdl-samples/ms-mf-ng-consul-oauth2-neo4j/blog-store.jdl rename to .blueprint/generate-sample/templates/_jdl-samples/ms-mf-ng-consul-oauth2-neo4j/blog-store.jdl diff --git a/.blueprint/generate-sample/templates/jdl-samples/ms-mf-react-eureka-oauth2-mariadb-infinispan/blog-store.jdl b/.blueprint/generate-sample/templates/_jdl-samples/ms-mf-react-eureka-oauth2-mariadb-infinispan/blog-store.jdl similarity index 100% rename from .blueprint/generate-sample/templates/jdl-samples/ms-mf-react-eureka-oauth2-mariadb-infinispan/blog-store.jdl rename to .blueprint/generate-sample/templates/_jdl-samples/ms-mf-react-eureka-oauth2-mariadb-infinispan/blog-store.jdl diff --git a/.blueprint/generate-sample/templates/jdl-samples/ms-mf-vue-consul-oauth2-mysql-memcached/blog-store.jdl b/.blueprint/generate-sample/templates/_jdl-samples/ms-mf-vue-consul-oauth2-mysql-memcached/blog-store.jdl similarity index 100% rename from .blueprint/generate-sample/templates/jdl-samples/ms-mf-vue-consul-oauth2-mysql-memcached/blog-store.jdl rename to .blueprint/generate-sample/templates/_jdl-samples/ms-mf-vue-consul-oauth2-mysql-memcached/blog-store.jdl diff --git a/.blueprint/generate-sample/templates/jdl-samples/ms-ng-oauth2-mongodb-caffeine/blog-store.jdl b/.blueprint/generate-sample/templates/_jdl-samples/ms-ng-oauth2-mongodb-caffeine/blog-store.jdl similarity index 100% rename from .blueprint/generate-sample/templates/jdl-samples/ms-ng-oauth2-mongodb-caffeine/blog-store.jdl rename to .blueprint/generate-sample/templates/_jdl-samples/ms-ng-oauth2-mongodb-caffeine/blog-store.jdl diff --git a/.blueprint/generate-sample/templates/jdl-samples/ms-react-consul-jwt-cassandra-redis/blog-store.jdl b/.blueprint/generate-sample/templates/_jdl-samples/ms-react-consul-jwt-cassandra-redis/blog-store.jdl similarity index 100% rename from .blueprint/generate-sample/templates/jdl-samples/ms-react-consul-jwt-cassandra-redis/blog-store.jdl rename to .blueprint/generate-sample/templates/_jdl-samples/ms-react-consul-jwt-cassandra-redis/blog-store.jdl diff --git a/.blueprint/generate-sample/templates/jdl-samples/ms-vue-eureka-jwt-couchbase-hazelcast/blog-store.jdl b/.blueprint/generate-sample/templates/_jdl-samples/ms-vue-eureka-jwt-couchbase-hazelcast/blog-store.jdl similarity index 100% rename from .blueprint/generate-sample/templates/jdl-samples/ms-vue-eureka-jwt-couchbase-hazelcast/blog-store.jdl rename to .blueprint/generate-sample/templates/_jdl-samples/ms-vue-eureka-jwt-couchbase-hazelcast/blog-store.jdl diff --git a/.blueprint/generate-sample/templates/jdl-samples/stack-vue-no-db/stack.jdl b/.blueprint/generate-sample/templates/_jdl-samples/stack-vue-no-db/stack.jdl similarity index 100% rename from .blueprint/generate-sample/templates/jdl-samples/stack-vue-no-db/stack.jdl rename to .blueprint/generate-sample/templates/_jdl-samples/stack-vue-no-db/stack.jdl diff --git a/.blueprint/generate-sample/templates/jdl-samples/webflux-psql/webflux-psql.jdl b/.blueprint/generate-sample/templates/_jdl-samples/webflux-psql/webflux-psql.jdl similarity index 100% rename from .blueprint/generate-sample/templates/jdl-samples/webflux-psql/webflux-psql.jdl rename to .blueprint/generate-sample/templates/_jdl-samples/webflux-psql/webflux-psql.jdl diff --git a/.blueprint/generate-sample/templates/json-samples/app-sample-dev/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/app-sample-dev/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/app-sample-dev/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/app-sample-dev/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/ms-micro-consul-infinispan/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/ms-micro-consul-infinispan/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/ms-micro-consul-infinispan/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/ms-micro-consul-infinispan/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/ms-micro-consul-jwt/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/ms-micro-consul-jwt/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/ms-micro-consul-jwt/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/ms-micro-consul-jwt/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/ms-micro-consul/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/ms-micro-consul/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/ms-micro-consul/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/ms-micro-consul/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/ms-micro-eureka/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/ms-micro-eureka/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/ms-micro-eureka/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/ms-micro-eureka/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/ms-ngx-gateway-consul-jwt/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/ms-ngx-gateway-consul-jwt/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/ms-ngx-gateway-consul-jwt/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/ms-ngx-gateway-consul-jwt/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/ms-ngx-gateway-consul-oauth2/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/ms-ngx-gateway-consul-oauth2/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/ms-ngx-gateway-consul-oauth2/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/ms-ngx-gateway-consul-oauth2/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/ms-ngx-gateway-consul/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/ms-ngx-gateway-consul/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/ms-ngx-gateway-consul/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/ms-ngx-gateway-consul/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/ms-ngx-gateway-eureka/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/ms-ngx-gateway-eureka/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/ms-ngx-gateway-eureka/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/ms-ngx-gateway-eureka/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/ms-react-gateway-consul-jwt/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/ms-react-gateway-consul-jwt/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/ms-react-gateway-consul-jwt/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/ms-react-gateway-consul-jwt/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/ms-react-gateway-consul-oauth2/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/ms-react-gateway-consul-oauth2/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/ms-react-gateway-consul-oauth2/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/ms-react-gateway-consul-oauth2/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/ng-couchbase/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/ng-couchbase/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/ng-couchbase/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/ng-couchbase/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/ng-default/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/ng-default/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/ng-default/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/ng-default/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/ng-gradle-couchbase-search/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/ng-gradle-couchbase-search/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/ng-gradle-couchbase-search/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/ng-gradle-couchbase-search/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/ng-gradle-fr/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/ng-gradle-fr/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/ng-gradle-fr/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/ng-gradle-fr/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/ng-gradle-h2disk-ws-nocache/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/ng-gradle-h2disk-ws-nocache/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/ng-gradle-h2disk-ws-nocache/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/ng-gradle-h2disk-ws-nocache/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/ng-gradle-mariadb-oauth2-infinispan/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/ng-gradle-mariadb-oauth2-infinispan/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/ng-gradle-mariadb-oauth2-infinispan/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/ng-gradle-mariadb-oauth2-infinispan/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/ng-gradle-mongodb-kafka-cucumber/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/ng-gradle-mongodb-kafka-cucumber/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/ng-gradle-mongodb-kafka-cucumber/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/ng-gradle-mongodb-kafka-cucumber/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/ng-gradle-mysql-es-noi18n-mapsid/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/ng-gradle-mysql-es-noi18n-mapsid/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/ng-gradle-mysql-es-noi18n-mapsid/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/ng-gradle-mysql-es-noi18n-mapsid/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/ng-h2mem-ws-nol2/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/ng-h2mem-ws-nol2/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/ng-h2mem-ws-nol2/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/ng-h2mem-ws-nol2/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/ng-mariadb-oauth2-infinispan/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/ng-mariadb-oauth2-infinispan/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/ng-mariadb-oauth2-infinispan/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/ng-mariadb-oauth2-infinispan/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/ng-mariadb-oauth2-sass-infinispan/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/ng-mariadb-oauth2-sass-infinispan/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/ng-mariadb-oauth2-sass-infinispan/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/ng-mariadb-oauth2-sass-infinispan/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/ng-mongodb-kafka-cucumber/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/ng-mongodb-kafka-cucumber/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/ng-mongodb-kafka-cucumber/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/ng-mongodb-kafka-cucumber/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/ng-mysql-es-noi18n-mapsid/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/ng-mysql-es-noi18n-mapsid/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/ng-mysql-es-noi18n-mapsid/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/ng-mysql-es-noi18n-mapsid/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/ng-neo4j/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/ng-neo4j/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/ng-neo4j/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/ng-neo4j/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/ng-session-cassandra-fr/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/ng-session-cassandra-fr/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/ng-session-cassandra-fr/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/ng-session-cassandra-fr/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/react-default/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/react-default/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/react-default/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/react-default/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/react-gradle-cassandra-session-redis/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/react-gradle-cassandra-session-redis/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/react-gradle-cassandra-session-redis/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/react-gradle-cassandra-session-redis/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/react-gradle-couchbase-caffeine/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/react-gradle-couchbase-caffeine/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/react-gradle-couchbase-caffeine/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/react-gradle-couchbase-caffeine/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/react-gradle-h2mem-memcached/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/react-gradle-h2mem-memcached/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/react-gradle-h2mem-memcached/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/react-gradle-h2mem-memcached/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/react-gradle-mysql-es-noi18n-mapsid/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/react-gradle-mysql-es-noi18n-mapsid/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/react-gradle-mysql-es-noi18n-mapsid/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/react-gradle-mysql-es-noi18n-mapsid/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/react-maven-cassandra-session-redis/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/react-maven-cassandra-session-redis/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/react-maven-cassandra-session-redis/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/react-maven-cassandra-session-redis/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/react-maven-couchbase-caffeine/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/react-maven-couchbase-caffeine/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/react-maven-couchbase-caffeine/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/react-maven-couchbase-caffeine/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/react-maven-h2mem-memcached/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/react-maven-h2mem-memcached/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/react-maven-h2mem-memcached/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/react-maven-h2mem-memcached/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/react-maven-mysql-es-noi18n-mapsid/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/react-maven-mysql-es-noi18n-mapsid/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/react-maven-mysql-es-noi18n-mapsid/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/react-maven-mysql-es-noi18n-mapsid/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/react-noi18n-es-ws-gradle-session/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/react-noi18n-es-ws-gradle-session/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/react-noi18n-es-ws-gradle-session/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/react-noi18n-es-ws-gradle-session/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/vue-couchbase/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/vue-couchbase/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/vue-couchbase/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/vue-couchbase/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/vue-default/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/vue-default/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/vue-default/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/vue-default/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/vue-fulli18n-es/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/vue-fulli18n-es/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/vue-fulli18n-es/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/vue-fulli18n-es/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/vue-gateway/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/vue-gateway/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/vue-gateway/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/vue-gateway/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/vue-gradle-ws-session/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/vue-gradle-ws-session/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/vue-gradle-ws-session/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/vue-gradle-ws-session/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/vue-mongodb-kafka-cucumber/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/vue-mongodb-kafka-cucumber/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/vue-mongodb-kafka-cucumber/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/vue-mongodb-kafka-cucumber/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/vue-noi18n-ws-oauth2/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/vue-noi18n-ws-oauth2/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/vue-noi18n-ws-oauth2/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/vue-noi18n-ws-oauth2/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/vue-oauth2/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/vue-oauth2/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/vue-oauth2/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/vue-oauth2/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/vue-session-cassandra-fr/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/vue-session-cassandra-fr/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/vue-session-cassandra-fr/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/vue-session-cassandra-fr/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/vue-ws-theme/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/vue-ws-theme/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/vue-ws-theme/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/vue-ws-theme/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/webflux-couchbase-es-oauth2/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/webflux-couchbase-es-oauth2/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/webflux-couchbase-es-oauth2/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/webflux-couchbase-es-oauth2/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/webflux-couchbase-session/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/webflux-couchbase-session/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/webflux-couchbase-session/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/webflux-couchbase-session/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/webflux-couchbase/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/webflux-couchbase/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/webflux-couchbase/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/webflux-couchbase/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/webflux-gateway-jwt/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/webflux-gateway-jwt/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/webflux-gateway-jwt/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/webflux-gateway-jwt/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/webflux-gateway-oauth2/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/webflux-gateway-oauth2/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/webflux-gateway-oauth2/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/webflux-gateway-oauth2/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/webflux-gradle-session-h2mem-es/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/webflux-gradle-session-h2mem-es/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/webflux-gradle-session-h2mem-es/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/webflux-gradle-session-h2mem-es/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/webflux-mongodb-es-session/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/webflux-mongodb-es-session/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/webflux-mongodb-es-session/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/webflux-mongodb-es-session/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/webflux-mongodb-oauth2/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/webflux-mongodb-oauth2/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/webflux-mongodb-oauth2/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/webflux-mongodb-oauth2/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/webflux-mongodb/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/webflux-mongodb/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/webflux-mongodb/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/webflux-mongodb/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/webflux-mysql-kafka/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/webflux-mysql-kafka/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/webflux-mysql-kafka/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/webflux-mysql-kafka/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/webflux-nodb-oauth2/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/webflux-nodb-oauth2/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/webflux-nodb-oauth2/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/webflux-nodb-oauth2/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/webflux-psql/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/webflux-psql/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/webflux-psql/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/webflux-psql/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/json-samples/webflux-react/.yo-rc.json b/.blueprint/generate-sample/templates/_json-samples/webflux-react/.yo-rc.json similarity index 100% rename from .blueprint/generate-sample/templates/json-samples/webflux-react/.yo-rc.json rename to .blueprint/generate-sample/templates/_json-samples/webflux-react/.yo-rc.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/Album.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/Album.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/Album.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/Album.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/Artist.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/Artist.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/Artist.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/Artist.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/BankAccount.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/BankAccount.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/BankAccount.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/BankAccount.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/CassBankAccount.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/CassBankAccount.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/CassBankAccount.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/CassBankAccount.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/Division.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/Division.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/Division.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/Division.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/DocumentBankAccount.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/DocumentBankAccount.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/DocumentBankAccount.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/DocumentBankAccount.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/EmbeddedOperation.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/EmbeddedOperation.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/EmbeddedOperation.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/EmbeddedOperation.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/EntityWithDTO.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/EntityWithDTO.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/EntityWithDTO.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/EntityWithDTO.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/EntityWithPaginationAndDTO.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/EntityWithPaginationAndDTO.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/EntityWithPaginationAndDTO.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/EntityWithPaginationAndDTO.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/EntityWithServiceClassAndPagination.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/EntityWithServiceClassAndPagination.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/EntityWithServiceClassAndPagination.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/EntityWithServiceClassAndPagination.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/EntityWithServiceClassPaginationAndDTO.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/EntityWithServiceClassPaginationAndDTO.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/EntityWithServiceClassPaginationAndDTO.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/EntityWithServiceClassPaginationAndDTO.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/EntityWithServiceImplAndDTO.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/EntityWithServiceImplAndDTO.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/EntityWithServiceImplAndDTO.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/EntityWithServiceImplAndDTO.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/EntityWithServiceImplAndPagination.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/EntityWithServiceImplAndPagination.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/EntityWithServiceImplAndPagination.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/EntityWithServiceImplAndPagination.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/EntityWithServiceImplPaginationAndDTO.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/EntityWithServiceImplPaginationAndDTO.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/EntityWithServiceImplPaginationAndDTO.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/EntityWithServiceImplPaginationAndDTO.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/FieldTestEntity.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/FieldTestEntity.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/FieldTestEntity.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/FieldTestEntity.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/FieldTestEnumWithValue.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/FieldTestEnumWithValue.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/FieldTestEnumWithValue.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/FieldTestEnumWithValue.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/FieldTestInfiniteScrollEntity.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/FieldTestInfiniteScrollEntity.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/FieldTestInfiniteScrollEntity.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/FieldTestInfiniteScrollEntity.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/FieldTestMapstructAndServiceClassEntity.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/FieldTestMapstructAndServiceClassEntity.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/FieldTestMapstructAndServiceClassEntity.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/FieldTestMapstructAndServiceClassEntity.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/FieldTestPaginationEntity.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/FieldTestPaginationEntity.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/FieldTestPaginationEntity.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/FieldTestPaginationEntity.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/FieldTestServiceClassAndJpaFilteringEntity.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/FieldTestServiceClassAndJpaFilteringEntity.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/FieldTestServiceClassAndJpaFilteringEntity.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/FieldTestServiceClassAndJpaFilteringEntity.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/FieldTestServiceImplEntity.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/FieldTestServiceImplEntity.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/FieldTestServiceImplEntity.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/FieldTestServiceImplEntity.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/Genre.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/Genre.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/Genre.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/Genre.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/JpaFilteringOtherSide.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/JpaFilteringOtherSide.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/JpaFilteringOtherSide.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/JpaFilteringOtherSide.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/JpaFilteringRelationship.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/JpaFilteringRelationship.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/JpaFilteringRelationship.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/JpaFilteringRelationship.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/Label.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/Label.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/Label.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/Label.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/MapsIdChildEntityWithDTO.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/MapsIdChildEntityWithDTO.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/MapsIdChildEntityWithDTO.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/MapsIdChildEntityWithDTO.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/MapsIdChildEntityWithoutDTO.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/MapsIdChildEntityWithoutDTO.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/MapsIdChildEntityWithoutDTO.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/MapsIdChildEntityWithoutDTO.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/MapsIdGrandchildEntityWithDTO.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/MapsIdGrandchildEntityWithDTO.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/MapsIdGrandchildEntityWithDTO.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/MapsIdGrandchildEntityWithDTO.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/MapsIdGrandchildEntityWithoutDTO.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/MapsIdGrandchildEntityWithoutDTO.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/MapsIdGrandchildEntityWithoutDTO.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/MapsIdGrandchildEntityWithoutDTO.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/MapsIdParentEntityWithDTO.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/MapsIdParentEntityWithDTO.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/MapsIdParentEntityWithDTO.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/MapsIdParentEntityWithDTO.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/MapsIdParentEntityWithoutDTO.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/MapsIdParentEntityWithoutDTO.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/MapsIdParentEntityWithoutDTO.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/MapsIdParentEntityWithoutDTO.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/MapsIdUserProfileWithDTO.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/MapsIdUserProfileWithDTO.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/MapsIdUserProfileWithDTO.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/MapsIdUserProfileWithDTO.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/MicroserviceBankAccount.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/MicroserviceBankAccount.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/MicroserviceBankAccount.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/MicroserviceBankAccount.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/MicroserviceLabel.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/MicroserviceLabel.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/MicroserviceLabel.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/MicroserviceLabel.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/MicroserviceOperation.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/MicroserviceOperation.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/MicroserviceOperation.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/MicroserviceOperation.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/Operation.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/Operation.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/Operation.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/Operation.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/Place.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/Place.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/Place.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/Place.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/SuperMegaLargeTestEntity.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/SuperMegaLargeTestEntity.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/SuperMegaLargeTestEntity.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/SuperMegaLargeTestEntity.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/TestCustomTableName.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/TestCustomTableName.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/TestCustomTableName.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/TestCustomTableName.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/TestEntity.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/TestEntity.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/TestEntity.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/TestEntity.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/TestInfiniteScroll.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/TestInfiniteScroll.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/TestInfiniteScroll.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/TestInfiniteScroll.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/TestManyRelPaginDTO.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/TestManyRelPaginDTO.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/TestManyRelPaginDTO.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/TestManyRelPaginDTO.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/TestManyToMany.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/TestManyToMany.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/TestManyToMany.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/TestManyToMany.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/TestManyToOne.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/TestManyToOne.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/TestManyToOne.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/TestManyToOne.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/TestMapstruct.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/TestMapstruct.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/TestMapstruct.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/TestMapstruct.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/TestOneToOne.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/TestOneToOne.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/TestOneToOne.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/TestOneToOne.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/TestPagination.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/TestPagination.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/TestPagination.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/TestPagination.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/TestServiceClass.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/TestServiceClass.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/TestServiceClass.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/TestServiceClass.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/TestServiceImpl.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/TestServiceImpl.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/TestServiceImpl.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/TestServiceImpl.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/TestTwoRelationshipsSameEntity.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/TestTwoRelationshipsSameEntity.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/TestTwoRelationshipsSameEntity.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/TestTwoRelationshipsSameEntity.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/.jhipster/Track.json b/.blueprint/generate-sample/templates/_supporting-samples/.jhipster/Track.json similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/.jhipster/Track.json rename to .blueprint/generate-sample/templates/_supporting-samples/.jhipster/Track.json diff --git a/.blueprint/generate-sample/templates/supporting-samples/01-non-updatable-entity.jdl b/.blueprint/generate-sample/templates/_supporting-samples/01-non-updatable-entity.jdl similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/01-non-updatable-entity.jdl rename to .blueprint/generate-sample/templates/_supporting-samples/01-non-updatable-entity.jdl diff --git a/.blueprint/generate-sample/templates/supporting-samples/02-authority-relationship.jdl b/.blueprint/generate-sample/templates/_supporting-samples/02-authority-relationship.jdl similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/02-authority-relationship.jdl rename to .blueprint/generate-sample/templates/_supporting-samples/02-authority-relationship.jdl diff --git a/.blueprint/generate-sample/templates/supporting-samples/custom-domain.jdl b/.blueprint/generate-sample/templates/_supporting-samples/custom-domain.jdl similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/custom-domain.jdl rename to .blueprint/generate-sample/templates/_supporting-samples/custom-domain.jdl diff --git a/.blueprint/generate-sample/templates/supporting-samples/custom-id.jdl b/.blueprint/generate-sample/templates/_supporting-samples/custom-id.jdl similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/custom-id.jdl rename to .blueprint/generate-sample/templates/_supporting-samples/custom-id.jdl diff --git a/.blueprint/generate-sample/templates/supporting-samples/cyclic.jdl b/.blueprint/generate-sample/templates/_supporting-samples/cyclic.jdl similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/cyclic.jdl rename to .blueprint/generate-sample/templates/_supporting-samples/cyclic.jdl diff --git a/.blueprint/generate-sample/templates/supporting-samples/entities.jdl b/.blueprint/generate-sample/templates/_supporting-samples/entities.jdl similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/entities.jdl rename to .blueprint/generate-sample/templates/_supporting-samples/entities.jdl diff --git a/.blueprint/generate-sample/templates/supporting-samples/user-relationships.jdl b/.blueprint/generate-sample/templates/_supporting-samples/user-relationships.jdl similarity index 100% rename from .blueprint/generate-sample/templates/supporting-samples/user-relationships.jdl rename to .blueprint/generate-sample/templates/_supporting-samples/user-relationships.jdl diff --git a/test-integration/workflow-samples/angular.json b/.blueprint/generate-sample/templates/_workflow-samples/angular.json similarity index 57% rename from test-integration/workflow-samples/angular.json rename to .blueprint/generate-sample/templates/_workflow-samples/angular.json index de77c362e..f2f0bafac 100644 --- a/test-integration/workflow-samples/angular.json +++ b/.blueprint/generate-sample/templates/_workflow-samples/angular.json @@ -1,77 +1,77 @@ { "include": [ { - "name": "ngx-default", - "app-sample": "ngx-default", + "name": "ng-default", + "app-sample": "ng-default", "entity": "sqlfull", "sonar-analyse": "true" }, { - "name": "ngx-default-additional", + "name": "ng-default-additional", "entity": "none", - "app-sample": "ngx-default", + "app-sample": "ng-default", "jdl-entity": "custom-id,entities" }, { - "name": "ngx-mongodb-kafka-cucumber", - "app-sample": "ngx-mongodb-kafka-cucumber", + "name": "ng-mongodb-kafka-cucumber", + "app-sample": "ng-mongodb-kafka-cucumber", "entity": "mongodb", "environment": "dev" }, { - "name": "ngx-gradle-fr", - "app-sample": "ngx-gradle-fr", + "name": "ng-gradle-fr", + "app-sample": "ng-gradle-fr", "entity": "sql" }, { - "name": "ngx-gradle-h2disk-ws-nocache", - "app-sample": "ngx-gradle-h2disk-ws-nocache", + "name": "ng-gradle-h2disk-ws-nocache", + "app-sample": "ng-gradle-h2disk-ws-nocache", "entity": "sql", "environment": "dev", "war": 1, "testcontainers": "false" }, { - "name": "ngx-webflux-mongodb", + "name": "ng-webflux-mongodb", "app-sample": "webflux-mongodb", "entity": "mongodb" }, { - "name": "ngx-webflux-gradle-mongodb-oauth2", + "name": "ng-webflux-gradle-mongodb-oauth2", "app-sample": "webflux-mongodb-oauth2", "entity": "mongodb" }, { - "name": "ngx-webflux-psql-default", + "name": "ng-webflux-psql-default", "app-sample": "webflux-psql", "entity": "sql" }, { - "name": "ngx-webflux-psql-additional", + "name": "ng-webflux-psql-additional", "jdl-samples": "webflux-psql,custom-domain" }, { - "name": "ngx-webflux-gradle-session-h2mem-es", + "name": "ng-webflux-gradle-session-h2mem-es", "app-sample": "webflux-gradle-session-h2mem-es", "environment": "dev", "entity": "sqllight" }, { - "name": "ms-ngx-oauth2-mongodb-caffeine", - "jdl-samples": "ms-ngx-oauth2-mongodb-caffeine", + "name": "ms-ng-oauth2-mongodb-caffeine", + "jdl-samples": "ms-ng-oauth2-mongodb-caffeine", "extra-args": "--workspaces --monorepository", "disabled": "unstable", "workspaces": "true" }, { - "name": "mf-ngx-eureka-jwt-psql-ehcache", - "jdl-samples": "mf-ngx-eureka-jwt-psql-ehcache", + "name": "mf-ng-eureka-jwt-psql-ehcache", + "jdl-samples": "mf-ng-eureka-jwt-psql-ehcache", "extra-args": "--workspaces --monorepository", "workspaces": "true" }, { - "name": "ms-mf-ngx-consul-oauth2-neo4j", - "jdl-samples": "ms-mf-ngx-consul-oauth2-neo4j", + "name": "ms-mf-ng-consul-oauth2-neo4j", + "jdl-samples": "ms-mf-ng-consul-oauth2-neo4j", "extra-args": "--workspaces --monorepository", "disabled": "https://github.com/neo4j/neo4j/issues/13025", "workspaces": "true" diff --git a/test-integration/workflow-samples/react.json b/.blueprint/generate-sample/templates/_workflow-samples/react.json similarity index 100% rename from test-integration/workflow-samples/react.json rename to .blueprint/generate-sample/templates/_workflow-samples/react.json diff --git a/test-integration/workflow-samples/vue.json b/.blueprint/generate-sample/templates/_workflow-samples/vue.json similarity index 100% rename from test-integration/workflow-samples/vue.json rename to .blueprint/generate-sample/templates/_workflow-samples/vue.json diff --git a/.blueprint/generate-sample/templates/angular.js b/.blueprint/generate-sample/templates/angular.js new file mode 100644 index 000000000..62f19d431 --- /dev/null +++ b/.blueprint/generate-sample/templates/angular.js @@ -0,0 +1,3 @@ +import { angularSamples } from '../support/workflow-samples.mjs'; + +export default angularSamples; diff --git a/.blueprint/generate-sample/templates/react.js b/.blueprint/generate-sample/templates/react.js new file mode 100644 index 000000000..ca144755f --- /dev/null +++ b/.blueprint/generate-sample/templates/react.js @@ -0,0 +1,3 @@ +import { reactSamples } from '../support/workflow-samples.mjs'; + +export default reactSamples; diff --git a/.blueprint/github-build-matrix/command.mjs b/.blueprint/github-build-matrix/command.mjs new file mode 100644 index 000000000..83708c8ee --- /dev/null +++ b/.blueprint/github-build-matrix/command.mjs @@ -0,0 +1,25 @@ +/** + * @type {import('generator-jhipster').JHipsterCommandDefinition} + */ +const command = { + configs: { + samplesFolder: { + description: 'Samples folder', + cli: { + type: String, + }, + scope: 'generator', + }, + samplesGroup: { + description: 'Samples Group', + argument: { + type: String, + }, + default: 'samples', + scope: 'generator', + }, + }, + options: {}, +}; + +export default command; diff --git a/.blueprint/github-build-matrix/generator.mjs b/.blueprint/github-build-matrix/generator.mjs new file mode 100644 index 000000000..74a81bd53 --- /dev/null +++ b/.blueprint/github-build-matrix/generator.mjs @@ -0,0 +1,36 @@ +import { join } from 'node:path'; +import BaseGenerator from 'generator-jhipster/generators/base'; +import { convertToGitHubMatrix, getGithubOutputFile, getGithubSamplesGroup, setGithubTaskOutput } from 'generator-jhipster/testing'; + +export default class extends BaseGenerator { + /** @type {string} */ + samplesFolder; + /** @type {string} */ + samplesGroup; + /** @type {object} */ + matrix; + + constructor(args, opts, features) { + super(args, opts, { ...features, queueCommandTasks: true, jhipsterBootstrap: false }); + } + + get [BaseGenerator.WRITING]() { + return this.asWritingTaskGroup({ + async buildMatrix() { + const { samplesGroup = 'samples' } = this; + const templatePath = this.templatePath('../../generate-sample/templates/'); + const samplesFolder = this.samplesFolder ? join(templatePath, this.samplesFolder) : templatePath; + const { samples, warnings } = await getGithubSamplesGroup(samplesFolder, samplesGroup); + if (warnings.length > 0) { + this.log.info(warnings.join('\n')); + } + this.matrix = convertToGitHubMatrix(samples); + const githubOutputFile = getGithubOutputFile(); + this.log.info('matrix', this.matrix); + if (githubOutputFile) { + setGithubTaskOutput('matrix', JSON.stringify(this.matrix)); + } + }, + }); + } +} diff --git a/.blueprint/github-build-matrix/index.mjs b/.blueprint/github-build-matrix/index.mjs new file mode 100644 index 000000000..3dd0513e5 --- /dev/null +++ b/.blueprint/github-build-matrix/index.mjs @@ -0,0 +1,2 @@ +export { default } from './generator.mjs'; +export { default as command } from './command.mjs'; diff --git a/.github/actions/build-matrix/action.yml b/.github/actions/build-matrix/action.yml deleted file mode 100644 index 893478b44..000000000 --- a/.github/actions/build-matrix/action.yml +++ /dev/null @@ -1,140 +0,0 @@ -# -# Copyright 2013-2025 the original author or authors from the JHipster project. -# -# This file is part of the JHipster project, see https://www.jhipster.tech/ -# for more information. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -name: 'Compare generated applications' -description: 'Experimental compare generated applications action' -inputs: - workflow-samples-file: - description: 'Workflow samples file' - required: false - workflow-file-prefix: - description: 'Workflow file prefix' - required: false - default: workflow - skip-changes-detection: - description: 'Skip git changes detection' - required: false - default: ${{ (github.event.pull_request && 'false') || 'true' }} - generator-jhipster-directory: - description: 'JHipster Generator path' - required: false - default: ${{ github.workspace }} - samples-directory: - description: 'Samples path' - required: false - default: test-integration/workflow-samples - skip-workflow: - description: 'Skip the workflow' - required: false - default: >- - ${{ - contains(github.event.head_commit.message, '[ci skip]') || - contains(github.event.head_commit.message, '[skip ci]') || - contains(github.event.pull_request.title, '[skip ci]') || - contains(github.event.pull_request.title, '[ci skip]') || - github.event.action == 'closed' || - contains(github.event.pull_request.labels.*.name, 'pr: skip-ci') - }} -outputs: - matrix: - description: 'Build Matrix' - value: ${{ steps.build-matrix.outputs.matrix }} - skip-workflow: - description: 'Skip workflow' - value: ${{ inputs.skip-workflow }} - client: - description: 'Client files has changed' - value: ${{ steps.build-changes.outputs.client }} - common: - description: 'Common files has changed' - value: ${{ steps.build-changes.outputs.common }} - server: - description: 'Server files has changed' - value: ${{ steps.build-changes.outputs.server }} - workspaces: - description: 'Workspaces files has changed' - value: ${{ steps.build-changes.outputs.workspaces }} - e2e: - description: 'E2E files has changed' - value: ${{ steps.build-changes.outputs.e2e }} - any: - description: 'Any files has changed' - value: ${{ steps.build-changes.outputs.any }} - workflow-angular: - description: 'Should run angular workflow' - value: ${{ steps.build-changes.outputs.workflow-angular }} - workflow-react: - description: 'Should run react workflow' - value: ${{ steps.build-changes.outputs.workflow-react }} - workflow-vue: - description: 'Should run vue workflow' - value: ${{ steps.build-changes.outputs.workflow-vue }} -runs: - using: 'composite' - steps: - - uses: actions/setup-node@v3 - with: - node-version: 16 - - name: 'Check changes' - id: build-changes - run: | - SKIP_WORKFLOW=${{inputs.skip-workflow}} SKIP_CHANGES_DETECTION=${{inputs.skip-changes-detection}} ${{ inputs.generator-jhipster-directory }}/test-integration/scripts/99-build-changes.sh - shell: bash - - - name: 'Build matrix' - id: build-matrix - run: | - cd ${{ inputs.generator-jhipster-directory }} - echo '{ "include" : [] }' > matrix.json - - if [[ "true" == "${{ steps.build-changes.outputs.angular }}" || "true" == "${{ steps.build-changes.outputs.client-common }}" ]]; then - echo "::group::Workflows Angular" - test-integration/scripts/99-print-matrix.js generators/client/__workflow/${{ inputs.workflow-file-prefix }}-angular.json - cat matrix.json - echo "::endgroup::" - fi - - if [[ "true" == "${{ steps.build-changes.outputs.react }}" || "true" == "${{ steps.build-changes.outputs.client-common }}" ]]; then - echo "::group::Workflows React" - test-integration/scripts/99-print-matrix.js generators/client/__workflow/${{ inputs.workflow-file-prefix }}-react.json - cat matrix.json - echo "::endgroup::" - fi - - if [[ "true" == "${{ steps.build-changes.outputs.vue }}" || "true" == "${{ steps.build-changes.outputs.client-common }}" ]]; then - echo "::group::Workflows Vue" - test-integration/scripts/99-print-matrix.js generators/client/__workflow/${{ inputs.workflow-file-prefix }}-vue.json - cat matrix.json - echo "::endgroup::" - fi - - if [[ "true" == "${{ steps.build-changes.outputs.any }}" && "" != "${{ inputs.workflow-samples-file }}" ]]; then - echo "::group::Workflow default sample (${{ inputs.workflow-samples-file }})" - test-integration/scripts/99-print-matrix.js ${{ inputs.samples-directory }}/${{ inputs.workflow-samples-file }}.json - cat matrix.json - echo "::endgroup::" - fi - - MATRIX=$(cat matrix.json) - rm matrix.json - MATRIX="${MATRIX//'%'/'%25'}" - MATRIX="${MATRIX//$'\n'/'%0A'}" - MATRIX="${MATRIX//$'\r'/'%0D'}" - echo "::set-output name=matrix::$MATRIX" - shell: bash diff --git a/.github/actions/compare-base/action.yml b/.github/actions/compare-base/action.yml deleted file mode 100644 index 2d6a9fb4d..000000000 --- a/.github/actions/compare-base/action.yml +++ /dev/null @@ -1,74 +0,0 @@ -# -# Copyright 2013-2025 the original author or authors from the JHipster project. -# -# This file is part of the JHipster project, see https://www.jhipster.tech/ -# for more information. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -name: 'Generate application using merge base commit to compare' -description: 'Experimental generate application using merge base commit to compare action' -inputs: - application-path: - description: 'Application path' - required: false - default: ${{ github.workspace }}/base/app - extra-args: - description: 'Extra arguments' - required: false - default: '' -outputs: - application-path: - description: 'Application path' - value: ${{ steps.base.outputs.application-path }} -runs: - using: 'composite' - steps: - - name: 'MERGE: Install base generator-jhipster' - run: | - cd "${{ github.workspace }}/jhipster-kotlin" - git restore -s @~1 . - npm install - git checkout .github - shell: bash - - name: 'MERGE: merge base config' - id: base-config - run: $KHI_SCRIPTS/11-generate-config.sh - env: - JHI_FOLDER_APP: ${{ inputs.application-path }} - KHI_FOLDER_APP: ${{ inputs.application-path }} - shell: bash - - name: 'MERGE: quirks' - id: quirks - run: | - # docker-compose is not reproducible, copy old config - ls "${{ github.workspace }}/app//docker-compose" \ - && mkdir "${{ inputs.application-path }}/docker-compose" \ - && cp "${{ github.workspace }}/app/docker-compose"/.yo-rc.json "${{ inputs.application-path }}/docker-compose" \ - || true - shell: bash - - name: 'MERGE: merge base project' - id: base - run: | - $KHI_SCRIPTS/12-generate-project.sh --skip-jhipster-dependencies --skip-install --skip-git ${{ inputs.extra-args }} - echo "::set-output name=application-path::${{inputs.application-path}}" - env: - JHI_FOLDER_APP: ${{ inputs.application-path }} - KHI_FOLDER_APP: ${{ inputs.application-path }} - shell: bash - - name: 'MERGE: merge base git' - run: | - # Copy git repository (clone without the files) - cp -a "${{ github.workspace }}/app/.git" "${{ inputs.application-path }}" - shell: bash diff --git a/.github/actions/compare/action.yml b/.github/actions/compare/action.yml deleted file mode 100644 index 6e2a28a73..000000000 --- a/.github/actions/compare/action.yml +++ /dev/null @@ -1,54 +0,0 @@ -# -# Copyright 2013-2025 the original author or authors from the JHipster project. -# -# This file is part of the JHipster project, see https://www.jhipster.tech/ -# for more information. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -name: 'Compare generated applications' -description: 'Experimental compare generated applications action' -inputs: - application-path: - description: 'Application path' - required: false - default: ${{ github.workspace }}/base/app -outputs: - equals: - description: "Generated source didn't changed" - value: ${{ steps.compare.outputs.equals }} - has-changes: - description: 'Generated source has changed' - value: ${{ steps.compare.outputs.has-changes }} -runs: - using: 'composite' - steps: - - name: 'MERGE: merge project diff' - id: compare - working-directory: ${{inputs.application-path}} - run: | - git log - # File keystore.p12 always changes - # File package-lock.json is not generated - # Verify if the generated source has changed - git add . - echo "::group::ignored changes" - echo "Showing config diff changes (won't trigger builds)" - git -c color.ui=always diff -R --cached -- '.yo-rc.json' '**/.yo-rc.json' '.jhipster/**' '**/.jhipster/**' '*.json' - echo "::endgroup::" - echo "Showing source diff changes (will trigger builds)" - git -c color.ui=always diff -R --cached --exit-code -- . ':!.yo-rc.json' ':!**/.yo-rc.json' ':!.jhipster/**' ':!**/.jhipster/**' ':!package-lock.json' ':!**/package-lock.json' ':!**/keystore.p12' ':!**.json' ':!**.html' ':!**.js' ':!src/main/webapp/**' ':!**/src/main/webapp/**' ':!src/test/javascript/**' ':!**/src/test/javascript/**' \ - && echo "::set-output name=equals::true" \ - || echo "::set-output name=has-changes::true" - shell: bash diff --git a/.github/actions/generate/action.yml b/.github/actions/generate/action.yml deleted file mode 100644 index c3e43acc8..000000000 --- a/.github/actions/generate/action.yml +++ /dev/null @@ -1,35 +0,0 @@ -# -# Copyright 2013-2025 the original author or authors from the JHipster project. -# -# This file is part of the JHipster project, see https://www.jhipster.tech/ -# for more information. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -name: 'Generate' -description: 'Generate application for test-integration scripts' -inputs: - extra-args: - description: 'Extra arguments' - required: false - default: '' -runs: - using: 'composite' - steps: - - name: 'GENERATION: generate config' - run: $KHI_SCRIPTS/11-generate-config.sh - shell: bash - - name: 'GENERATION: project' - run: $KHI_SCRIPTS/12-generate-project.sh --skip-jhipster-dependencies ${{ inputs.extra-args }} - shell: bash diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml deleted file mode 100644 index 8a2b53a08..000000000 --- a/.github/actions/setup/action.yml +++ /dev/null @@ -1,195 +0,0 @@ -# -# Copyright 2013-2025 the original author or authors from the JHipster project. -# -# This file is part of the JHipster project, see https://www.jhipster.tech/ -# for more information. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -name: 'Setup environment' -description: 'Setup environment for test-integration scripts' -inputs: - application-path: - description: 'Application path' - required: false - default: ${{ github.workspace }}/app - application-sample: - description: 'Application sample' - required: false - default: jdl - jdl-sample: - description: 'JDL application sample' - required: false - default: '' - entities-sample: - description: 'Entities sample' - required: false - default: none - jdl-entities-sample: - description: 'JDL entities sample' - required: false - default: '' - application-environment: - description: 'Application environment' - required: false - default: prod - application-packaging: - description: 'Application packaging' - required: false - default: jar - generator-jhipster-directory: - description: 'JHipster Generator path' - required: false - default: ${{ github.workspace }}/generator-jhipster - generator-jhipster-repository: - description: 'JHipster Generator repository' - required: false - default: https://github.com/jhipster/generator-jhipster.git - generator-jhipster-branch: - description: 'JHipster Generator branch' - required: false - default: v7.9.3 - generator-jhipster-kotlin-directory: - description: 'JHipster Generator path' - required: false - default: ${{ github.workspace }}/jhipster-kotlin - generator-jhipster-kotlin-repository: - description: 'KHipster Generator repository' - required: false - default: https://github.com/jhipster/jhipster-kotlin.git - generator-jhipster-kotlin-branch: - description: 'JHipster Generator branch' - required: false - default: main - jhipster-bom-repository: - description: 'JHipster BOM repository' - required: false - default: https://github.com/jhipster/jhipster-bom.git - jhipster-bom-branch: - description: 'JHipster BOM branch' - required: false - default: release - jhipster-bom-directory: - description: 'JHipster BOM path' - required: false - default: ${{ github.workspace }}/jhipster-bom - package-with-executable: - description: 'Package which contains the executable' - required: false - default: '' - executable: - description: 'Executable' - required: false - default: cli.cjs -outputs: - java-version: - description: 'Java version' - value: ${{ steps.variables.outputs.java-version }} - node-version: - description: 'Node version' - value: ${{ steps.variables.outputs.node-version }} - npm-version: - description: 'NPM version' - value: ${{ steps.variables.outputs.npm-version }} - application-path: - description: 'Application path' - value: ${{ steps.variables.outputs.application-path }} - date: - description: 'Current date' - value: ${{ steps.variables.outputs.date }} -runs: - using: 'composite' - steps: - - name: 'ENV: setup variables' - id: variables - run: | - JHI_HOME="${{ inputs.generator-jhipster-directory }}" - KHI_HOME="${{ inputs.generator-jhipster-kotlin-directory }}" - KHI_WORKSPACE="${{ github.workspace }}" - KHI_CLI_PACKAGE="${{inputs.package-with-executable}}" - source "$KHI_HOME/test-integration/scripts/00-init-env.sh" - - echo "KHI_INTEG=$KHI_INTEG" >> $GITHUB_ENV - echo "KHI_SCRIPTS=$KHI_SCRIPTS" >> $GITHUB_ENV - echo "KHI_HOME=$KHI_HOME" >> $GITHUB_ENV - echo "KHI_SCRIPTS=$KHI_SCRIPTS" >> $GITHUB_ENV - echo "KHI_CLI_PACKAGE_PATH=$KHI_CLI_PACKAGE_PATH" >> $GITHUB_ENV - echo "KHI_CLI_PACKAGE=$KHI_CLI_PACKAGE" >> $GITHUB_ENV - echo "JHI_INTEG=$JHI_INTEG" >> $GITHUB_ENV - - echo "JHI_LIB_REPO=${{inputs.jhipster-bom-repository}}" >> $GITHUB_ENV - echo "JHI_LIB_BRANCH=${{inputs.jhipster-bom-branch}}" >> $GITHUB_ENV - echo "KHI_LIB_HOME=${{inputs.jhipster-bom-directory}}" >> $GITHUB_ENV - echo "JHI_GEN_REPO=${{inputs.generator-jhipster-repository}}" >> $GITHUB_ENV - echo "JHI_GEN_BRANCH=${{inputs.generator-jhipster-branch}}" >> $GITHUB_ENV - echo "KHI_GEN_REPO=${{inputs.generator-jhipster-kotlin-repository}}" >> $GITHUB_ENV - echo "KHI_GEN_BRANCH=${{inputs.generator-jhipster-kotlin-branch}}" >> $GITHUB_ENV - echo "KHI_FOLDER_APP=${{inputs.application-path}}" >> $GITHUB_ENV - - echo "JHI_JDL_APP=${{ inputs.jdl-sample }}" >> $GITHUB_ENV - echo "JHI_APP=${{inputs.application-sample}}" >> $GITHUB_ENV - echo "JHI_ENTITY=${{inputs.entities-sample}}" >> $GITHUB_ENV - echo "JHI_JDL_ENTITY=${{inputs.jdl-entities-sample}}" >> $GITHUB_ENV - echo "KHI_CLI=${{inputs.executable}}" >> $GITHUB_ENV - - echo "JHI_PROFILE=${{inputs.application-environment}}" >> $GITHUB_ENV - test ${{inputs.application-packaging}} != war || echo "JHI_WAR=1" >> $GITHUB_ENV - - echo "JHI_GENERATE_SKIP_CONFIG=1" >> $GITHUB_ENV - echo "JHI_DISABLE_WEBPACK_LOGS=true" >> $GITHUB_ENV - echo "JHI_GITHUB_CI=true" >> $GITHUB_ENV - echo "JHI_E2E_HEADLESS=true" >> $GITHUB_ENV - echo "JHI_RUN_APP=1" >> $GITHUB_ENV - echo "JHI_E2E=1" >> $GITHUB_ENV - echo "FORCE_COLOR=1" >> $GITHUB_ENV - - echo "SPRING_OUTPUT_ANSI_ENABLED=ALWAYS" >> $GITHUB_ENV - echo "SPRING_JPA_SHOW_SQL=false" >> $GITHUB_ENV - echo "NG_CLI_ANALYTICS=ci" >> $GITHUB_ENV - - JHI_PROJECT_VERSION=$JHI_VERSION - if [[ "true" != "{{ startsWith(github.ref, 'refs/tags/v') }}" ]]; then - JHI_PROJECT_VERSION="$JHI_VERSION-git" - fi - echo "JHI_PROJECT_VERSION=$JHI_PROJECT_VERSION" >> $GITHUB_ENV - - - if [[ "${{inputs.jhipster-bom-branch}}" != "release" && "${{inputs.jhipster-bom-branch}}" != "ignore" ]]; then - echo "JHI_BOM_VERSION=0.0.0-CICD" >> $GITHUB_ENV - fi - - # https://github.com/actions/virtual-environments/issues/1499#issuecomment-689467080 - echo "MAVEN_OPTS=-Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120" >> $GITHUB_ENV - # Use java backward compatible locale values https://bugs.openjdk.java.net/browse/JDK-8267069 - echo "java.locale.useOldISOCodes=true" >> $GITHUB_ENV - - echo "::set-output name=application-path::${{inputs.application-path}}" - echo "::set-output name=date::$(/bin/date -u "+%Y%m%d")" - echo "::set-output name=java-version::$JHI_JDK" - echo "::set-output name=node-version::$JHI_NODE_VERSION" - echo "::set-output name=npm-version::$JHI_NPM_VERSION" - - echo "Variables added to environment" - cat $GITHUB_ENV - echo "==============================" - shell: bash - - name: 'ENV: display variables' - run: $KHI_SCRIPTS/01-display-configuration.sh - shell: bash - - name: 'SETUP: Create required structure' - run: mkdir -p $KHI_FOLDER_APP - shell: bash - - name: 'SETUP: configure git' - run: $KHI_SCRIPTS/04-git-config.sh - shell: bash diff --git a/.github/workflows/angular.yml b/.github/workflows/angular.yml index 1c46c3102..60ff51a7c 100644 --- a/.github/workflows/angular.yml +++ b/.github/workflows/angular.yml @@ -30,90 +30,56 @@ on: types: [closed, opened, synchronize, reopened] branches: - '*' +permissions: + contents: read +env: + FORCE_COLOR: 2 jobs: build-matrix: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest outputs: matrix: ${{ steps.build.outputs.matrix }} - client: ${{ steps.build.outputs.client }} - server: ${{ steps.build.outputs.server }} - any: ${{ steps.build.outputs.any }} - workflow-angular: ${{ steps.build.outputs.workflow-angular }} - workflow-react: ${{ steps.build.outputs.workflow-react }} - workflow-vue: ${{ steps.build.outputs.workflow-vue }} steps: - - name: 'SETUP: Checkout generator-jhipster-kotlin' - uses: actions/checkout@v4 - with: - fetch-depth: 2 - - name: 'Build matrix' - id: build - uses: ./.github/actions/build-matrix + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: - workflow-samples-file: angular - applications: - name: ${{ matrix.name }} - runs-on: ${{ matrix.os || 'ubuntu-20.04' }} + node-version: 22 + - id: build + run: | + npm install + ./cli/cli.cjs github-build-matrix angular + samples: + name: ${{ matrix.job-name || matrix.sample }} + runs-on: ${{ matrix.os }} needs: build-matrix defaults: run: working-directory: ${{ github.workspace }}/app - if: >- - !contains(github.event.head_commit.message, '[react]') && - !contains(github.event.head_commit.message, '[vue]') && - !contains(github.event.pull_request.title, '[react]') && - !contains(github.event.pull_request.title, '[vue]') && - !contains(github.event.head_commit.message, '[ci skip]') && - !contains(github.event.head_commit.message, '[skip ci]') && - !contains(github.event.pull_request.title, '[skip ci]') && - !contains(github.event.pull_request.title, '[ci skip]') && - github.event.action != 'closed' && - !contains(github.event.pull_request.labels.*.name, 'pr: skip-ci') - # ktlint takes 8 minutes to run, add additional 15 minutes - # https://github.com/pinterest/ktlint/issues/2754 - timeout-minutes: 40 + timeout-minutes: 30 strategy: fail-fast: false - # Matrix available at https://github.com/jhipster/jhipster-kotlin/tree/main/test-integration/workflow-samples/ matrix: ${{fromJson(needs.build-matrix.outputs.matrix)}} steps: #---------------------------------------------------------------------- # Install all tools and check configuration #---------------------------------------------------------------------- - - name: 'SETUP: Checkout generator-jhipster-kotlin' - uses: actions/checkout@v4 + - uses: actions/checkout@v4 with: path: jhipster-kotlin fetch-depth: 2 - - run: npm install - working-directory: jhipster-kotlin - # workspaces fork the process and lookup blueprints again, link globally to be findable - - run: npm link - if: matrix.workspaces == 'true' - working-directory: jhipster-kotlin - uses: jhipster/actions/setup-runner@v0 with: - node-version: 20 - java-version: 17 + java-version: ${{ matrix.java-version }} + node-version: ${{ matrix.node-version }} + maven-cache: true + gradle-cache: true binary-dir: ${{ github.workspace }}/jhipster-kotlin/cli + - run: npm install + working-directory: ${{ github.workspace }}/jhipster-kotlin - run: | mkdir -p ~/.gradle echo "org.gradle.warning.mode=all" >> ~/.gradle/gradle.properties - - name: 'SETUP: environment' - id: setup - uses: ./jhipster-kotlin/.github/actions/setup - with: - application-sample: ${{ matrix.jhi-app-sample || matrix.app-sample || 'jdl' }} - entities-sample: ${{ matrix.entity || 'none' }} - jdl-entities-sample: ${{ matrix.jdl-entity || '' }} - jdl-sample: ${{ matrix.jdl-samples || '' }} - application-environment: ${{ matrix.environment || 'prod' }} - application-packaging: ${{ (matrix.war == 1 && 'war') || 'jar' }} - # Update global NPM for workspaces support - #---------------------------------------------------------------------- - # Install JHipster and generate project+entities - #---------------------------------------------------------------------- - - run: cli.cjs generate-sample --skip-jhipster-dependencies --skip-install --skip-ktlint-format ${{ matrix.extra-args }} ${{ matrix.new-extra-args }} + - run: cli.cjs generate-sample ${{ matrix.sample }} --skip-jhipster-dependencies --skip-install --skip-ktlint-format ${{ matrix.extra-args }} ${{ matrix.new-extra-args }} - run: cli.cjs info #---------------------------------------------------------------------- # Detect changes against base commit @@ -126,26 +92,27 @@ jobs: with: generator-path: jhipster-kotlin cmd: cli.cjs generate-sample --skip-jhipster-dependencies --skip-install --skip-ktlint-format ${{ matrix.extra-args }} + env: + JHI_APP: ${{ matrix.app-sample || 'jdl' }} + JHI_ENTITY: ${{ matrix.entity || 'none' }} + JHI_JDL_ENTITY: ${{ matrix.jdl-entity || '' }} + JHI_JDL_APP: ${{ matrix.jdl-samples || '' }} #---------------------------------------------------------------------- # Launch tests #---------------------------------------------------------------------- - - name: 'TESTS: backend' + - run: npm run ci:backend:test id: backend - if: steps.compare.outputs.equals != 'true' && matrix.skip-backend-tests != 1 && needs.build-matrix.outputs.server != 'false' - run: npm run ci:backend:test + if: steps.compare.outputs.equals != 'true' && matrix.skip-backend-tests != 1 continue-on-error: ${{matrix.continue-on-backend-tests-error || false}} timeout-minutes: 20 - - name: 'PREPARE: npm install' + - run: ${{ (matrix.workspaces == 'true' && 'npm') || './npmw' }} install if: steps.compare.outputs.equals != 'true' - run: ${{ (matrix.workspaces == 'true' && 'npm') || './npmw' }} install timeout-minutes: 7 - - name: 'TESTS: packaging' + - run: npm run ci:e2e:package if: steps.compare.outputs.equals != 'true' - run: npm run ci:e2e:package timeout-minutes: 7 - - name: 'TESTS: Start docker-compose containers for e2e tests' + - run: npm run ci:e2e:prepare if: steps.compare.outputs.equals != 'true' - run: npm run ci:e2e:prepare timeout-minutes: 5 - run: npm run preci:e2e:server:start --if-present - run: npm run ci:e2e:run --if-present @@ -153,7 +120,7 @@ jobs: if: steps.compare.outputs.equals != 'true' timeout-minutes: 20 # - name: 'TESTS: frontend' - # if: steps.compare.outputs.equals != 'true' && matrix.skip-frontend-tests != 1 && needs.build-matrix.outputs.client != 'false' + # if: steps.compare.outputs.equals != 'true' && matrix.skip-frontend-tests != 1 # run: npm run ci:frontend:test # timeout-minutes: 8 - name: 'BACKEND: Store failure logs' @@ -171,33 +138,16 @@ jobs: - name: Dump docker logs if: always() uses: jwalton/gh-docker-logs@v2 - - name: 'ANALYSIS: Sonar analysis' - if: >- - github.event_name == 'push' && - github.repository == 'jhipster/generator-jhipster' && - matrix.sonar-analyse == 'true' && - steps.compare.outputs.equals != 'true' && - matrix.workspaces != 'true' && - matrix.skip-frontend-tests != 1 && - needs.build-matrix.outputs.client != 'false' && - matrix.skip-backend-tests != 1 && - needs.build-matrix.outputs.server != 'false' - run: | - ./mvnw -ntp --batch-mode initialize org.jacoco:jacoco-maven-plugin:prepare-agent sonar:sonar \ - -Dsonar.host.url=https://sonarcloud.io \ - -Dsonar.projectKey=jhipster-sample-application \ - -Dsonar.organization=jhipster \ - -Dsonar.login=$SONAR_TOKEN - env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} check-angular: + permissions: + contents: none runs-on: ubuntu-latest - needs: [applications] + needs: [samples] if: always() steps: - run: | echo '${{ toJSON(needs) }}' - if [ 'skipped' == '${{ needs.applications.result }}' ] || [ 'success' == '${{ needs.applications.result }}' ] || [ 'closed' == '${{ github.event.action }}' ]; then + if [ 'skipped' == '${{ needs.samples.result }}' ] || [ 'success' == '${{ needs.samples.result }}' ] || [ 'closed' == '${{ github.event.action }}' ]; then exit 0 fi exit 1 diff --git a/.github/workflows/build-cache.yml b/.github/workflows/build-cache.yml new file mode 100644 index 000000000..1e9a6382f --- /dev/null +++ b/.github/workflows/build-cache.yml @@ -0,0 +1,39 @@ +name: build-cache +on: + workflow_dispatch: + schedule: + - cron: '0 0 * * 0' +jobs: + build-cache: + runs-on: ubuntu-latest + defaults: + run: + working-directory: ${{ github.workspace }}/app + steps: + - uses: actions/checkout@v4 + with: + path: generator-jhipster-kotlin + - uses: jhipster/actions/setup-runner@v0 + with: + node-version: 20 + binary-dir: ${{ github.workspace }}/generator-jhipster-kotlin/cli/ + - uses: jhipster/actions/cache-npm-dependencies@v0 + with: + generator-path: generator-jhipster-kotlin + if: always() + - run: cli.cjs generate-sample --all + continue-on-error: true + - run: npm run backend:build-cache --workspaces + continue-on-error: true + - uses: jhipster/actions/save-cache@v0 + if: always() + with: + key: ${{ github.run_id }} + npm: true + maven: true + gradle: true + - uses: jhipster/actions/restore-cache@v0 + with: + npm: true + maven: true + gradle: true diff --git a/.github/workflows/generator.yml b/.github/workflows/generator.yml index b4af0f61d..4133e005e 100644 --- a/.github/workflows/generator.yml +++ b/.github/workflows/generator.yml @@ -1,71 +1,17 @@ -# -# Copyright the original author or authors from the JHipster project. -# -# This file is part of the JHipster project, see https://www.jhipster.tech/ -# for more information. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - name: Generator -concurrency: - # Group PRs by head_ref, push to main branch by commit id, and others branch by ref. - group: ${{ github.workflow }}-${{ github.head_ref || (github.ref == 'refs/heads/main' && github.sha) || github.ref }} - cancel-in-progress: true -on: - push: - branches-ignore: - - 'dependabot/**' - pull_request: - types: [closed, opened, synchronize, reopened] - branches: - - '*' +on: [push, pull_request] +permissions: + contents: read jobs: check-npm-test: - if: >- - github.event.action != 'closed' - runs-on: ubuntu-20.04 + name: npm-test + runs-on: ubuntu-latest timeout-minutes: 20 - strategy: - fail-fast: false steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 20 - - name: 'SETUP: load npm cache' - uses: actions/cache@v4 - with: - path: | - ~/.npm - ~/.cache/Cypress/ - key: ${{ runner.os }}-node-${{ steps.get-date.outputs.date }}-${{ hashFiles('generator-jhipster/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node-${{ steps.get-date.outputs.date }}- - ${{ runner.os }}-node-${{ steps.get-date.outputs.date }} - - run: git --no-pager log -n 10 --graph --pretty='%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue) <%an>%Creset' --abbrev-commit - shell: bash - - name: Config git variables - env: - KHI_SCRIPTS: ./test-integration/scripts - run: $KHI_SCRIPTS/04-git-config.sh - shell: bash + cache: 'npm' - run: npm ci - - run: npm i -g . - - run: npm test - if: >- - !contains(github.event.head_commit.message, '[ci skip]') && - !contains(github.event.head_commit.message, '[skip ci]') && - !contains(github.event.pull_request.title, '[skip ci]') && - !contains(github.event.pull_request.title, '[ci skip]') && - (github.event.pull_request.draft == false || !contains(github.event.pull_request.labels.*.name, 'pr: skip-ci')) + - run: npm run test diff --git a/.github/workflows/react.yml b/.github/workflows/react.yml index 1c3274041..3276df403 100644 --- a/.github/workflows/react.yml +++ b/.github/workflows/react.yml @@ -30,90 +30,56 @@ on: types: [closed, opened, synchronize, reopened] branches: - '*' +permissions: + contents: read +env: + FORCE_COLOR: 2 jobs: build-matrix: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest outputs: matrix: ${{ steps.build.outputs.matrix }} - client: ${{ steps.build.outputs.client }} - server: ${{ steps.build.outputs.server }} - any: ${{ steps.build.outputs.any }} - workflow-angular: ${{ steps.build.outputs.workflow-angular }} - workflow-react: ${{ steps.build.outputs.workflow-react }} - workflow-vue: ${{ steps.build.outputs.workflow-vue }} steps: - - name: 'SETUP: Checkout generator-jhipster-kotlin' - uses: actions/checkout@v4 - with: - fetch-depth: 2 - - name: 'Build matrix' - id: build - uses: ./.github/actions/build-matrix + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: - workflow-samples-file: react - applications: - name: ${{ matrix.name }} - runs-on: ${{ matrix.os || 'ubuntu-20.04' }} + node-version: 22 + - id: build + run: | + npm install + ./cli/cli.cjs github-build-matrix react + samples: + name: ${{ matrix.job-name || matrix.sample }} + runs-on: ${{ matrix.os }} needs: build-matrix defaults: run: working-directory: ${{ github.workspace }}/app - if: >- - !contains(github.event.head_commit.message, '[angular]') && - !contains(github.event.head_commit.message, '[vue]') && - !contains(github.event.pull_request.title, '[angular]') && - !contains(github.event.pull_request.title, '[vue]') && - !contains(github.event.head_commit.message, '[ci skip]') && - !contains(github.event.head_commit.message, '[skip ci]') && - !contains(github.event.pull_request.title, '[skip ci]') && - !contains(github.event.pull_request.title, '[ci skip]') && - github.event.action != 'closed' && - !contains(github.event.pull_request.labels.*.name, 'pr: skip-ci') - # ktlint takes 8 minutes to run, add additional 15 minutes - # https://github.com/pinterest/ktlint/issues/2754 - timeout-minutes: 40 + timeout-minutes: 30 strategy: fail-fast: false - # Matrix available at https://github.com/jhipster/jhipster-kotlin/tree/main/test-integration/workflow-samples/ matrix: ${{fromJson(needs.build-matrix.outputs.matrix)}} steps: #---------------------------------------------------------------------- # Install all tools and check configuration #---------------------------------------------------------------------- - - name: 'SETUP: Checkout generator-jhipster-kotlin' - uses: actions/checkout@v4 + - uses: actions/checkout@v4 with: path: jhipster-kotlin fetch-depth: 2 - - run: npm install - working-directory: jhipster-kotlin - # workspaces fork the process and lookup blueprints again, link globally to be findable - - run: npm link - if: matrix.workspaces == 'true' - working-directory: jhipster-kotlin - uses: jhipster/actions/setup-runner@v0 with: - node-version: 20 - java-version: 17 + java-version: ${{ matrix.java-version }} + node-version: ${{ matrix.node-version }} + maven-cache: true + gradle-cache: true binary-dir: ${{ github.workspace }}/jhipster-kotlin/cli + - run: npm install + working-directory: ${{ github.workspace }}/jhipster-kotlin - run: | mkdir -p ~/.gradle echo "org.gradle.warning.mode=all" >> ~/.gradle/gradle.properties - - name: 'SETUP: environment' - id: setup - uses: ./jhipster-kotlin/.github/actions/setup - with: - application-sample: ${{ matrix.jhi-app-sample || matrix.app-sample || 'jdl' }} - entities-sample: ${{ matrix.entity || 'none' }} - jdl-entities-sample: ${{ matrix.jdl-entity || '' }} - jdl-sample: ${{ matrix.jdl-samples || '' }} - application-environment: ${{ matrix.environment || 'prod' }} - application-packaging: ${{ (matrix.war == 1 && 'war') || 'jar' }} - # Update global NPM for workspaces support - #---------------------------------------------------------------------- - # Install JHipster and generate project+entities - #---------------------------------------------------------------------- - - run: cli.cjs generate-sample --skip-jhipster-dependencies --skip-install --skip-ktlint-format ${{ matrix.extra-args }} ${{ matrix.new-extra-args }} + - run: cli.cjs generate-sample ${{ matrix.sample }} --skip-jhipster-dependencies --skip-install --skip-ktlint-format ${{ matrix.extra-args }} ${{ matrix.new-extra-args }} - run: cli.cjs info #---------------------------------------------------------------------- # Detect changes against base commit @@ -126,26 +92,27 @@ jobs: with: generator-path: jhipster-kotlin cmd: cli.cjs generate-sample --skip-jhipster-dependencies --skip-install --skip-ktlint-format ${{ matrix.extra-args }} + env: + JHI_APP: ${{ matrix.app-sample || 'jdl' }} + JHI_ENTITY: ${{ matrix.entity || 'none' }} + JHI_JDL_ENTITY: ${{ matrix.jdl-entity || '' }} + JHI_JDL_APP: ${{ matrix.jdl-samples || '' }} #---------------------------------------------------------------------- # Launch tests #---------------------------------------------------------------------- - - name: 'TESTS: backend' + - run: npm run ci:backend:test id: backend - if: steps.compare.outputs.equals != 'true' && matrix.skip-backend-tests != 1 && needs.build-matrix.outputs.server != 'false' - run: npm run ci:backend:test + if: steps.compare.outputs.equals != 'true' && matrix.skip-backend-tests != 1 continue-on-error: ${{matrix.continue-on-backend-tests-error || false}} timeout-minutes: 20 - - name: 'PREPARE: npm install' + - run: ${{ (matrix.workspaces == 'true' && 'npm') || './npmw' }} install if: steps.compare.outputs.equals != 'true' - run: ${{ (matrix.workspaces == 'true' && 'npm') || './npmw' }} install timeout-minutes: 7 - - name: 'TESTS: packaging' + - run: npm run ci:e2e:package if: steps.compare.outputs.equals != 'true' - run: npm run ci:e2e:package timeout-minutes: 7 - - name: 'TESTS: Start docker-compose containers for e2e tests' + - run: npm run ci:e2e:prepare if: steps.compare.outputs.equals != 'true' - run: npm run ci:e2e:prepare timeout-minutes: 5 - run: npm run preci:e2e:server:start --if-present - run: npm run ci:e2e:run --if-present @@ -153,7 +120,7 @@ jobs: if: steps.compare.outputs.equals != 'true' timeout-minutes: 20 # - name: 'TESTS: frontend' - # if: steps.compare.outputs.equals != 'true' && matrix.skip-frontend-tests != 1 && needs.build-matrix.outputs.client != 'false' + # if: steps.compare.outputs.equals != 'true' && matrix.skip-frontend-tests != 1 # run: npm run ci:frontend:test # timeout-minutes: 8 - name: 'BACKEND: Store failure logs' @@ -172,13 +139,15 @@ jobs: if: always() uses: jwalton/gh-docker-logs@v2 check-react: + permissions: + contents: none runs-on: ubuntu-latest - needs: [applications] + needs: [samples] if: always() steps: - run: | echo '${{ toJSON(needs) }}' - if [ 'skipped' == '${{ needs.applications.result }}' ] || [ 'success' == '${{ needs.applications.result }}' ] || [ 'closed' == '${{ github.event.action }}' ]; then + if [ 'skipped' == '${{ needs.samples.result }}' ] || [ 'success' == '${{ needs.samples.result }}' ] || [ 'closed' == '${{ github.event.action }}' ]; then exit 0 fi exit 1 diff --git a/.yo-rc.json b/.yo-rc.json index 8c1ebfce9..d38669dac 100644 --- a/.yo-rc.json +++ b/.yo-rc.json @@ -43,6 +43,7 @@ "written": true } }, + "githubWorkflows": true, "jhipsterVersion": "8.8.0", "localBlueprint": false, "packageJsonType": "module", diff --git a/.yo-resolve b/.yo-resolve index 344db8704..87bd35065 100644 --- a/.yo-resolve +++ b/.yo-resolve @@ -1,5 +1,5 @@ .blueprint/cli/commands.mjs .blueprint/generate-sample/** -.github/workflows/generator.yml +.github/workflows/samples.yml .prettierrc.yml skip README.md skip diff --git a/cli/cli-customizations.cjs b/cli/cli-customizations.cjs index c54d267e8..337a396eb 100644 --- a/cli/cli-customizations.cjs +++ b/cli/cli-customizations.cjs @@ -1,7 +1,8 @@ // This file will not be overwritten by generate-blueprint module.exports = { - printBlueprintLogo: async () => { + printLogo: async () => { const { printLogo } = await import('./logo.mjs'); return printLogo(); }, + printBlueprintLogo: () => {}, }; diff --git a/cli/cli.cjs b/cli/cli.cjs index 6958e7884..a4ad5dcd6 100755 --- a/cli/cli.cjs +++ b/cli/cli.cjs @@ -12,7 +12,6 @@ const blueprint = packageFolderName.startsWith('jhipster-') ? `generator-${packa (async () => { const { runJHipster, done, logger } = await import('generator-jhipster/cli'); - const { printLogo } = await import('./logo.mjs'); const executableName = Object.keys(bin)[0]; runJHipster({ @@ -23,8 +22,12 @@ const blueprint = packageFolderName.startsWith('jhipster-') ? `generator-${packa blueprints: { [blueprint]: version, }, - printLogo, + printBlueprintLogo: () => { + console.log('===================== JHipster Kotlin ====================='); + console.log(''); + }, lookups: [{ packagePaths: [packagePath] }], + ...require('./cli-customizations.cjs'), }).catch(done); process.on('unhandledRejection', up => { diff --git a/test-integration/scripts/00-init-env.sh b/test-integration/scripts/00-init-env.sh deleted file mode 100755 index ae1f69662..000000000 --- a/test-integration/scripts/00-init-env.sh +++ /dev/null @@ -1,109 +0,0 @@ -#!/usr/bin/env bash - -KHI_DETECTED_DIR="$( cd "$( dirname $( dirname $( dirname "${BASH_SOURCE[0]}" ) ) )" >/dev/null 2>&1 && pwd )" - -# JHipster cloned -# folder where the generator-jhipster is cloned -JHI_CLONED_HOME="$JHI_HOME" - -init_var() { - result="" - if [[ $1 != "" ]]; then - result=$1 - elif [[ $2 != "" ]]; then - result=$2 - elif [[ $3 != "" ]]; then - result=$3 - fi - echo $result -} - -# uri of repo -if [[ "$KHI_REPO" == "" ]]; then - KHI_REPO=$(init_var "$BUILD_REPOSITORY_URI" "$GITHUB_WORKSPACE" ) -fi - -# folder for generator-jhipster-kotlin -if [[ "$KHI_HOME" == "" ]]; then - KHI_HOME="$KHI_DETECTED_DIR" -fi - -# folder for executable package (blueprints or generator-jhipster) -if [[ "$KHI_CLI_PACKAGE_PATH" == "" ]]; then - if [[ "$KHI_CLI_PACKAGE" != "" && "$KHI_WORKSPACE" != "" ]]; then - KHI_CLI_PACKAGE_PATH="$KHI_WORKSPACE/$KHI_CLI_PACKAGE" - else - KHI_CLI_PACKAGE_PATH="$KHI_HOME" - fi -fi - -# folder where the repo is cloned -if [[ "$KHI_REPO_PATH" == "" ]]; then - KHI_REPO_PATH=$(init_var "$BUILD_REPOSITORY_LOCALPATH" "$GITHUB_WORKSPACE") -fi - -if [[ "$KHI_LIB_HOME" == "" ]]; then - if [[ "$KHI_REPO" == *"/jhipster-bom" ]]; then - KHI_LIB_HOME="$KHI_REPO_PATH" - else - KHI_LIB_HOME="$HOME"/jhipster-bom - fi -fi - -# folder for test-integration -if [[ "$KHI_INTEG" == "" ]]; then - KHI_INTEG="$KHI_HOME"/test-integration -fi - -if [[ "$JHI_SAMPLES" == "" ]]; then - JHI_SAMPLES="$KHI_INTEG"/samples -fi - -if [[ -d "$JHI_SAMPLES"/.jhipster ]]; then - JHI_ENTITY_SAMPLES="$JHI_SAMPLES"/.jhipster -else - JHI_ENTITY_SAMPLES="$JHI_HOME"/test-integration/samples/.jhipster -fi - -# folder for jdls samples -if [[ "$JHI_JDL_SAMPLES" == "" ]]; then - JHI_JDL_SAMPLES="$KHI_INTEG"/jdl-samples -fi - -# folder for scripts -if [[ "$KHI_SCRIPTS" == "" ]]; then - KHI_SCRIPTS="$KHI_INTEG"/scripts -fi - -# folder for app -if [[ "$KHI_FOLDER_APP" == "" ]]; then - KHI_FOLDER_APP="$HOME"/app -fi - -if [[ "$KHI_CLI" == "" ]]; then - KHI_CLI=cli.cjs -fi - -# set correct OpenJDK version -if [[ "$JHI_JDK" == "11" && "$JHI_GITHUB_CI" != "true" ]]; then - JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:bin/java::") -fi - - -# folder for generator-jhipster test-integration -if [[ "$JHI_INTEG" == "" ]]; then - JHI_INTEG="$JHI_HOME"/test-integration -fi - -# folder for generator-jhipster samples -if [[ "$JHI_SAMPLES" == "" ]]; then - JHI_SAMPLES="$KHI_INTEG"/samples -fi - -# folder for generator-jhipster scripts -if [[ "$KHI_SCRIPTS" == "" ]]; then - KHI_SCRIPTS="$KHI_INTEG"/scripts -fi - -# generator-jhipster version -# JHI_VERSION=$(grep -o '"version": "[^"]*"' $JHI_HOME/package.json | cut -f4 -d '"') diff --git a/test-integration/scripts/01-display-configuration.sh b/test-integration/scripts/01-display-configuration.sh deleted file mode 100755 index af6f26e55..000000000 --- a/test-integration/scripts/01-display-configuration.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash - -source $(dirname $0)/00-init-env.sh - -echo "----- parameters -----" -echo JHI_APP="$JHI_APP" -echo JHI_ENTITY="$JHI_ENTITY" -echo JHI_PROFILE="$JHI_PROFILE" -echo JHI_RUN_APP="$JHI_RUN_APP" -echo JHI_JDK="$JHI_JDK" -echo JHI_LIB_REPO="$JHI_LIB_REPO" -echo JHI_LIB_BRANCH="$JHI_LIB_BRANCH" -echo JHI_GEN_REPO="$JHI_GEN_REPO" -echo JHI_GEN_BRANCH="$JHI_GEN_BRANCH" -echo JHI_DISABLE_WEBPACK_LOGS="$JHI_DISABLE_WEBPACK_LOGS" -echo JHI_E2E_HEADLESS="$JHI_E2E_HEADLESS" -echo SPRING_OUTPUT_ANSI_ENABLED="$SPRING_OUTPUT_ANSI_ENABLED" -echo SPRING_JPA_SHOW_SQL="$SPRING_JPA_SHOW_SQL" -echo "----- technical vars -----" -echo KHI_REPO="$KHI_REPO" -echo KHI_HOME="$KHI_HOME" -echo KHI_INTEG="$KHI_INTEG" -echo KHI_SCRIPTS="$KHI_SCRIPTS" -echo KHI_FOLDER_APP="$KHI_FOLDER_APP" -echo "----- generator-jhipster ------" -echo JAVA_HOME="$JAVA_HOME" -echo JHI_ENTITY_SAMPLES="$JHI_ENTITY_SAMPLES" -echo JHI_CLONED_HOME="$JHI_CLONED_HOME" -echo JHI_CLONED_INTEG="$JHI_CLONED_INTEG" -echo JHI_CLONED_SAMPLES="$JHI_CLONED_SAMPLES" -echo JHI_CLONED_SCRIPTS="$JHI_CLONED_SCRIPTS" -echo JHI_NODE_VERSION="$JHI_NODE_VERSION" -echo JHI_NPM_VERSION="$JHI_NPM_VERSION" diff --git a/test-integration/scripts/02-display-tools.sh b/test-integration/scripts/02-display-tools.sh deleted file mode 100644 index 0d5f3acba..000000000 --- a/test-integration/scripts/02-display-tools.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -git version -java -version -node -v -npm -v -docker version -docker-compose version diff --git a/test-integration/scripts/03-system.sh b/test-integration/scripts/03-system.sh deleted file mode 100755 index 2fc9b8eda..000000000 --- a/test-integration/scripts/03-system.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -sudo /etc/init.d/mysql stop - -echo "127.0.0.1 keycloak" | sudo tee -a /etc/hosts diff --git a/test-integration/scripts/04-git-config.sh b/test-integration/scripts/04-git-config.sh deleted file mode 100755 index 41cdacb8a..000000000 --- a/test-integration/scripts/04-git-config.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -set -e -source $(dirname $0)/00-init-env.sh - -git config --global user.name "JHipster Bot" -git config --global user.email "jhipster-bot@jhipster.tech" diff --git a/test-integration/scripts/10-install-jhipster.sh b/test-integration/scripts/10-install-jhipster.sh deleted file mode 100755 index 139bef2aa..000000000 --- a/test-integration/scripts/10-install-jhipster.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env bash - -set -e -source $(dirname $0)/00-init-env.sh - -#------------------------------------------------------------------------------- -# Install JHipster Dependencies and Server-side library -#------------------------------------------------------------------------------- -cd "$HOME" -echo "*** generator-jhipster: JHI_GEN_REPO=$JHI_GEN_REPO with JHI_GEN_BRANCH=$JHI_GEN_BRANCH" -git clone "$JHI_GEN_REPO" generator-jhipster -cd generator-jhipster -echo "*** Checkout branch $JHI_GEN_BRANCH" -git checkout "$JHI_GEN_BRANCH" - -#------------------------------------------------------------------------------- -# Override config -#------------------------------------------------------------------------------- - -# replace 00-init-env.sh -cp "$KHI_SCRIPTS"/00-init-env.sh "$JHI_SCRIPTS"/ - -# copy all samples -# TODO Clean up if it is not throwing any errors -# cp -R "$KHI_SAMPLES"/* "$JHI_SAMPLES"/ - -#------------------------------------------------------------------------------- -# Install JHipster Kotlin -#------------------------------------------------------------------------------- -cd "$KHI_HOME"/ - -npm ci -npm i -g . -# TODO check why this is needed. -#npm link -# -#if [[ "$JHI_APP" == "" ]]; then -# npm test -#fi diff --git a/test-integration/scripts/11-generate-config.sh b/test-integration/scripts/11-generate-config.sh deleted file mode 100755 index 58a7875d9..000000000 --- a/test-integration/scripts/11-generate-config.sh +++ /dev/null @@ -1,218 +0,0 @@ -#!/usr/bin/env bash - -#------------------------------------------------------------------------------- -# Eg: 11-generate-config.sh ./ ng-default sqlfull -#------------------------------------------------------------------------------- -if [[ "$1" != "" ]]; then - KHI_FOLDER_APP=$1 -fi - -if [[ "$2" != "" ]]; then - JHI_APP=$2 -fi - -if [[ "$3" != "" ]]; then - JHI_ENTITY=$3 -fi - -set -e -if [[ -a $(dirname $0)/00-init-env.sh ]]; then - source $(dirname $0)/00-init-env.sh -else - echo "*** 00-init-env.sh not found" -fi - -#------------------------------------------------------------------------------- -# Functions -#------------------------------------------------------------------------------- -moveEntity() { - local entity="$1" - cp "$JHI_ENTITY_SAMPLES"/"$entity".json "$KHI_FOLDER_APP"/.jhipster/ -} - -prepareFolder() { - cd "$KHI_HOME" - rm -rf "$KHI_FOLDER_APP" -} -#------------------------------------------------------------------------------- -# Copy entities json -#------------------------------------------------------------------------------- - -if [[ $KHI_REPO != "" ]]; then - prepareFolder -fi - -mkdir -p "$KHI_FOLDER_APP"/.jhipster/ -cd "$KHI_FOLDER_APP" - -if [[ "$JHI_ENTITY" != "jdl" && "$JHI_APP" != "jdl" ]]; then - #------------------------------------------------------------------------------- - # Copy jhipster config - #------------------------------------------------------------------------------- - if [[ -f "$JHI_SAMPLES"/"$JHI_APP"/.yo-rc.json ]]; then - JHI_APP_SAMPLE_DIR="$JHI_SAMPLES"/"$JHI_APP" - else - JHI_APP_SAMPLE_DIR="$JHI_INTEG"/samples/"$JHI_APP" - fi - cp -f "$JHI_APP_SAMPLE_DIR"/.yo-rc.json "$KHI_FOLDER_APP"/ - echo "$JHI_APP: ($JHI_APP_SAMPLE_DIR)" - ls -al "$KHI_FOLDER_APP"/ -fi -if [[ ("$JHI_ENTITY" == "mongodb") || ("$JHI_ENTITY" == "couchbase") ]]; then - moveEntity DocumentBankAccount - moveEntity EmbeddedOperation - moveEntity Place - moveEntity Division - - moveEntity FieldTestEntity - moveEntity FieldTestMapstructAndServiceClassEntity - moveEntity FieldTestServiceClassAndJpaFilteringEntity - moveEntity FieldTestServiceImplEntity - moveEntity FieldTestInfiniteScrollEntity - moveEntity FieldTestPaginationEntity - - moveEntity EntityWithDTO - moveEntity EntityWithPaginationAndDTO - moveEntity EntityWithServiceClassAndPagination - moveEntity EntityWithServiceClassPaginationAndDTO - moveEntity EntityWithServiceImplAndDTO - moveEntity EntityWithServiceImplAndPagination - moveEntity EntityWithServiceImplPaginationAndDTO - -elif [[ "$JHI_ENTITY" == "neo4j" ]]; then - moveEntity Album - moveEntity Track - moveEntity Genre - moveEntity Artist - -elif [[ "$JHI_ENTITY" == "cassandra" ]]; then - moveEntity CassBankAccount - - moveEntity FieldTestEntity - moveEntity FieldTestServiceImplEntity - moveEntity FieldTestMapstructAndServiceClassEntity - moveEntity FieldTestPaginationEntity - -elif [[ "$JHI_ENTITY" == "micro" ]]; then - moveEntity MicroserviceBankAccount - moveEntity MicroserviceOperation - moveEntity MicroserviceLabel - - moveEntity FieldTestEntity - moveEntity FieldTestMapstructAndServiceClassEntity - moveEntity FieldTestServiceClassAndJpaFilteringEntity - moveEntity FieldTestServiceImplEntity - moveEntity FieldTestInfiniteScrollEntity - moveEntity FieldTestPaginationEntity - -elif [[ "$JHI_ENTITY" == "sqllight" ]]; then - moveEntity BankAccount - moveEntity Label - moveEntity Operation - -elif [[ "$JHI_ENTITY" == "sqlfull" ]]; then - moveEntity BankAccount - moveEntity Label - moveEntity Operation - moveEntity Place - moveEntity Division - - moveEntity FieldTestEntity - moveEntity FieldTestMapstructAndServiceClassEntity - moveEntity FieldTestServiceClassAndJpaFilteringEntity - moveEntity FieldTestServiceImplEntity - moveEntity FieldTestInfiniteScrollEntity - moveEntity FieldTestPaginationEntity - moveEntity FieldTestEnumWithValue - - moveEntity TestEntity - moveEntity TestMapstruct - moveEntity TestServiceClass - moveEntity TestServiceImpl - moveEntity TestInfiniteScroll - moveEntity TestPagination - moveEntity TestManyToOne - moveEntity TestManyToMany - moveEntity TestManyRelPaginDTO - moveEntity TestOneToOne - moveEntity TestCustomTableName - moveEntity TestTwoRelationshipsSameEntity - moveEntity SuperMegaLargeTestEntity - - moveEntity EntityWithDTO - moveEntity EntityWithPaginationAndDTO - moveEntity EntityWithServiceClassAndPagination - moveEntity EntityWithServiceClassPaginationAndDTO - moveEntity EntityWithServiceImplAndDTO - moveEntity EntityWithServiceImplAndPagination - moveEntity EntityWithServiceImplPaginationAndDTO - - moveEntity MapsIdParentEntityWithoutDTO - moveEntity MapsIdChildEntityWithoutDTO - moveEntity MapsIdGrandchildEntityWithoutDTO - moveEntity MapsIdParentEntityWithDTO - moveEntity MapsIdChildEntityWithDTO - moveEntity MapsIdGrandchildEntityWithDTO - moveEntity MapsIdUserProfileWithDTO - - moveEntity JpaFilteringRelationship - moveEntity JpaFilteringOtherSide - -elif [[ "$JHI_ENTITY" == "sql" ]]; then - moveEntity BankAccount - moveEntity Label - moveEntity Operation - - moveEntity FieldTestEntity - moveEntity FieldTestMapstructAndServiceClassEntity - moveEntity FieldTestServiceClassAndJpaFilteringEntity - moveEntity FieldTestServiceImplEntity - moveEntity FieldTestInfiniteScrollEntity - moveEntity FieldTestPaginationEntity - moveEntity FieldTestEnumWithValue - - moveEntity EntityWithDTO - moveEntity EntityWithPaginationAndDTO - moveEntity EntityWithServiceClassAndPagination - moveEntity EntityWithServiceClassPaginationAndDTO - moveEntity EntityWithServiceImplAndDTO - moveEntity EntityWithServiceImplAndPagination - moveEntity EntityWithServiceImplPaginationAndDTO - - moveEntity MapsIdUserProfileWithDTO - -elif [[ "$3" != "" ]]; then - JHI_JDL_ENTITY=$3 -fi - -#------------------------------------------------------------------------------- -# Generate jdl entities -#------------------------------------------------------------------------------- -if [[ "$JHI_JDL_ENTITY" != "" && "$JHI_JDL_ENTITY" != "none" ]]; then - IFS=',' - for i in `echo "$JHI_JDL_ENTITY"` - do - if [[ -d "$JHI_SAMPLES/jdl-entities/$i" ]]; then - cli.cjs --no-insight jdl "$JHI_SAMPLES"/jdl-entities/$i --json-only - - elif [[ -f "$JHI_SAMPLES/jdl-entities/$i.jdl" ]]; then - cp -f "$JHI_SAMPLES/jdl-entities/$i.jdl" "$KHI_FOLDER_APP"/ - cli.cjs --no-insight jdl "$JHI_SAMPLES"/jdl-entities/$i.jdl --json-only - - fi - done -fi - -#------------------------------------------------------------------------------- -# Print entities json -#------------------------------------------------------------------------------- -echo "*** Entities:" -ls -al "$KHI_FOLDER_APP"/.jhipster/ - -#------------------------------------------------------------------------------- -# Force no insight -#------------------------------------------------------------------------------- -if [ "$KHI_FOLDER_APP" == "$HOME/app" ]; then - mkdir -p "$HOME"/.config/configstore/ - cp "$KHI_INTEG"/configstore/*.json "$HOME"/.config/configstore/ -fi diff --git a/test-integration/scripts/12-generate-project.sh b/test-integration/scripts/12-generate-project.sh deleted file mode 100755 index 3b19e59ea..000000000 --- a/test-integration/scripts/12-generate-project.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/env bash - -set -e -source $(dirname $0)/00-init-env.sh - -#------------------------------------------------------------------------------- -# Force no insight -#------------------------------------------------------------------------------- -if [ "$KHI_FOLDER_APP" == "$HOME/app" ]; then - mkdir -p "$HOME"/.config/configstore/ - cp "$KHI_INTEG"/configstore/*.json "$HOME"/.config/configstore/ -fi - -if [[ "$JHI_ENTITY" == "jdl" ]]; then - #------------------------------------------------------------------------------- - # Generate with JDL - #------------------------------------------------------------------------------- - mkdir -p "$KHI_FOLDER_APP" - IFS=',' - for i in `echo "$JHI_APP"` - do - cp -f "$JHI_SAMPLES"/"$i"/*.jdl "$KHI_FOLDER_APP"/ - done - cd "$KHI_FOLDER_APP" - ls -la "$KHI_FOLDER_APP"/ - eval "$KHI_CLI import-jdl *.jdl --no-insight --skip-ktlint-format $@" - -elif [[ "$JHI_APP" == "jdl" ]]; then - #------------------------------------------------------------------------------- - # Generate project with jhipster using jdl - #------------------------------------------------------------------------------- - mkdir -p "$KHI_FOLDER_APP" - - IFS=',' - for i in `echo "$JHI_JDL_APP"` - do - if [[ -f "$i" ]]; then - cp -f "$i" "$KHI_FOLDER_APP"/ - - elif [[ -d "$i" ]]; then - cp -f "$i"/*.jdl "$KHI_FOLDER_APP"/ - - elif [[ -d "$JHI_SAMPLES/jdl-entities/$i" ]]; then - cp -f "$JHI_SAMPLES/jdl-entities/$i/*.jdl" "$KHI_FOLDER_APP"/ - - elif [[ -f "$JHI_SAMPLES/jdl-entities/$i.jdl" ]]; then - cp -f "$JHI_SAMPLES/jdl-entities/$i.jdl" "$KHI_FOLDER_APP"/ - - else - cp -f "$JHI_JDL_SAMPLES"/"$i"/*.jdl "$KHI_FOLDER_APP"/ - fi - done - - ls -la "$KHI_FOLDER_APP"/ - cd "$KHI_FOLDER_APP" - eval "$KHI_CLI jdl *.jdl --no-insight --skip-ktlint-format $@" - -else - - #------------------------------------------------------------------------------- - # Generate project with jhipster - #------------------------------------------------------------------------------- - mkdir -p "$KHI_FOLDER_APP" - if [[ "$JHI_GENERATE_SKIP_CONFIG" != "1" ]]; then - cp -f "$JHI_SAMPLES"/"$JHI_APP"/.yo-rc.json "$KHI_FOLDER_APP"/ - else - echo "skipping config file" - fi - cd "$KHI_FOLDER_APP" - eval "$KHI_CLI --force --no-insight --skip-checks --skip-ktlint-format $@" - -fi - -cd "$KHI_FOLDER_APP" - -#------------------------------------------------------------------------------- -# Check folder where the app is generated -#------------------------------------------------------------------------------- -ls -al "$KHI_FOLDER_APP" -git --no-pager log -n 10 --graph --pretty='%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit || true diff --git a/test-integration/scripts/14-jhipster-info.sh b/test-integration/scripts/14-jhipster-info.sh deleted file mode 100755 index 683e4c281..000000000 --- a/test-integration/scripts/14-jhipster-info.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -set -e -source $(dirname $0)/00-init-env.sh - -cd "$KHI_FOLDER_APP" -cli.cjs info diff --git a/test-integration/scripts/22-tests-frontend-npm.sh b/test-integration/scripts/22-tests-frontend-npm.sh deleted file mode 100755 index 5cb14a520..000000000 --- a/test-integration/scripts/22-tests-frontend-npm.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash - -set -e -source $(dirname $0)/00-init-env.sh - -#------------------------------------------------------------------------------- -# Launch frontend tests -#------------------------------------------------------------------------------- -cd "$KHI_FOLDER_APP" - JHI_CLIENT_PACKAGE_MANAGER=npm - -if [ -f "tsconfig.json" ]; then - if [ -f "src/main/webapp/app/app.tsx" ]; then - $JHI_CLIENT_PACKAGE_MANAGER run test-ci - else - $JHI_CLIENT_PACKAGE_MANAGER test - fi -fi diff --git a/test-integration/scripts/25-sonar-analyze.sh b/test-integration/scripts/25-sonar-analyze.sh deleted file mode 100755 index 16f52f421..000000000 --- a/test-integration/scripts/25-sonar-analyze.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash - -source $(dirname $0)/00-init-env.sh - -#-------------------------------------------------- -# Launch Sonar analysis -#-------------------------------------------------- -cd "$KHI_FOLDER_APP" - -if [[ "$JHI_APP" = "ng-default" && "$GITHUB_REPOSITORY" = "jhipster/generator-jhipster" && "$GITHUB_REF" = "refs/heads/main" ]]; then - echo "*** Sonar analyze for main branch" - ./mvnw -ntp --batch-mode initialize org.jacoco:jacoco-maven-plugin:prepare-agent sonar:sonar \ - -Dsonar.host.url=https://sonarcloud.io \ - -Dsonar.projectKey=jhipster-sample-application \ - -Dsonar.organization=jhipster \ - -Dsonar.login=$SONAR_TOKEN - -elif [[ $JHI_SONAR = 1 ]]; then - echo "*** Sonar analyze locally" - ./mvnw -ntp --batch-mode initialize org.jacoco:jacoco-maven-plugin:prepare-agent sonar:sonar \ - -Dsonar.host.url=http://localhost:9001 \ - -Dsonar.projectKey=JHipsterSonar - - sleep 30 - docker-compose -f src/main/docker/sonar.yml logs - echo "*** Sonar results:" - curl 'http://localhost:9001/api/measures/component?componentKey=JHipsterSonar&metricKeys=bugs%2Ccoverage%2Cvulnerabilities%2Cduplicated_lines_density%2Ccode_smells' - -else - echo "*** No sonar analyze" - -fi diff --git a/test-integration/scripts/99-build-changes.sh b/test-integration/scripts/99-build-changes.sh deleted file mode 100755 index 9cb8651af..000000000 --- a/test-integration/scripts/99-build-changes.sh +++ /dev/null @@ -1,160 +0,0 @@ -#!/usr/bin/env bash - -CLIENT=false -CLIENT_COMMON=false -SERVER=false -COMMON=false -WORKSPACES=false -E2E=false -ANY=false - -WORKFLOW_ANGULAR=false -WORKFLOW_REACT=false -WORKFLOW_VUE=false - -if [[ "true" == "$SKIP_WORKFLOW" ]]; then - echo "::set-output name=angular::false" - echo "::set-output name=react::false" - echo "::set-output name=vue::false" - echo "::set-output name=client-common::false" - - echo "::set-output name=workflow-angular::false" - echo "::set-output name=workflow-react::false" - echo "::set-output name=workflow-vue::false" - - echo "::set-output name=client::${CLIENT}" - echo "::set-output name=server::${SERVER}" - echo "::set-output name=common::${COMMON}" - echo "::set-output name=workspaces::${WORKSPACES}" - echo "::set-output name=e2e::${E2E}" - echo "::set-output name=any::${ANY}" - echo "::set-output name=matrix::{}" - exit 0 -fi - -if [[ "true" == "$SKIP_CHANGES_DETECTION" ]]; then - echo "::set-output name=angular::true" - echo "::set-output name=react::true" - echo "::set-output name=vue::true" - echo "::set-output name=client-common::true" - - echo "::set-output name=workflow-angular::true" - echo "::set-output name=workflow-react::true" - echo "::set-output name=workflow-vue::true" - - echo "::set-output name=client::true" - echo "::set-output name=server::true" - echo "::set-output name=common::true" - echo "::set-output name=workspaces::true" - echo "::set-output name=e2e::true" - echo "::set-output name=any::true" - echo "::set-output name=matrix::{}" - exit 0 -fi - -echo "::group::Check Angular" -git -c color.ui=always diff --exit-code @~1 -- \ - 'generators/*client/**/angular/**' \ - 'generators/*client/**/*-angular*' \ - || ANGULAR=true WORKFLOW_ANGULAR=true -echo "::endgroup::" - -echo "::group::Check React" -git -c color.ui=always diff --exit-code @~1 -- \ - 'generators/*client/**/react/**' \ - 'generators/*client/**/*-react*' \ - || REACT=true WORKFLOW_REACT=true -echo "::endgroup::" - -echo "::group::Check Vue" -git -c color.ui=always diff --exit-code @~1 -- \ - 'generators/*client/**/vue/**' \ - 'generators/*client/**/*-vue*' \ - || VUE=true WORKFLOW_VUE=true -echo "::endgroup::" - -echo "::group::Check Client Common" -git -c color.ui=always diff --exit-code @~1 -- \ - 'generators/*client/**' \ - ':^*-angular*' \ - ':^**/angular/**' \ - ':^*-react*' \ - ':^**/react/**' \ - ':^*-vue*' \ - ':^**/vue/**' \ - || CLIENT_COMMON=true -echo "::endgroup::" - -echo "::group::Check Client" -git -c color.ui=always diff --exit-code @~1 -- \ - 'generators/*client/**' \ - || CLIENT=true ANY=true -echo "::endgroup::" - -echo "::group::Check Server" -git -c color.ui=always diff --exit-code @~1 -- \ - 'generators/*server/**' \ - 'generators/database-changelog' \ - 'generators/database-changelog-liquibase' \ - || SERVER=true ANY=true -echo "::endgroup::" - -echo "::group::Check Common" -git -c color.ui=always diff --exit-code @~1 -- \ - '.github/actions' \ - '.github/workflows' \ - 'generators/app' \ - 'generators/bootstrap' \ - 'generators/common' \ - 'generators/entities' \ - 'generators/entity' \ - 'generators/entity-i18n' \ - 'generators/gradle' \ - 'generators/languages' \ - 'generators/maven' \ - 'jdl' \ - 'lib' \ - 'test-integration' \ - 'utils' \ - || CLIENT=true SERVER=true COMMON=true ANY=true -echo "::endgroup::" - -echo "::group::Check Base" -git -c color.ui=always diff --exit-code @~1 -- $(ls generators/*.*) \ - || CLIENT=true SERVER=true COMMON=true ANY=true -echo "::endgroup::" - -echo "::group::Check E2E" -git -c color.ui=always diff --exit-code @~1 -- \ - 'generators/cypress' \ - || E2E=true ANY=true -echo "::endgroup::" - -echo "::group::Check Workspaces" -git -c color.ui=always diff --exit-code @~1 -- \ - 'generators/workspaces' \ - 'generators/docker-compose' \ - || WORKSPACES=true ANY=true -echo "::endgroup::" - -if [ "true" == "$SERVER" ] || [ "true" == "$CLIENT_COMMON" ] || [ "true" == "$COMMON" ] || [ "true" == "$WORKSPACES" ] || [ "true" == "$E2E" ]; then - WORKFLOW_ANGULAR=true - WORKFLOW_REACT=true - WORKFLOW_VUE=true -fi - -echo "::set-output name=angular::${ANGULAR}" -echo "::set-output name=react::${REACT}" -echo "::set-output name=vue::${VUE}" -echo "::set-output name=client-common::${CLIENT_COMMON}" - -echo "::set-output name=workflow-angular::${WORKFLOW_ANGULAR}" -echo "::set-output name=workflow-react::${WORKFLOW_REACT}" -echo "::set-output name=workflow-vue::${WORKFLOW_VUE}" - -echo "::set-output name=client::${CLIENT}" -echo "::set-output name=server::${SERVER}" -echo "::set-output name=common::${COMMON}" -echo "::set-output name=workspaces::${WORKSPACES}" -echo "::set-output name=e2e::${E2E}" -echo "::set-output name=any::${ANY}" diff --git a/test-integration/scripts/99-print-matrix.js b/test-integration/scripts/99-print-matrix.js deleted file mode 100755 index 12cd52a67..000000000 --- a/test-integration/scripts/99-print-matrix.js +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env node -import { readFileSync, writeFileSync } from 'node:fs'; -import { dirname, join } from 'node:path'; -import { fileURLToPath } from 'node:url'; -const MATRIX_FILE = 'matrix.json'; - -const __filename = fileURLToPath(import.meta.url); -const __dirname = dirname(__filename); - -let existing = {}; -try { - existing = JSON.parse(readFileSync(MATRIX_FILE)); -} catch { - console.log(`File ${MATRIX_FILE} not found`); - existing = { include: [] }; -} - -writeFileSync( - MATRIX_FILE, - JSON.stringify( - { - include: [ - ...existing.include, - ...process.argv - .slice(2) - .map(file => { - try { - return JSON.parse(readFileSync(join(__dirname, `../../${file}`)).toString()).include.filter( - sample => !sample.disabled, - ); - } catch { - console.log(`File ${file} not found`); - return []; - } - }) - .flat(), - ], - }, - null, - 2, - ), -);