Skip to content

Commit

Permalink
update generator-jhipster to 8.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jhipster-bot committed Sep 27, 2024
1 parent 8e0066c commit 96424f7
Show file tree
Hide file tree
Showing 13 changed files with 3,374 additions and 3,734 deletions.
1 change: 0 additions & 1 deletion .github/workflows/generator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: jhipster/actions/setup-git@v0
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
Expand Down
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
3 changes: 2 additions & 1 deletion .yo-rc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
}
},
"githubWorkflows": true,
"jhipsterVersion": "7.7.0",
"jhipsterVersion": "8.7.1",
"js": true,
"localBlueprint": false,
"packageJsonType": "module",
"prettierDefaultIndent": 2,
"projectName": "JHipster Migrate Blueprint",
"sampleWritten": true,
Expand Down
2 changes: 2 additions & 0 deletions cli/cli-customizations.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// This file will not be overwritten by generate-blueprint
module.exports = {};
14 changes: 10 additions & 4 deletions cli/cli.cjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#!/usr/bin/env node

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

// Get package name to use as namespace.
// Allows blueprints to be aliased.
const packagePath = dirname(__dirname);
const packageFolderName = basename(packagePath);
const devBlueprintPath = join(packagePath, '.blueprint');
const blueprint = packageFolderName.startsWith('jhipster-') ? `generator-${packageFolderName}` : packageFolderName;

(async () => {
const { runJHipster, done, logger } = await import('generator-jhipster/cli');
Expand All @@ -15,14 +17,18 @@ const devBlueprintPath = join(packagePath, '.blueprint');
runJHipster({
executableName,
executableVersion: version,
defaultCommand: 'migrate',
defaultCommand: 'app',
devBlueprintPath,
commands: require('./commands.cjs'),
blueprints: {
[blueprint]: version,
},
printBlueprintLogo: () => {
console.log('===================== JHipster migrate =====================');
console.log('===================== JHipster Migrate =====================');
console.log('');
},
lookups: [{ packagePaths: [packagePath] }],
commands: require('./commands.cjs'),
...require('./cli-customizations.cjs'),
}).catch(done);

process.on('unhandledRejection', up => {
Expand Down
14 changes: 10 additions & 4 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import globals from 'globals';
import prettierRecommended from 'eslint-plugin-prettier/recommended';
import jhipsterRecommended from 'generator-jhipster/eslint/recommended';
import prettier from 'eslint-plugin-prettier/recommended';
import jhipster from 'generator-jhipster/eslint/recommended';

// Workaround for jhipster export issue.
delete jhipster.recommended.recommended;
// jhipster-needle-eslint-add-import - JHipster will add additional import here

export default [
{
Expand All @@ -10,6 +14,8 @@ export default [
},
},
},
jhipsterRecommended,
prettierRecommended,
{ ignores: ['coverage/**'] },
jhipster.recommended,
// jhipster-needle-eslint-add-config - JHipster will add additional config here
prettier,
];
11 changes: 4 additions & 7 deletions generators/migrate/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ import chalk from 'chalk';

const choices = '(none, current, bundled, any npm version)';

/**
* @type {import('generator-jhipster').JHipsterCommandDefinition}
*/
const command = {
import { asCommand } from 'generator-jhipster';

export default asCommand({
options: {},
configs: {
sourceCli: {
Expand Down Expand Up @@ -86,6 +85,4 @@ const command = {
scope: 'generator',
},
},
};

export default command;
});
16 changes: 8 additions & 8 deletions generators/migrate/generator.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { setTimeout } from 'timers/promises';
import { readFile, rm, readdir, appendFile } from 'fs/promises';
import { appendFile, readFile, readdir, rm } from 'fs/promises';
import { join } from 'path';
import chalk from 'chalk';
import { transform } from 'p-transform';
Expand All @@ -15,28 +15,28 @@ import { ResetMode } from 'simple-git';
import BaseGenerator from 'generator-jhipster/generators/base-application';
import getNode from 'get-node';
import {
createPrettierTransform,
createESLintTransform,
createPrettierTransform,
createRemoveUnusedImportsTransform,
} from 'generator-jhipster/generators/bootstrap/support';
import packageVersions from 'pkg-versions';

import { GENERATOR_JHIPSTER } from 'generator-jhipster';
import { GENERATOR_BOOTSTRAP } from 'generator-jhipster/generators';
import {
ACTUAL_APPLICATION,
BASE_APPLICATION,
DEFAULT_CLI_OPTIONS,
DEFAULT_CLI_OPTIONS_V7,
GIT_DRIVER_PACKAGEJSON,
GIT_DRIVER_PACKAGEJSON_REF,
GIT_VERSION_NOT_ALLOW_MERGE_UNRELATED_HISTORIES,
MIGRATE_SOURCE_BRANCH,
JSON_DRIVER_GIT_CONFIG,
MIGRATE_CONFIG_FILE,
MIGRATE_SOURCE_BRANCH,
MIGRATE_TARGET_BRANCH,
MIGRATE_TMP_FOLDER,
SERVER_MAIN_RES_DIR,
JSON_DRIVER_GIT_CONFIG,
GIT_DRIVER_PACKAGEJSON,
GIT_DRIVER_PACKAGEJSON_REF,
ACTUAL_APPLICATION,
BASE_APPLICATION,
V7_NODE,
} from './constants.js';
import command from './command.js';
Expand Down
2 changes: 1 addition & 1 deletion generators/migrate/generator.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('SubGenerator migrate of migrate JHipster blueprint', () => {
apply updated prettier to actual application
apply updated prettier to source application
migration application generated with JHipster bundled (source)
Initial version of upgradeTest generated by generator-jhipster@undefined"
initial"
`);
},
);
Expand Down
Loading

0 comments on commit 96424f7

Please sign in to comment.