-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
22de23b
commit c64523e
Showing
17 changed files
with
3,448 additions
and
3,727 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { RECOMMENDED_JAVA_VERSION, RECOMMENDED_NODE_VERSION } from 'generator-jhipster'; | ||
import { fromMatrix } from 'generator-jhipster/testing'; | ||
|
||
const defaultMatrix = { | ||
os: ['ubuntu-latest'], | ||
'node-version': [RECOMMENDED_NODE_VERSION], | ||
'java-version': [RECOMMENDED_JAVA_VERSION], | ||
'default-environment': ['prod'], | ||
}; | ||
|
||
export const buildMatrix = ({ samples, samplesFolder }) => { | ||
return { | ||
include: Object.values( | ||
fromMatrix({ | ||
...defaultMatrix, | ||
'sample-name': samples, | ||
}), | ||
).map(sample => ({ | ||
...sample, | ||
'job-name': sample['sample-name'], | ||
'extra-args': `--samples-folder ${samplesFolder}`, | ||
})), | ||
}; | ||
}; |
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,18 @@ | ||
/** | ||
* @type {import('generator-jhipster').JHipsterCommandDefinition} | ||
*/ | ||
const command = { | ||
configs: { | ||
samplesFolder: { | ||
description: 'Samples folder', | ||
cli: { | ||
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,29 @@ | ||
import { appendFileSync, existsSync } from 'node:fs'; | ||
import os from 'node:os'; | ||
import BaseGenerator from 'generator-jhipster/generators/base'; | ||
import { getSamples } from '../generate-sample/get-samples.mjs'; | ||
import { buildMatrix } from './build-matrix.mjs'; | ||
|
||
export default class extends BaseGenerator { | ||
samplesFolder; | ||
|
||
constructor(args, opts, features) { | ||
super(args, opts, { ...features, queueCommandTasks: true, jhipsterBootstrap: false }); | ||
} | ||
|
||
get [BaseGenerator.WRITING]() { | ||
return this.asWritingTaskGroup({ | ||
async buildMatrix() { | ||
const samplesFolder = this.samplesFolder ?? 'samples'; | ||
const samples = await getSamples(this.templatePath(`../../generate-sample/templates/${samplesFolder}`)); | ||
const matrix = buildMatrix({ samples, samplesFolder }); | ||
const matrixoutput = `matrix<<EOF${os.EOL}${JSON.stringify(matrix)}${os.EOL}EOF${os.EOL}`; | ||
const filePath = process.env.GITHUB_OUTPUT; | ||
console.log(matrixoutput); | ||
if (filePath && existsSync(filePath)) { | ||
appendFileSync(filePath, matrixoutput, { encoding: 'utf8' }); | ||
} | ||
}, | ||
}); | ||
} | ||
} |
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'; |
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 |
---|---|---|
|
@@ -9,10 +9,9 @@ jobs: | |
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v3 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
node-version: 20 | ||
cache: 'npm' | ||
- run: git config --global user.name "JHipster Bot"; git config --global user.email "[email protected]"; git config --global init.defaultBranch main | ||
- run: npm ci | ||
- run: npm run test |
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,9 +1,8 @@ | ||
# Prettier configuration | ||
|
||
printWidth: 140 | ||
singleQuote: true | ||
tabWidth: 2 | ||
useTabs: false | ||
|
||
# js and ts rules: | ||
arrowParens: avoid | ||
bracketSameLine: false | ||
plugins: | ||
- prettier-plugin-packagejson |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// This file will not be overwritten by generate-blueprint | ||
module.exports = {}; |
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
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
Oops, something went wrong.