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 JHipster main #1526

Merged
merged 32 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
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
1 change: 0 additions & 1 deletion .blueprint/generate-sample/generator.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { readdir, stat } from 'node:fs/promises';
import BaseGenerator from 'generator-jhipster/generators/base';
import command from './command.mjs';
import { statSync } from 'node:fs';

export default class extends BaseGenerator {
sampleName;
Expand Down
5 changes: 0 additions & 5 deletions .eslintignore

This file was deleted.

42 changes: 0 additions & 42 deletions .eslintrc.json

This file was deleted.

8 changes: 0 additions & 8 deletions .github/workflows/test-integration-jwt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,34 +38,26 @@ jobs:
include:
- app-type: jwt-with-angular-app
arg: 'import-jdl'
extra-args: '--with-entities'
- app-type: jwt-with-angular-cqrs-app
arg: 'import-jdl'
extra-args: '--with-entities'
- app-type: jwt-with-blazor-app
arg: 'import-jdl blazor'
extra-args: '--with-entities'
- app-type: jwt-with-blazor-cqrs-app
arg: 'import-jdl blazor'
extra-args: '--with-entities'
- app-type: jwt-with-mssql-app
arg: 'no'
- app-type: jwt-with-mysql-app
arg: 'no'
- app-type: jwt-with-mongo-app
arg: 'import-jdl'
extra-args: '--with-entities'
- app-type: jwt-with-mongo-cqrs-app
arg: 'import-jdl'
extra-args: '--with-entities'
- app-type: jwt-with-postgres-app
arg: 'no'
- app-type: jwt-with-react-app
arg: 'import-jdl'
extra-args: '--with-entities'
- app-type: jwt-with-vue-app
arg: 'import-jdl'
extra-args: '--with-entities'
env:
JHI_APP: ${{ matrix.app-type }}
JHI_ARG: ${{ matrix.arg }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-integration-microservice.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test Integration JWT
name: Test Integration Microservice
concurrency:
# Group PRs by head_ref, push to main branch by commit id, and others branch by ref.
group: ${{ github.workflow }}-${{ github.head_ref || (github.ref == 'refs/heads/main' && github.sha) || github.ref }}
Expand Down
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ package-lock.json
.git

# blueprint rules:
**/templates/**/
generators/**/templates/**/
7 changes: 3 additions & 4 deletions .prettierrc.yml
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
6 changes: 3 additions & 3 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.11"
python: '3.11'

# Build documentation in the docs/ directory with Sphinx
sphinx:
Expand All @@ -14,5 +14,5 @@ sphinx:
# We recommend specifying your dependencies to enable reproducible builds:
# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: docs/requirements.txt
install:
- requirements: docs/requirements.txt
3 changes: 2 additions & 1 deletion .yo-rc.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,10 @@
},
"githubRepository": "jhipster/jhipster-dotnetcore",
"githubWorkflows": true,
"jhipsterVersion": "8.0.0-beta.3",
"jhipsterVersion": "8.7.3",
"js": true,
"localBlueprint": false,
"packageJsonType": "module",
"sampleWritten": true,
"skipCommitHook": true,
"subGenerators": ["bootstrap-application", "ci-cd", "client", "common", "cypress", "docker", "entity", "heroku", "server"]
Expand Down
5 changes: 2 additions & 3 deletions .yo-resolve
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
cli/cli.cjs skip
generators/** skip
.blueprint/** skip
.eslintrc.json skip
.gitattributes
.github/** skip
README.md skip
6 changes: 2 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:23.10
FROM ubuntu:24.04

# copy sources
COPY . /home/jhipster/jhipster-dotnetcore
Expand All @@ -19,12 +19,10 @@ RUN \
sudo \
git && \
# install node.js
wget https://nodejs.org/dist/v18.17.1/node-v18.17.1-linux-x64.tar.gz -O /tmp/node.tar.gz && \
wget https://nodejs.org/dist/v20.18.1/node-v20.18.1-linux-x64.tar.gz -O /tmp/node.tar.gz && \
tar -C /usr/local --strip-components 1 -xzf /tmp/node.tar.gz && \
# upgrade npm
npm install -g npm && \
# install yeoman
npm install -g yo && \
#install dotnet
apt-get install -y dotnet-sdk-8.0 && \
# cleanup
Expand Down
9 changes: 9 additions & 0 deletions cli/cli-customizations.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// This file will not be overwritten by generate-blueprint
module.exports = {
printLogo: async () => {
const { getLogo } = await import('./logo.js');
const { version } = require('../package.json');
console.log(getLogo(version));
},
printBlueprintLogo: undefined,
};
8 changes: 4 additions & 4 deletions cli/cli.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const blueprint = packageFolderName.startsWith('jhipster-') ? `generator-${packa
(async () => {
const { runJHipster, done, logger } = await import('generator-jhipster/cli');
const executableName = Object.keys(bin)[0];
const { getLogo } = await import('./logo.js');

runJHipster({
executableName,
Expand All @@ -23,11 +22,12 @@ const blueprint = packageFolderName.startsWith('jhipster-') ? `generator-${packa
blueprints: {
[blueprint]: version,
},
printLogo: () => {},
printBlueprintLogo: () => {
console.log(getLogo(version));
console.log('===================== JHipster Dotnetcore =====================');
console.log('');
},
lookups: [{ packagePaths: [packagePath], lookups: ['generators'] }],
lookups: [{ packagePaths: [packagePath] }],
...require('./cli-customizations.cjs'),
}).catch(done);

process.on('unhandledRejection', up => {
Expand Down
18 changes: 18 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import globals from 'globals';
import prettier from 'eslint-plugin-prettier/recommended';
import jhipster from 'generator-jhipster/eslint';
// jhipster-needle-eslint-add-import - JHipster will add additional import here

export default [
{
languageOptions: {
globals: {
...globals.node,
},
},
},
{ ignores: ['coverage/**'] },
jhipster.recommended,
// jhipster-needle-eslint-add-config - JHipster will add additional config here
prettier,
];
5 changes: 5 additions & 0 deletions generators/blazor/command.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { asCommand } from 'generator-jhipster';

export default asCommand({
configs: {},
});
24 changes: 12 additions & 12 deletions generators/blazor/generator.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import { access } from 'fs/promises';
import BaseApplicationGenerator from 'generator-jhipster/generators/base-application';
import chalk from 'chalk';
import { access } from 'fs/promises';
import { createNeedleCallback } from 'generator-jhipster/generators/base/support';
import { CLIENT_SRC_DIR, CLIENT_TEST_DIR } from '../generator-dotnetcore-constants.js';
import { files } from './files-blazor.js';
import { entityFiles } from './entities-blazor.js';
import {
defaultNilValue,
defaultValue,
getNonNullableType,
getNullableResolvedType,
isNumericPrimaryKey,
getPrimaryKeyType,
defaultNilValue,
defaultValue,
isNumericPrimaryKey,
updatedValue,
} from '../utils.js';
import { files } from './files-blazor.js';
import { entityFiles } from './entities-blazor.js';

export default class extends BaseApplicationGenerator {
constructor(args, opts, features) {
super(args, opts, { ...features, sbsBlueprint: true, jhipster7Migration: true });
super(args, opts, { ...features, queueCommandTasks: true, sbsBlueprint: true, jhipster7Migration: true });
}

async beforeQueue() {
Expand Down Expand Up @@ -176,7 +176,7 @@ export default class extends BaseApplicationGenerator {
try {
try {
await access(`${application.solutionName}.sln`);
} catch (error) {
} catch {
await this.spawnCommand(`dotnet new sln --name ${application.solutionName}`);
}
} catch (err) {
Expand All @@ -200,24 +200,24 @@ export default class extends BaseApplicationGenerator {

try {
await this.spawnCommand('libman');
} catch (error) {
} catch {
try {
// If a tool is already installed the install sub-command will return 1
// We'll use the update sub-command which behaves the way we'd expected.
// See: https://github.com/dotnet/sdk/issues/9500
await this.spawnCommand('dotnet tool update -g Microsoft.Web.LibraryManager.Cli');
} catch (error) {
} catch {
throw new Error('Could not install/update Microsoft.Web.LibraryManager.Cli');
}
this.log(chalk.green.bold('Microsoft.Web.LibraryManager.Cli successfully installed.\n'));
}

try {
await this.spawnCommand('webcompiler');
} catch (error) {
} catch {
try {
await this.spawnCommand('dotnet tool update Excubo.WebCompiler --global');
} catch (error) {
} catch {
throw new Error('Could not install/update Excubo.WebCompiler');
}
this.log(chalk.green.bold('Excubo.WebCompiler successfully installed.\n'));
Expand Down
1 change: 1 addition & 0 deletions generators/blazor/index.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export { default } from './generator.js';
export { default as command } from './command.js';
Loading
Loading