Skip to content

Commit

Permalink
Merge pull request #396 from mshima/generator-jhipster-8.7.1
Browse files Browse the repository at this point in the history
update generator-jhipster to v8.7.1
  • Loading branch information
DanielFran authored Oct 8, 2024
2 parents 4848bac + 12b4070 commit cb82fc8
Show file tree
Hide file tree
Showing 57 changed files with 3,927 additions and 4,366 deletions.
31 changes: 4 additions & 27 deletions .blueprint/generate-sample/generator.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,17 @@ export default class extends BaseGenerator {
samplesFolder;

constructor(args, opts, features) {
super(args, opts, { ...features, jhipsterBootstrap: false });
}

get [BaseGenerator.INITIALIZING]() {
return this.asInitializingTaskGroup({
async parseCommand() {
await this.parseCurrentJHipsterCommand();
},
});
}

get [BaseGenerator.PROMPTING]() {
return this.asPromptingTaskGroup({
async askForSample() {
await this.promptCurrentJHipsterCommand();
},
});
}

get [BaseGenerator.LOADING]() {
return this.asLoadingTaskGroup({
async loadCommand() {
await this.loadCurrentJHipsterCommandConfig(this);
},
});
super(args, opts, { ...features, queueCommandTasks: true, jhipsterBootstrap: false });
}

get [BaseGenerator.WRITING]() {
return this.asWritingTaskGroup({
async copySample() {
const samplesFolder = `${this.samplesFolder ?? 'samples'}/`;
if (this.all) {
this.copyTemplate(`${this.samplesFolder}/*.jdl`, '');
this.copyTemplate(`${samplesFolder}*.jdl`, '');
} else {
this.copyTemplate(`${this.samplesFolder}/${this.sampleName}`, this.sampleName, { noGlob: true });
this.copyTemplate(`${samplesFolder}${this.sampleName}`, this.sampleName, { noGlob: true });
}
},
});
Expand Down
4 changes: 2 additions & 2 deletions .blueprint/github-build-matrix/generator.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { existsSync, appendFileSync } from 'node:fs';
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';
Expand Down Expand Up @@ -33,7 +33,7 @@ export default class extends BaseGenerator {
const samples = await getSamples(this.templatePath(`../../generate-sample/templates/${this.samplesFolder}`));
const matrix = buildMatrix({ samples, samplesFolder: this.samplesFolder });
const matrixoutput = `matrix<<EOF${os.EOL}${JSON.stringify(matrix)}${os.EOL}EOF${os.EOL}`;
const filePath = process.env['GITHUB_OUTPUT'];
const filePath = process.env.GITHUB_OUTPUT;
console.log(matrixoutput);
if (filePath && existsSync(filePath)) {
appendFileSync(filePath, matrixoutput, { encoding: 'utf8' });
Expand Down
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ insert_final_newline = true

# Change these settings to your own preference
indent_style = space
indent_size = 2
indent_size = 4

[*.md]
trim_trailing_whitespace = false
5 changes: 0 additions & 5 deletions .eslintignore

This file was deleted.

58 changes: 29 additions & 29 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,34 +19,34 @@

version: 2
updates:
- package-ecosystem: 'maven'
directory: '/generators/quarkus/resources/'
schedule:
interval: 'daily'
# Maven doesn't have many PRs, but it triggers every client workflow. Let 2h of interval.
time: '05:00'
open-pull-requests-limit: 5
labels:
- 'theme: dependencies'
- 'skip-changelog'
- package-ecosystem: 'maven'
directory: '/generators/quarkus/resources/'
schedule:
interval: 'daily'
# Maven doesn't have many PRs, but it triggers every client workflow. Let 2h of interval.
time: '05:00'
open-pull-requests-limit: 5
labels:
- 'theme: dependencies'
- 'skip-changelog'

- package-ecosystem: 'gradle'
directory: '/generators/quarkus/resources/'
schedule:
interval: 'daily'
time: '08:00'
open-pull-requests-limit: 5
labels:
- 'theme: dependencies'
- 'skip-changelog'
- package-ecosystem: 'gradle'
directory: '/generators/quarkus/resources/'
schedule:
interval: 'daily'
time: '08:00'
open-pull-requests-limit: 5
labels:
- 'theme: dependencies'
- 'skip-changelog'

- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'weekly'
time: '00:30'
open-pull-requests-limit: 10
labels:
- 'theme: github_actions'
- 'theme: CI builds'
- 'skip-changelog'
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'weekly'
time: '00:30'
open-pull-requests-limit: 10
labels:
- 'theme: github_actions'
- 'theme: CI builds'
- 'skip-changelog'
66 changes: 33 additions & 33 deletions .github/workflows/copyright-update.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
name: Copyright Update
on:
schedule:
- cron: '0 0 31 12 *' # Repeats December 31st every year
schedule:
- cron: '0 0 31 12 *' # Repeats December 31st every year

permissions:
contents: read
contents: read

jobs:
build:
permissions:
contents: write # for peter-evans/create-pull-request to create branch
pull-requests: write # for peter-evans/create-pull-request to create a PR
name: copyright update
if: github.repository == 'jhipster/generator-jhipster-quarkus'
runs-on: ubuntu-latest
timeout-minutes: 40
steps:
# Checkout
- uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
# Update the copyright headers
- name: Find and Replace
run: |
CURRENT_YEAR=$(date +'%Y')
NEW_YEAR=$(($CURRENT_YEAR + 1))
grep -rlZE "Copyright ([0-9]+)-$CURRENT_YEAR" . | xargs -0 sed -i -E "s/Copyright ([0-9]+)-$CURRENT_YEAR/Copyright \1-$NEW_YEAR/g"
# Create PR
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'Update copyright headers'
title: 'Update Copyright Headers'
body: 'This is an automated pull request to update the copyright headers'
branch: 'copyright-date-update'
author: 'jhipster-bot <[email protected]>'
build:
permissions:
contents: write # for peter-evans/create-pull-request to create branch
pull-requests: write # for peter-evans/create-pull-request to create a PR
name: copyright update
if: github.repository == 'jhipster/generator-jhipster-quarkus'
runs-on: ubuntu-latest
timeout-minutes: 40
steps:
# Checkout
- uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
# Update the copyright headers
- name: Find and Replace
run: |
CURRENT_YEAR=$(date +'%Y')
NEW_YEAR=$(($CURRENT_YEAR + 1))
grep -rlZE "Copyright ([0-9]+)-$CURRENT_YEAR" . | xargs -0 sed -i -E "s/Copyright ([0-9]+)-$CURRENT_YEAR/Copyright \1-$NEW_YEAR/g"
# Create PR
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'Update copyright headers'
title: 'Update Copyright Headers'
body: 'This is an automated pull request to update the copyright headers'
branch: 'copyright-date-update'
author: 'jhipster-bot <[email protected]>'
39 changes: 13 additions & 26 deletions .github/workflows/generator.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,17 @@
name: Generator
on: [push, pull_request]
permissions:
contents: read
contents: read
jobs:
quarkus:
name: npm-test
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- run: npm ci
- run: npm run test
check-generator:
permissions:
contents: none
runs-on: ubuntu-latest
needs: [quarkus]
if: always()
steps:
- run: |
echo '${{ toJSON(needs) }}'
if [ 'skipped' == '${{ needs.quarkus.result }}' ] || [ 'success' == '${{ needs.quarkus.result }}' ] || [ 'closed' == '${{ github.event.action }}' ]; then
exit 0
fi
exit 1
quarkus:
name: npm-test
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- run: npm ci
- run: npm run test
30 changes: 15 additions & 15 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ name: Auto Merge
on: pull_request_target

permissions:
pull-requests: write
contents: write
pull-requests: write
contents: write

jobs:
enable-auto-merge:
runs-on: ubuntu-latest
if: ${{ github.repository == 'jhipster/generator-jhipster-quarkus' && github.event.pull_request.user.login == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata
id: dependabot-metadata
uses: dependabot/[email protected]
- name: Enable auto-merge for Dependabot PRs
if: ${{ steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' }}
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
enable-auto-merge:
runs-on: ubuntu-latest
if: ${{ github.repository == 'jhipster/generator-jhipster-quarkus' && github.event.pull_request.user.login == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata
id: dependabot-metadata
uses: dependabot/[email protected]
- name: Enable auto-merge for Dependabot PRs
if: ${{ steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' }}
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
34 changes: 17 additions & 17 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
name: Publish
on:
release:
types: [published]
release:
types: [published]
jobs:
publish-quarkus-blueprint:
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
- name: Checkout quarkus blueprint repository
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
publish-quarkus-blueprint:
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
- name: Checkout quarkus blueprint repository
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Loading

0 comments on commit cb82fc8

Please sign in to comment.