Skip to content

Commit

Permalink
Merge branch 'main' into jh-25421
Browse files Browse the repository at this point in the history
  • Loading branch information
pmohan committed Oct 30, 2024
2 parents 4189bab + a585c28 commit b98304a
Show file tree
Hide file tree
Showing 1,560 changed files with 34,866 additions and 30,845 deletions.
4 changes: 4 additions & 0 deletions .blueprint/cli/commands.mjs → .blueprint/cli/commands.mts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ const defaultCommands = {
desc: 'Generate a test sample',
blueprint: '@jhipster/jhipster-dev',
},
'github-build-matrix': {
desc: 'Generate a matrix for GitHub Actions',
blueprint: '@jhipster/jhipster-dev',
},
'update-vscode': {
desc: 'Update generator-jhipster vscode files',
blueprint: '@jhipster/jhipster-dev',
Expand Down
2 changes: 1 addition & 1 deletion .blueprint/code-workspace/command.mts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type JHipsterCommandDefinition } from '../../generators/base/api.js';
import { type JHipsterCommandDefinition } from '../../lib/command/index.js';

const command: JHipsterCommandDefinition = {
arguments: {},
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions .blueprint/from-issue/command.mts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { JHipsterCommandDefinition } from '../../generators/base/api.js';
import type { JHipsterCommandDefinition } from '../../lib/command/index.js';
import { GENERATOR_APP, GENERATOR_WORKSPACES } from '../../generators/generator-list.js';
import { parseIssue } from '../../testing/github.js';
import { parseIssue } from '../../lib/testing/github.js';

const command: JHipsterCommandDefinition = {
configs: {
Expand Down
2 changes: 1 addition & 1 deletion .blueprint/from-issue/generator.mts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { join } from 'node:path';

import BaseGenerator from '../../generators/base/index.js';
import { getGithubIssue, setGithubTaskOutput, prepareSample } from '../../testing/index.js';
import { getGithubIssue, setGithubTaskOutput, prepareSample } from '../../lib/testing/index.js';
import { promptSamplesFolder } from '../support.mjs';
import { GENERATOR_APP, GENERATOR_JDL, GENERATOR_WORKSPACES } from '../../generators/generator-list.js';
import { extractDataFromInfo, type InfoData } from '../../generators/info/support/index.js';
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion .blueprint/generate-generator/command.mts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { JHipsterCommandDefinition } from '../../generators/base/api.js';
import type { JHipsterCommandDefinition } from '../../lib/command/index.js';

const command: JHipsterCommandDefinition = {
configs: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import BaseGenerator from '../../generators/base/index.js';
import { camelCase, upperFirst } from 'lodash-es';
import BaseGenerator from '../../generators/base/index.js';

export default class extends BaseGenerator {
generatorNamespace;
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions .blueprint/generate-generator/templates/command.ts.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import type { JHipsterCommandDefinition } from '<%- generatorRelativePath %>base/api.js';
import type { JHipsterCommandDefinition } from '<%- generatorRelativePath %>../lib/command/types.js';

const command: JHipsterCommandDefinition = {
const command = {
configs: {},
import: [],
};
} as const satisfies JHipsterCommandDefinition;

export default command;
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { fileURLToPath } from 'node:url';
import { before, it, describe, expect } from 'esmocha';

import { shouldSupportFeatures, testBlueprintSupport } from '<%- generatorRelativePath %>../test/support/tests.js';
import { defaultHelpers as helpers, result } from '<%- generatorRelativePath %>../testing/index.js';
import { defaultHelpers as helpers, result } from '<%- generatorRelativePath %>../lib/testing/index.js';
import Generator from './index.js';

const __filename = fileURLToPath(import.meta.url);
Expand Down
2 changes: 1 addition & 1 deletion .blueprint/generate-sample/command.mts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import { join } from 'node:path';
import process from 'node:process';
import { defaultSamplesFolder } from '../constants.js';
import { JHipsterCommandDefinition } from '../../generators/base/api.js';
import type { JHipsterCommandDefinition } from '../../lib/command/index.js';
import { GENERATOR_APP, GENERATOR_WORKSPACES } from '../../generators/generator-list.js';

const command: JHipsterCommandDefinition = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import { basename, extname, resolve } from 'path';
import { transform } from '@yeoman/transform';
import BaseGenerator from '../../generators/base/index.js';
import { packageJson } from '../../lib/index.js';
import { generateSample, entitiesByType } from './support/index.js';
import { promptSamplesFolder } from '../support.mjs';
import { GENERATOR_APP, GENERATOR_INFO, GENERATOR_JDL } from '../../generators/generator-list.js';
import { entitiesByType, generateSample } from './support/index.js';
import assert from 'assert';

export default class extends BaseGenerator {
sampleName;
Expand Down Expand Up @@ -64,12 +65,14 @@ export default class extends BaseGenerator {
const sample = await generateSample(this.sampleName, {
destProjectFolder: this.projectFolder,
fork: false,
entity: this.entitiesSample,
});
assert.ok(sample, `Sample ${this.sampleName} not found`);

// Cleanup mem-fs files. Reload them from disk.
await this.pipeline(
{ refresh: true, pendingFiles: false },
transform(() => {}),
transform(() => undefined),
);

let generatorOptions = {
Expand Down Expand Up @@ -101,20 +104,12 @@ export default class extends BaseGenerator {
const entitiesFiles = entitiesByType[this.entitiesSample];
if (entitiesFiles) {
this.jhipsterConfig.entities = entitiesFiles;
/*
this.log.info(`Copying entities ${this.entitiesSample} (${entitiesFiles})`);
this.copyTemplate(
entitiesFiles.map(entity => `.jhipster/${entity}.json`),
this.projectFolder,
{ noGlob: true, fromBasePath: this.templatePath('../../../test-integration/samples/') },
);
*/
entitiesFiles.forEach(entity =>
this.copyTemplate(
`../../../test-integration/samples/.jhipster/${entity}.json`,
`${this.projectFolder}/.jhipster/${entity}.json`,
{ noGlob: true },
),
);
}
await this.composeWithJHipster(GENERATOR_APP, { generatorOptions: { destinationRoot: this.projectFolder } });
},
Expand All @@ -124,7 +119,7 @@ export default class extends BaseGenerator {
generatorOptions: {
samplePath: this.sampleName,
},
});
} as any);
}
},
async info() {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { jdlEntitiesSamplesFolder } from '../../constants.js';
const isDirectory = dir => {
try {
return statSync(dir).isDirectory();
} catch (error) {
} catch {
return false;
}
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { cpSync, existsSync, mkdirSync } from 'fs';
import { join, resolve } from 'path';
import { join } from 'path';
import process from 'process';
import { globSync } from 'glob';
import { execa } from 'execa';

import { dailyBuildsFolder, jdlEntitiesSamplesFolder, jdlSamplesFolder, jhipsterBin, samplesFolder } from '../../constants.js';
import getSamples, { DAILY_PREFIX, isDaily } from './get-workflow-samples.js';
import copyEntitySamples from './copy-entity-samples.js';
import copyJdlEntitySamples from './copy-jdl-entity-samples.js';
import { dailyBuildsFolder, jdlEntitiesSamplesFolder, jdlSamplesFolder, jhipsterBin, samplesFolder } from '../../constants.js';

const commonCliOptions = ['--skip-jhipster-dependencies', '--skip-checks', '--skip-install', '--no-insight'];

Expand All @@ -21,7 +21,15 @@ export const generateSample = async (
jdlEntity: passedJdlEntity,
jdlSamples: passedJdlSamples,
fork = true,
} = {},
}: {
destProjectFolder: string;
environment?: string;
war?: boolean;
entity?: string;
jdlEntity?: string;
jdlSamples?: string;
fork?: boolean;
},
) => {
if (!sampleName) {
throw new Error('Sample name is required');
Expand All @@ -34,6 +42,7 @@ export const generateSample = async (
process.chdir(destProjectFolder);

if (!sample) {
// eslint-disable-next-line no-console
console.log(`Sample ${sampleName} was not found`);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const DAILY_PREFIX = 'daily-';

export const isDaily = workflow => workflow.startsWith(DAILY_PREFIX);

export const getWorkflowSamples = (workflows = WORKFLOW_NAMES) =>
export const getWorkflowSamples = (workflows: string[] = WORKFLOW_NAMES) =>
Object.fromEntries(
workflows.map(workflow => [
workflow,
Expand All @@ -27,7 +27,7 @@ export const getWorkflowSamples = (workflows = WORKFLOW_NAMES) =>
]),
);

export default workflows =>
export default (workflows?: string[]) =>
Object.fromEntries(
Object.values(getWorkflowSamples(workflows))
.map(workflowSamples => Object.entries(workflowSamples))
Expand Down
58 changes: 58 additions & 0 deletions .blueprint/generate-sample/templates/samples/mf-simple.jdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* Microservice stack sample to test compilation and base microfrontend functionality.
*
* @example
* jhipster.cjs generate-sample mf-simple.jdl --client-framework vue
*/

application {
config {
applicationType gateway
baseName gateway
clientFramework angular
creationTimestamp 1617901618886
databaseType no
jwtSecretKey "ZjY4MTM4YjI5YzMwZjhjYjI2OTNkNTRjMWQ5Y2Q0Y2YwOWNmZTE2NzRmYzU3NTMwM2NjOTE3MTllOTM3MWRkMzcyYTljMjVmNmQ0Y2MxOTUzODc0MDhhMTlkMDIxMzI2YzQzZDM2ZDE3MmQ3NjVkODk3OTVmYzljYTQyZDNmMTQ="
packageName jhipster.tech.gateway
serviceDiscoveryType eureka
testFrameworks [cypress]
microfrontends [notification]
}
}

application {
config {
applicationType microservice
baseName notification
creationTimestamp 1617901618887
clientFramework angular
jwtSecretKey "ZjY4MTM4YjI5YzMwZjhjYjI2OTNkNTRjMWQ5Y2Q0Y2YwOWNmZTE2NzRmYzU3NTMwM2NjOTE3MTllOTM3MWRkMzcyYTljMjVmNmQ0Y2MxOTUzODc0MDhhMTlkMDIxMzI2YzQzZDM2ZDE3MmQ3NjVkODk3OTVmYzljYTQyZDNmMTQ="
packageName jhipster.tech.notification
prodDatabaseType postgresql
serverPort 8081
serviceDiscoveryType eureka
testFrameworks [cypress]
}
entities Notification
}

@ChangelogDate(20210408164814)
entity Notification {
title String required
}

deployment {
deploymentType docker-compose,
appsFolders [gateway, notification]
dockerRepositoryName "hipsterslabs"
monitoring no
serviceDiscoveryType eureka
}

deployment {
deploymentType kubernetes,
appsFolders [gateway, notification]
dockerRepositoryName "hipsterslabs"
monitoring no
serviceDiscoveryType eureka
}
Loading

0 comments on commit b98304a

Please sign in to comment.