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

Upgrade to Micronaut 4 #289

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
33 changes: 33 additions & 0 deletions .blueprint/generate-sample/templates/samples/sample.jdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
application {
config {
applicationType monolith
cacheProvider no
creationTimestamp 1632872179205
testFrameworks [cypress]
}

entities Blog, Post, Tag
}

entity Blog {
name String required minlength(3)
handle String required minlength(2)
}

entity Post {
title String required
content TextBlob required
date Instant required
}

entity Tag {
name String required minlength(2)
}

relationship ManyToOne {
Post{blog(name)} to Blog
}

relationship ManyToMany {
Post{tag(name)} to Tag{entry}
}
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish --access public
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/samples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- uses: actions/checkout@v4
with:
repository: jhipster/generator-jhipster
ref: v7.9.3
ref: v8.0.0
path: generator-jhipster
- name: 'SETUP: environment'
id: setup
Expand All @@ -54,7 +54,7 @@ jobs:
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
java-version: '17'
- name: 'Install blueprint'
run: npm install && npm link
working-directory: ${{ github.workspace }}/generator-jhipster-micronaut
Expand Down
2 changes: 1 addition & 1 deletion .yo-rc.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
"written": true
}
},
"jhipsterVersion": "8.0.0-beta.3",
"jhipsterVersion": "8.0.0",
"js": true,
"localBlueprint": false,
"prettierDefaultIndent": 2,
Expand Down
54 changes: 54 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,56 @@
> ## 🛠 Blueprint In Active Development
>
> This project is a [Micronaut](https://micronaut.io) blueprint for [JHipster](https://jhipster.tech).
> While we are working to create a complete experience, there are likely some gaps.
> Please [let us know](https://github.com/jhipster/generator-jhipster-micronaut/issues) if you encounter issues.

## Installing and Using the Active Development Version

This currently active development branch is based on the latest production release of JHipster - v8.0.0

As a pre-requisite, you must have Node 18 installed, along with the bundled version of NPM.

1. Start by installing JHipster v8.0.0 with

```
npm install -g generator-jhipster
```

2. Then install this in-development blueprint by

```
git clone https://github.com/jhipster/generator-jhipster-micronaut.git
cd generator-jhipster-micronaut
git checkout micronaut-4
npm link generator-jhipster
npm install
npm link
```

3. Next you can create a new application with the development version of this blueprint by executing:

```
mkdir my-project
cd my-project
npm link "generator-jhipster-micronaut"
mhipster --skip-jhipster-dependencies
```

This will execute the mhipster CLI tool that walks you through a series of steps to generate the code for your application.

Alternatively, you can generate an application based on one of the samples in https://github.com/jhipster/jdl-samples

For example, to generate a default gradle-based application, execute:

```
mkdir my-jdl-project
cd my-jdl-project
npm link "generator-jhipster-micronaut"
mhipster jdl default-gradle --skip-jhipster-dependencies
```

You will re-execute the commands in step 3 for any new application that you would like to generate with this in-development version.

# Greetings, Micronaut Hipster!

![Tests](https://github.com/jhipster/generator-jhipster-micronaut/workflows/Generator%20Lint%20/%20Tests/badge.svg)
Expand Down Expand Up @@ -81,6 +134,7 @@ docker run -it --rm -v $PWD:/home/jhipster/app jhipster-generator-micronaut /bin

| Micronaut Blueprint | Micronaut | JHipster |
| ------------------- | --------- | -------- |
| 3.0.0 | 4.2.0 | 8.0.0 |
| 2.0.0 | 3.10.1 | 7.9.3 |
| 1.0.2 | 2.4.4 | 6.10.5 |
| 0.8.0 | 2.3.0 | 6.10.5 |
Expand Down
8 changes: 5 additions & 3 deletions cli/cli.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env node

const { dirname, basename, join } = require('path');
const { version, bin } = require('../package.json');

Expand All @@ -22,9 +21,12 @@ const devBlueprintPath = join(packagePath, '.blueprint');
blueprints: {
[packageFolderName]: version,
},
printLogo: () => {},
printLogo: () => {
getLogo();
},
printBlueprintLogo: () => {
console.log(getLogo());
console.log('===================== JHipster Micronaut =====================');
console.log('');
},
lookups: [{ packagePaths: [packagePath], lookups: ['generators'] }],
}).catch(done);
Expand Down
7 changes: 7 additions & 0 deletions generators/app/USAGE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Description:
Creates a new MHipster application based on the selected options

Example:
jhipster --blueprints micronaut

This will compose jhipster:client, jhipster:server and jhipster:languages to scaffold a full application
8 changes: 8 additions & 0 deletions generators/app/command.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* @type {import('generator-jhipster').JHipsterCommandDefinition}
*/
const command = {
options: { ignoreErrors: true},
};

export default command;
24 changes: 12 additions & 12 deletions generators/constants.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
*/

module.exports = {
GRADLE_VERSION: '7.4.2',
JAVA_VERSION: 17,
GRADLE_VERSION: '8.5',
DOCKER_REDIS: 'redis:6.0.10',
sqlDb: {
h2Disk: {
Expand Down Expand Up @@ -51,21 +52,20 @@ module.exports = {
},
},
versions: {
micronaut: '3.10.1',
micronautData: '3.10.0',
micronautDiscoveryClient: '3.3.1',
micronautOpenApi: '4.8.7',
micronaut: '4.2.1',
micronautData: '4.2.0',
micronautDiscoveryClient: '4.2.0',
micronautOpenApi: '4.2.0',
netty: '4.1.97.Final',
rxJava3: '2.3.0',
hibernate: '5.6.15.Final',
hibernate: '6.2.6.Final',
prometheusSimpleclient: '0.16.0',
jackson: '2.13.3',
jackson: '2.15.2',
javassist: '3.27.0-GA', // Should match Hibernate deps
jakartaInject: '2.0.1',
jakartaMail: '2.0.1',
javaxMail: '2.0.1',
jbcrypt: '0.4',
liquibase: '4.15.0',
liquibaseHibernate5: '4.15.0',
liquibase: '4.23.0',
liquibaseHibernate6: '4.23.0',
logback: '1.2.11',
mapstruct: '1.5.2.Final',
swaggerAnnotations: '2.2.2',
Expand All @@ -74,6 +74,6 @@ module.exports = {
caffeine: '3.1.1',
archunit: '0.23.1',
simplejavamail: '7.5.0',
testcontainers: '1.17.3',
testcontainers: '1.19.3',
},
};
69 changes: 0 additions & 69 deletions generators/cypress/__snapshots__/generator.spec.js.snap

This file was deleted.

23 changes: 0 additions & 23 deletions generators/cypress/generator.js

This file was deleted.

26 changes: 0 additions & 26 deletions generators/cypress/generator.spec.js

This file was deleted.

1 change: 0 additions & 1 deletion generators/cypress/index.js

This file was deleted.

8 changes: 8 additions & 0 deletions generators/entity/command.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* @type {import('generator-jhipster').JHipsterCommandDefinition}
*/
const command = {
options: {},
};

export default command;
Loading
Loading