Skip to content

Commit

Permalink
Merge pull request jhipster#294 from mshima/jhipster-8
Browse files Browse the repository at this point in the history
upgrade generator-jhipster to v8.0.0
  • Loading branch information
DanielFran authored Nov 2, 2023
2 parents a59dc8a + 58c72fd commit 0818dd9
Show file tree
Hide file tree
Showing 75 changed files with 1,746 additions and 1,866 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ relationship OneToMany {
BankAccount{operation} to Operation{bankAccount(name)}
}
relationship ManyToOne {
BankAccount{user(login)} to User
BankAccount{user(login)} to User with builtInEntity
}
relationship ManyToMany {
Operation{label(label)} to Label{operation}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ relationship OneToMany {
BankAccount{operation} to Operation{bankAccount(name)}
}
relationship ManyToOne {
BankAccount{user(login)} to User
BankAccount{user(login)} to User with builtInEntity
}
relationship ManyToMany {
Operation{label(label)} to Label{operation}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,16 @@ entity Region {

relationship OneToOne {
Department{location} to Location,
Employee{user(login)} to User
// Employee{user(login)} to User with jpaDerivedIdentifier
Employee{user(login)} to User with builtInEntity
// Employee{user(login)} to User with builtInEntity with jpaDerivedIdentifier
// Please see: https://github.com/jhipster/generator-jhipster-micronaut/issues/219
}

relationship OneToMany {
BankAccount{operation} to Operation{bankAccount(name)}
}
relationship ManyToOne {
BankAccount{user(login)} to User
BankAccount{user(login)} to User with builtInEntity
}
relationship ManyToMany {
Operation{theLabel(labelName)} to TheLabel{operation}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ relationship OneToMany {
BankAccount{operation} to Operation{bankAccount(name)}
}
relationship ManyToOne {
BankAccount{user(login)} to User
BankAccount{user(login)} to User with builtInEntity
}
relationship ManyToMany {
Operation{label(label)} to Label{operation}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ relationship OneToMany {
BankAccount{operation} to Operation{bankAccount(name)}
}
relationship ManyToOne {
BankAccount{user(login)} to User
BankAccount{user(login)} to User with builtInEntity
}
relationship ManyToMany {
Operation{label(label)} to Label{operation}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ relationship OneToMany {
BankAccount{operation} to Operation{bankAccount(name) required}
}
relationship ManyToOne {
BankAccount{user(login)} to User
BankAccount{user(login)} to User with builtInEntity
}
relationship ManyToMany {
Operation{label(label)} to Label{operation required}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ relationship OneToMany {
BankAccount{operation} to Operation{bankAccount(name)}
}
relationship ManyToOne {
BankAccount{user(login)} to User
BankAccount{user(login)} to User with builtInEntity
}
relationship ManyToMany {
Operation{label(label)} to Label{operation}
Expand Down
3 changes: 1 addition & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"node": true,
"es2020": true
},
"extends": ["airbnb-base", "plugin:prettier/recommended"],
"extends": ["eslint:recommended", "plugin:prettier/recommended"],
"parserOptions": {
"ecmaVersion": 11,
"sourceType": "module"
Expand All @@ -15,7 +15,6 @@
],
"rules": {
"func-names": "off",
"import/no-extraneous-dependencies": ["error", { "devDependencies": true }],
"import/no-unresolved": "off",
"no-restricted-syntax": [
"error",
Expand Down
9 changes: 2 additions & 7 deletions .yo-rc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@
"sbs": true,
"written": true
},
"common": {
"command": false,
"priorities": ["writing"],
"sbs": true,
"written": true
},
"cypress": {
"command": false,
"priorities": ["postWriting"],
Expand Down Expand Up @@ -102,11 +96,12 @@
}
},
"jhipsterVersion": "8.0.0-beta.3",
"js": true,
"localBlueprint": false,
"prettierDefaultIndent": 2,
"projectName": "Micronaut Blueprint",
"sampleWritten": true,
"skipCommitHook": true,
"subGenerators": ["angular", "client", "common", "cypress", "heroku", "react", "server"]
"subGenerators": ["angular", "client", "cypress", "heroku", "react", "server"]
}
}
5 changes: 2 additions & 3 deletions .yo-resolve
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
README.md
cli/cli.cjs
generators/{angular,client,cypress,common,docker,heroku,liquibase,micronaut-cache,react,server}/{command,generator,generator.spec}.mjs skip
!package.json skip

2 changes: 1 addition & 1 deletion cli/cli.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const devBlueprintPath = join(packagePath, '.blueprint');

(async () => {
const { runJHipster, done, logger } = await import('generator-jhipster/cli');
const { getLogo } = await import('./logo.mjs');
const { getLogo } = await import('./logo.js');
const executableName = Object.keys(bin)[0];

runJHipster({
Expand Down
1 change: 0 additions & 1 deletion cli/logo.mjs → cli/logo.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const {
versions: { micronaut: MICRONAUT_VERSION },
} = constants;

// eslint-disable-next-line import/prefer-default-export
export function getLogo() {
const { version } = JSON.parse(readFileSync(new URL('../package.json', import.meta.url)));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ exports[`SubGenerator angular of micronaut JHipster blueprint > run > should suc
".husky/pre-commit": {
"stateCleared": "modified",
},
".lintstagedrc.js": {
".lintstagedrc.cjs": {
"stateCleared": "modified",
},
".prettierignore": {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import BaseApplicationGenerator from 'generator-jhipster/generators/base-application';
import { angularFiles } from './files.mjs';
import { angularFiles } from './files.js';

export default class extends BaseApplicationGenerator {
constructor(args, opts, features) {
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions generators/angular/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './generator.js';
1 change: 0 additions & 1 deletion generators/angular/index.mjs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ exports[`SubGenerator client of micronaut JHipster blueprint > run > should succ
".husky/pre-commit": {
"stateCleared": "modified",
},
".lintstagedrc.js": {
".lintstagedrc.cjs": {
"stateCleared": "modified",
},
".prettierignore": {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import BaseApplicationGenerator from 'generator-jhipster/generators/base-application';
import { commonFiles } from './files.mjs';
import { commonFiles } from './files.js';

export default class extends BaseApplicationGenerator {
constructor(args, opts, features) {
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions generators/client/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './generator.js';
1 change: 0 additions & 1 deletion generators/client/index.mjs

This file was deleted.

File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions generators/cypress/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './generator.js';
1 change: 0 additions & 1 deletion generators/cypress/index.mjs

This file was deleted.

File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions generators/docker/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './generator.js';
1 change: 0 additions & 1 deletion generators/docker/index.mjs

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions generators/heroku/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { default } from './generator.js';
export { default as command } from './command.js';
2 changes: 0 additions & 2 deletions generators/heroku/index.mjs

This file was deleted.

File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions generators/liquibase/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './generator.js';
1 change: 0 additions & 1 deletion generators/liquibase/index.mjs

This file was deleted.

File renamed without changes.
1 change: 1 addition & 0 deletions generators/micronaut-cache/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './generator.js';
1 change: 0 additions & 1 deletion generators/micronaut-cache/index.mjs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ exports[`SubGenerator react of micronaut JHipster blueprint > run > should succe
".husky/pre-commit": {
"stateCleared": "modified",
},
".lintstagedrc.js": {
".lintstagedrc.cjs": {
"stateCleared": "modified",
},
".prettierignore": {
Expand Down
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions generators/react/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './generator.js';
1 change: 0 additions & 1 deletion generators/react/index.mjs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ exports[`SubGenerator server of micronaut JHipster blueprint > run > should succ
".husky/pre-commit": {
"stateCleared": "modified",
},
".lintstagedrc.js": {
".lintstagedrc.cjs": {
"stateCleared": "modified",
},
".mvn/jvm.config": {
Expand Down Expand Up @@ -544,7 +544,7 @@ exports[`SubGenerator server of micronaut JHipster blueprint > with some entitie
".jhipster/Entity.json": {
"stateCleared": "modified",
},
".lintstagedrc.js": {
".lintstagedrc.cjs": {
"stateCleared": "modified",
},
".mvn/jvm.config": {
Expand Down Expand Up @@ -1024,6 +1024,9 @@ exports[`SubGenerator server of micronaut JHipster blueprint > with some entitie
"src/test/java/com/mycompany/myapp/domain/EntityTest.java": {
"stateCleared": "modified",
},
"src/test/java/com/mycompany/myapp/domain/EntityTestSamples.java": {
"stateCleared": "modified",
},
"src/test/java/com/mycompany/myapp/security/DomainUserDetailsServiceIT.java": {
"stateCleared": "modified",
},
Expand Down
File renamed without changes.
File renamed without changes.
13 changes: 1 addition & 12 deletions generators/server/files.mjs → generators/server/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,6 @@ export const serverFiles = {
'config/JHipsterConfigurationEndpoint.java',
'config/LoggingConfiguration.java',
'config/MessagesBundleMessageSource.java',
'config/package-info.java',
'config/SnakeCasePhysicalNamingStrategy.java',
'config/metric/JHipsterMetricsEndpoint.java',
],
Expand Down Expand Up @@ -322,7 +321,6 @@ export const serverFiles = {
templates: [
'security/AuthoritiesConstants.java',
'security/NotAuthenticatedResponse.java',
'security/package-info.java',
'security/SecurityUtils.java',
'security/SecurityHeaderFilter.java',
],
Expand All @@ -346,12 +344,7 @@ export const serverFiles = {
],
serverJavaService: [
javaMainPackageTemplatesBlock({
templates: [
'service/dto/package-info.java',
'service/mapper/package-info.java',
'service/util/RandomUtil.java',
'service/package-info.java',
],
templates: ['service/util/RandomUtil.java'],
}),
javaMainPackageTemplatesBlock({
condition: generator => !generator.skipUserManagement,
Expand Down Expand Up @@ -387,10 +380,6 @@ export const serverFiles = {
'web/rest/errors/BadRequestAlertException.java',
'web/rest/errors/ErrorConstants.java',
'web/rest/errors/FieldErrorVM.java',
'web/rest/errors/package-info.java',
// VM
'web/rest/vm/package-info.java',
'web/rest/package-info.java',
],
}),
javaMainPackageTemplatesBlock({
Expand Down
39 changes: 6 additions & 33 deletions generators/server/generator.mjs → generators/server/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ import {
GENERATOR_MAVEN,
} from 'generator-jhipster/generators';
import { createNeedleCallback, createBase64Secret } from 'generator-jhipster/generators/base/support';
import { addJavaAnnotation } from 'generator-jhipster/generators/java/support';
import mnConstants from '../constants.cjs';
import { writeFiles } from './files.mjs';
import { writeFiles } from './files.js';

import command from './command.mjs';
import { entityFiles } from './entity-files.mjs';
import command from './command.js';
import { entityFiles } from './entity-files.js';

export default class extends ServerGenerator {
command = command;

constructor(args, opts, features) {
super(args, opts, {
...features,
checkBlueprint: true,
});

this.command = command;
if (!this.options.help) {
this.jhipsterTemplatesFolders.push(
// For _persistClass_.java.jhi.hibernate_cache file
Expand Down Expand Up @@ -72,8 +72,7 @@ export default class extends ServerGenerator {
get [ServerGenerator.COMPOSING]() {
return this.asComposingTaskGroup({
async composing() {
const { buildTool, enableTranslation, databaseType, messageBroker, searchEngine, testFrameworks, websocket, cacheProvider } =
this.jhipsterConfigWithDefaults;
const { buildTool, enableTranslation, databaseType, cacheProvider } = this.jhipsterConfigWithDefaults;
if (buildTool === 'gradle') {
await this.composeWithJHipster(GENERATOR_GRADLE);
} else if (buildTool === 'maven') {
Expand All @@ -92,32 +91,6 @@ export default class extends ServerGenerator {
if (databaseType === 'sql') {
await this.composeWithJHipster(GENERATOR_LIQUIBASE);
}
/*
else if (databaseType === CASSANDRA) {
await this.composeWithJHipster(GENERATOR_SPRING_DATA_CASSANDRA);
} else if (databaseType === COUCHBASE) {
await this.composeWithJHipster(GENERATOR_SPRING_DATA_COUCHBASE);
} else if (databaseType === MONGODB) {
await this.composeWithJHipster(GENERATOR_SPRING_DATA_MONGODB);
} else if (databaseType === NEO4J) {
await this.composeWithJHipster(GENERATOR_SPRING_DATA_NEO4J);
}
if (messageBroker === KAFKA || messageBroker === PULSAR) {
await this.composeWithJHipster(GENERATOR_SPRING_CLOUD_STREAM);
}
if (searchEngine === ELASTICSEARCH) {
await this.composeWithJHipster(GENERATOR_SPRING_DATA_ELASTICSEARCH);
}
if (testFrameworks?.includes(CUCUMBER)) {
await this.composeWithJHipster(GENERATOR_CUCUMBER);
}
if (testFrameworks?.includes(GATLING)) {
await this.composeWithJHipster(GENERATOR_GATLING);
}
if (websocket === SPRING_WEBSOCKET) {
await this.composeWithJHipster(GENERATOR_SPRING_WEBSOCKET);
}
*/
if (['ehcache', 'caffeine', 'hazelcast', 'infinispan', 'memcached', 'redis'].includes(cacheProvider)) {
await this.composeWithJHipster('jhipster-micronaut:micronaut-cache');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ describe('SubGenerator server of micronaut JHipster blueprint', () => {
});

it('should not write jakarta validation', () => {
expect(result.fs.read('src/main/java/com/mycompany/myapp/domain/Entity.java.jhi')).toMatch(/^((?!jakarta).)*$/s);
expect(result.fs.read('src/main/java/com/mycompany/myapp/domain/Entity.java')).toMatch(/^((?!jakarta).)*$/s);
});
});
});
2 changes: 2 additions & 0 deletions generators/server/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { default } from './generator.js';
export { default as command } from './command.js';
2 changes: 0 additions & 2 deletions generators/server/index.mjs

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 0818dd9

Please sign in to comment.