-
-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework CI to use dev blueprint instead of bash scripts. (#467)
- Loading branch information
Showing
165 changed files
with
260 additions
and
1,519 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
42 changes: 21 additions & 21 deletions
42
...integration/workflow-samples/angular.json → .../templates/_workflow-samples/angular.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { angularSamples } from '../support/workflow-samples.mjs'; | ||
|
||
export default angularSamples; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { reactSamples } from '../support/workflow-samples.mjs'; | ||
|
||
export default reactSamples; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)); | ||
} | ||
}, | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { default } from './generator.mjs'; | ||
export { default as command } from './command.mjs'; |
Oops, something went wrong.