Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to generator-jhipster v8 #926

Merged
merged 46 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
592ead7
add dev-blueprint
mshima Sep 6, 2023
23b1618
drop blueprint dependencies from dependabot
mshima Sep 6, 2023
63e5461
update to jhipster 8
mshima Sep 6, 2023
7d6570d
adjusts
mshima Sep 6, 2023
01e3f1f
adjusts
mshima Sep 6, 2023
f18884c
bump chalk version
mshima Sep 6, 2023
cf87ae1
remove console log
mshima Sep 6, 2023
1e5e8c2
fix command
mshima Sep 6, 2023
27e964e
bump node and java at ci.
mshima Sep 6, 2023
648e0c2
update npm script
mshima Sep 6, 2023
747b604
drop docker compose file customization
mshima Sep 7, 2023
d111f02
update generator-jhipster to branch
mshima Sep 7, 2023
971e296
Resolve conflicts
mraible Sep 27, 2023
7b09e6f
bump branch
mshima Sep 9, 2023
62f6db3
bump jhipster branch
mshima Oct 4, 2023
748958f
Merge remote-tracking branch 'upstream/main' into jhipster-v8
mshima Oct 4, 2023
90e2dd4
update package lock
mshima Oct 4, 2023
8046534
adjusts
mshima Oct 4, 2023
8d6df0f
workaround node with ipv6
mshima Oct 4, 2023
ed5ea7b
migration adjusts
mshima Oct 4, 2023
534e545
don't fail on no entity
mshima Oct 4, 2023
c69c624
use correct generateTestEntity
mshima Oct 4, 2023
2023a9d
fix standalone
mshima Oct 4, 2023
312453e
split tasks
mshima Oct 4, 2023
4f6d194
npm audit fix
mraible Oct 13, 2023
59c70a9
Merge branch 'main' into jhipster-v8
mraible Oct 13, 2023
5f681ad
Recreate package-lock to fix conflicts
mraible Oct 13, 2023
1381e8f
fix instance reference.
mshima Oct 14, 2023
a2b67b5
use @ionic/angular 7.4.4
mshima Oct 14, 2023
6ca876f
Merge branch 'jhipster:main' into jhipster-v8
mshima Oct 14, 2023
ba45055
Merge branch 'jhipster:main' into jhipster-v8
mshima Oct 14, 2023
a1a62f6
prettier
mshima Oct 14, 2023
66c0874
Merge branch 'main' into jhipster-v8
mshima Oct 14, 2023
cf2c778
prettier
mshima Oct 14, 2023
c42e23f
bump generator-jhipster to 8.0.0-rc.1
mshima Oct 14, 2023
d37daab
regenerate using `npx jhipster generate-blueprint`
mshima Oct 14, 2023
ccd97c2
ignore generator resources
mshima Oct 14, 2023
a4c6102
adjusts to dependabot groups
mshima Oct 14, 2023
0358576
update prettier at resources/base
mshima Oct 14, 2023
0747495
Remove defaultProject from angular.json to fix error
mraible Oct 15, 2023
22e4f8b
Fix error: Failed to load config "plugin:@angular-eslint/ng-cli-compa…
mraible Oct 15, 2023
f6d0408
fix cypress with camera capacitor
mshima Oct 17, 2023
83fa0f7
add flickr2 sample to workflow
mshima Oct 17, 2023
423cce8
flickr2 sample adjusts
mshima Oct 17, 2023
c67da28
add image upload fallback (#74)
mraible Oct 18, 2023
a625666
Merge branch 'main' into jhipster-v8
mshima Oct 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .blueprint/cli/commands.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Copyright 2013-2023 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.
*/

const defaultCommands = {
'generate-sample': {
desc: 'Generate a test sample',
blueprint: '@jhipster/jhipster-dev',
},
};

export default defaultCommands;
33 changes: 33 additions & 0 deletions .blueprint/generate-sample/command.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* Copyright 2013-2023 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.
*/
import { GENERATOR_APP } from 'generator-jhipster/generators';
/**
* @type {import('generator-jhipster').JHipsterCommandDefinition}
*/
const command = {
arguments: {
sampleName: {
type: String,
},
},
options: {},
import: [GENERATOR_APP, `ionic:${GENERATOR_APP}`],
};

export default command;
62 changes: 62 additions & 0 deletions .blueprint/generate-sample/generator.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import { readdir } from 'node:fs/promises';
import BaseGenerator from 'generator-jhipster/generators/base';
import command from './command.mjs';

export default class extends BaseGenerator {
sampleName;

get [BaseGenerator.INITIALIZING]() {
return this.asInitializingTaskGroup({
async initializeOptions() {
this.parseJHipsterArguments(command.arguments);
if (this.sampleName && !this.sampleName.endsWith('.jdl')) {
this.sampleName += '.jdl';
}
this.parseJHipsterOptions(command.options);
},
});
}

get [BaseGenerator.PROMPTING]() {
return this.asPromptingTaskGroup({
async askForSample() {
if (!this.sampleName) {
const answers = await this.prompt({
type: 'list',
name: 'sampleName',
message: 'which sample do you want to generate?',
choices: async () => readdir(this.templatePath('samples')),
});
this.sampleName = answers.sampleName;
}
},
});
}

get [BaseGenerator.WRITING]() {
return this.asWritingTaskGroup({
async copySample() {
this.copyTemplate(`samples/${this.sampleName}`, this.sampleName, { noGlob: true });
},
});
}

get [BaseGenerator.END]() {
return this.asEndTaskGroup({
async generateSample() {
await this.composeWithJHipster('jdl', {
generatorArgs: [this.sampleName],
generatorOptions: {
skipJhipsterDependencies: true,
insight: false,
skipChecks: true,
skipInstall: true,
},
});
},
async jhipsterInfo() {
await this.composeWithJHipster('info');
},
});
}
}
2 changes: 2 additions & 0 deletions .blueprint/generate-sample/index.mjs
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';
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ enum Units {
}

relationship OneToOne {
Preferences{user(login)} to User
Preferences{user(login)} to User with builtInEntity
}
relationship ManyToOne {
BloodPressure{user(login)} to User
Weight{user(login)} to User
Points{user(login)} to User
BloodPressure{user(login)} to User with builtInEntity
Weight{user(login)} to User with builtInEntity
Points{user(login)} to User with builtInEntity
}

paginate BloodPressure, Weight with infinite-scroll
Expand Down
40 changes: 40 additions & 0 deletions .blueprint/generate-sample/templates/samples/flickr2.jdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
application {
config {
baseName Flickr2
packageName com.okta.developer
testFrameworks [cypress]
}
entities *
}

entity Album {
title String required
description TextBlob
created Instant
}

entity Photo {
title String required
description TextBlob
image ImageBlob required
height Integer
width Integer
taken Instant
uploaded Instant
}

entity Tag {
name String required minlength(2)
}

relationship ManyToOne {
Album{user(login)} to User with builtInEntity
Photo{album(title)} to Album
}

relationship ManyToMany {
Photo{tag(name)} to Tag{photo}
}

paginate Album with pagination
paginate Photo, Tag with infinite-scroll
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ entity Tag {
}

relationship ManyToOne {
Blog{user(login)} to User
Blog{user(login)} to User with builtInEntity
Post{blog(name)} to Blog
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ application {
packageName org.jhipster.demo.blog
prodDatabaseType mysql
buildTool maven
clientFramework angularX
clientFramework angular
testFrameworks [cypress]
}
entities *
Expand Down Expand Up @@ -36,7 +36,7 @@ entity Tag {
}

relationship ManyToOne {
Blog{user(login)} to User
Blog{user(login)} to User with builtInEntity
Post{blog(name)} to Blog
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ entity Tag {
}

relationship ManyToOne {
Blog{user(login)} to User
Blog{user(login)} to User with builtInEntity
Post{blog(name)} to Blog
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ application {
applicationType monolith
authenticationType oauth2
packageName org.jhipster.demo.blog
devDatabaseType mongodb
databaseType mongodb,
devDatabaseType mongodb,
prodDatabaseType mongodb,
buildTool maven
clientFramework angular
testFrameworks [cypress]
Expand Down
9 changes: 2 additions & 7 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,17 @@
"node": true,
"es2020": true
},
"extends": ["airbnb-base", "plugin:mocha/recommended", "plugin:prettier/recommended"],
"extends": ["airbnb-base", "plugin:prettier/recommended"],
"parserOptions": {
"ecmaVersion": 11,
"sourceType": "module"
},
"overrides": [
{
"files": ["**/*.spec.{c,m,}js", "test/**/*.{c,m,}js"],
"env": {
"mocha": true
}
"files": ["**/*.spec.{c,m,}js", "test/**/*.{c,m,}js"]
}
],
"rules": {
"class-methods-use-this": "off",
"mocha/no-mocha-arrows": "off",
"func-names": "off",
"import/no-extraneous-dependencies": ["error", { "devDependencies": true }],
"import/no-unresolved": "off",
Expand Down
19 changes: 13 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,23 @@ updates:
groups:
angular:
patterns:
- "@angular/*"
- "zone.js"
- "@angular-devkit/*"
- "@angular-builders/*"
- '@angular/*'
- '@angular-devkit/*'
- '@fortawesome/angular-fontawesome'
- 'ngx-webstorage'
- 'typescript'
- 'zone.js'
- '@angular-builders/jest'
- 'jest'
- 'jest-preset-angular'
- '@types/jest'
angular-eslint:
patterns:
- "@angular-eslint/*"
- '@angular-eslint/*'
capacitor:
patterns:
- '@capacitor/*'
- 'capacitor-secure-storage-plugin'
typescript-eslint:
patterns:
- "@typescript-eslint/*"
- '@typescript-eslint/*'
5 changes: 4 additions & 1 deletion .github/workflows/generator.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name: Generator
on: [push, pull_request]
permissions:
contents: read
jobs:
ionic:
name: npm-test
Expand All @@ -9,6 +11,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: '16'
node-version: 18
cache: 'npm'
- run: npm ci
- run: npm run test
22 changes: 10 additions & 12 deletions .github/workflows/ionic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- 'dependabot/**'
pull_request:
branches:
- "*"
- '*'
env:
JHIPSTER_INSTALL: ${{ github.workspace }}/generator-jhipster-ionic/test-integration/install
JHIPSTER_SAMPLES: ${{ github.workspace }}/generator-jhipster-ionic/test-integration/jdl
Expand All @@ -15,6 +15,8 @@ env:
SPRING_OUTPUT_ANSI_ENABLED: ALWAYS
SPRING_JPA_SHOW_SQL: false
NG_CLI_ANALYTICS: false
# https://github.com/cypress-io/cypress/issues/27962#issuecomment-1746294247
NODE_OPTIONS: --dns-result-order=ipv4first
jobs:
build:
name: ${{ matrix.jdl }}
Expand All @@ -27,15 +29,14 @@ jobs:
strategy:
fail-fast: false
matrix:
node_version: [16]
java_version: [11]
os: [ubuntu-latest]
jdl:
- monolith-jwt
- monolith-oauth2
- gateway-oauth2
- reactive-oauth2
- 21-points
- flickr2
include:
- jdl: monolith-jwt
e2e: 1
Expand All @@ -47,6 +48,8 @@ jobs:
e2e: 1
- jdl: 21-points
e2e: 1
- jdl: flickr2
e2e: 1

steps:
#----------------------------------------------------------------------
Expand All @@ -65,23 +68,18 @@ jobs:
working-directory: ${{ github.workspace }}/generator-jhipster-ionic
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
node-version: 18
- uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: ${{ matrix.java_version }}
- name: Install latest Chrome
run: |
sudo apt update
sudo apt --only-upgrade install google-chrome-stable
google-chrome --version
java-version: 17
- name: Check Version
run: $JHIPSTER_INSTALL/02-checkVersion.sh
#----------------------------------------------------------------------
# Script
#----------------------------------------------------------------------
- name: Generate Project
run: 'jhipster-ionic jdl "$JHIPSTER_SAMPLES"/"${{ matrix.jdl }}".jdl --force --no-insight --skip-checks --skip-git --skip-commit-hook --skip-install --blueprints ionic --skip-jhipster-dependencies'
run: 'jhipster-ionic generate-sample ${{ matrix.jdl }} --force --no-insight --skip-checks --skip-git --skip-commit-hook --skip-install --skip-jhipster-dependencies'
- name: Ionic tests
run: cat package.json; npm install; npm test
working-directory: ${{ github.workspace }}/ionic4j
Expand All @@ -92,7 +90,7 @@ jobs:
echo '127.0.0.1 keycloak' | sudo tee -a /etc/hosts
cat /etc/hosts
- name: Launch backend application
run: npm run docker:app:up
run: npm run app:up
- name: Wait for backend to start
run: npm run ci:server:await
- name: Launch ionic e2e test
Expand Down
Loading