Skip to content

Commit

Permalink
Merge branch 'main' into translation-entities
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima authored Apr 6, 2024
2 parents b0827fb + 9f9132d commit f24a2ac
Show file tree
Hide file tree
Showing 285 changed files with 4,768 additions and 2,921 deletions.
10 changes: 3 additions & 7 deletions .blueprint/code-workspace/generator.mjs
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
import { join } from 'path';
import * as _ from 'lodash-es';
import { merge } from 'lodash-es';
import BaseGenerator from '../../generators/base/index.js';
import { getPackageRoot } from '../../lib/index.js';
import command from './command.mjs';
import { defaultSamplesFolder, promptSamplesFolder, samplesFolderConfig } from '../support.mjs';

const { merge } = _;

export default class extends BaseGenerator {
samplePath;

get [BaseGenerator.INITIALIZING]() {
return this.asInitializingTaskGroup({
async initializeOptions() {
this.parseJHipsterArguments(command.arguments);
this.parseJHipsterOptions(command.options);
async parseCommand() {
await this.parseCurrentJHipsterCommand();
},
});
}
Expand Down
6 changes: 2 additions & 4 deletions .blueprint/from-issue/generator.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Octokit } from 'octokit';
import { setOutput } from '@actions/core';
import BaseGenerator from '../../generators/base/index.js';
import command from './command.mjs';
import { promptSamplesFolder } from '../support.mjs';
import { join } from 'path';
import { GENERATOR_APP, GENERATOR_JDL } from '../../generators/generator-list.js';
Expand Down Expand Up @@ -31,9 +30,8 @@ export default class extends BaseGenerator {

get [BaseGenerator.INITIALIZING]() {
return this.asInitializingTaskGroup({
async initializeOptions() {
this.parseJHipsterArguments(command.arguments);
this.parseJHipsterOptions(command.options);
async parseCommand() {
await this.parseCurrentJHipsterCommand();
},
});
}
Expand Down
6 changes: 2 additions & 4 deletions .blueprint/generate-sample/generator.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { extname } from 'path';
import { transform } from '@yeoman/transform';
import BaseGenerator from '../../generators/base/index.js';
import command from './command.mjs';
import { generateSample } from './support/generate-sample.js';
import { promptSamplesFolder } from '../support.mjs';
import { GENERATOR_APP, GENERATOR_JDL } from '../../generators/generator-list.js';
Expand All @@ -13,9 +12,8 @@ export default class extends BaseGenerator {

get [BaseGenerator.INITIALIZING]() {
return this.asInitializingTaskGroup({
async initializeOptions() {
this.parseJHipsterArguments(command.arguments);
this.parseJHipsterOptions(command.options);
async parseCommand() {
await this.parseCurrentJHipsterCommand();
},
});
}
Expand Down
6 changes: 2 additions & 4 deletions .blueprint/update-vscode/generator.mjs
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import { join } from 'path';
import BaseGenerator from '../../generators/base/index.js';
import { getPackageRoot } from '../../lib/index.js';
import command from './command.mjs';
import { getWorkflowSamples } from '../generate-sample/support/get-workflow-samples.js';

export default class extends BaseGenerator {
get [BaseGenerator.INITIALIZING]() {
return this.asInitializingTaskGroup({
async initializeOptions() {
this.parseJHipsterArguments(command.arguments);
this.parseJHipsterOptions(command.options);
async parseCommand() {
await this.parseCurrentJHipsterCommand();
},
});
}
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/build-matrix/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ runs:
steps:
- uses: actions/setup-node@v4
with:
node-version: 20.12.0
node-version: 20.12.1
- name: 'Check changes'
id: build-changes
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/generator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.12.0
node-version: 20.12.1
- name: 'SETUP: load npm cache'
uses: actions/cache/restore@v4
with:
Expand Down
6 changes: 3 additions & 3 deletions cli/environment-builder.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { existsSync, readFileSync } from 'fs';
import path, { dirname, resolve } from 'path';
import { fileURLToPath, pathToFileURL } from 'url';
import chalk from 'chalk';
import * as _ from 'lodash-es';
import { cloneDeep, mergeWith } from 'lodash-es';
import Environment from 'yeoman-environment';
import { QueuedAdapter } from '@yeoman/adapter';

Expand Down Expand Up @@ -407,7 +407,7 @@ export default class EnvironmentBuilder {
const blueprintCommandsUrl = pathToFileURL(resolve(`${blueprintCommandFile}${blueprintCommandExtension}`));
try {
blueprintCommand = (await import(blueprintCommandsUrl)).default;
const blueprintCommands = _.cloneDeep(blueprintCommand);
const blueprintCommands = cloneDeep(blueprintCommand);
Object.entries(blueprintCommands).forEach(([_command, commandSpec]) => {
commandSpec.blueprint = commandSpec.blueprint || blueprint;
});
Expand Down Expand Up @@ -480,7 +480,7 @@ export default class EnvironmentBuilder {
for (const [blueprint, packagePath] of blueprintPackagePaths) {
const errorMsg = `No custom sharedOptions found within blueprint: ${blueprint} at ${packagePath}`;
const opts = await loadSharedOptionsFromFile(`${packagePath}/cli/sharedOptions`, undefined, errorMsg);
result = _.mergeWith(result, opts, joiner);
result = mergeWith(result, opts, joiner);
}
return result;
}
Expand Down
4 changes: 1 addition & 3 deletions cli/jhipster-command.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@

import chalk from 'chalk';
import { Command, Option } from 'commander';
import lodash from 'lodash';
import { kebabCase } from 'lodash-es';
import { convertConfigToOption } from '../lib/internal/index.js';

const { kebabCase } = lodash;

export default class JHipsterCommand extends Command {
createCommand(name) {
return new JHipsterCommand(name);
Expand Down
12 changes: 7 additions & 5 deletions generators/java/cleanup.ts → generators/angular/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { JHipsterCommandDefinition } from '../base/api.js';

/**
* Removes server files that where generated in previous JHipster versions and therefore
* need to be removed.
*/
export default function cleanupTask() {}
const command: JHipsterCommandDefinition = {
options: {},
import: [],
};

export default command;
4 changes: 1 addition & 3 deletions generators/angular/generator.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { basename, dirname, join } from 'path';
import { fileURLToPath } from 'url';
import { before, it, describe, after, expect } from 'esmocha';
import lodash from 'lodash';
import { snakeCase } from 'lodash-es';

import { buildClientSamples, entitiesClientSamples as entities, defaultHelpers as helpers } from '../../testing/index.js';
import { shouldSupportFeatures, testBlueprintSupport, checkEnforcements } from '../../test/support/index.js';
Expand All @@ -10,8 +10,6 @@ import { clientFrameworkTypes } from '../../jdl/jhipster/index.js';
import { CLIENT_MAIN_SRC_DIR } from '../generator-constants.js';
import { GENERATOR_ANGULAR } from '../generator-list.js';

const { snakeCase } = lodash;

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

Expand Down
8 changes: 4 additions & 4 deletions generators/angular/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as _ from 'lodash-es';
import { camelCase } from 'lodash-es';
import chalk from 'chalk';
import { isFileStateModified } from 'mem-fs-editor/state';

Expand Down Expand Up @@ -55,7 +55,7 @@ export default class AngularGenerator extends BaseApplicationGenerator {

async beforeQueue() {
if (!this.fromBlueprint) {
await this.composeWithBlueprints(GENERATOR_ANGULAR);
await this.composeWithBlueprints();
}

if (!this.delegateToBlueprint) {
Expand Down Expand Up @@ -334,7 +334,7 @@ export default class AngularGenerator extends BaseApplicationGenerator {
* @param {boolean} enableTranslation - If translations are enabled or not
* @param {string} translationKeyMenu - i18n key for entry in the admin menu
*/
addElementToAdminMenu(routerName, iconName, enableTranslation, translationKeyMenu = _.camelCase(routerName), jhiPrefix?) {
addElementToAdminMenu(routerName, iconName, enableTranslation, translationKeyMenu = camelCase(routerName), jhiPrefix?) {
this.needleApi.clientAngular.addElementToAdminMenu(routerName, iconName, enableTranslation, translationKeyMenu, jhiPrefix);
}

Expand Down Expand Up @@ -450,7 +450,7 @@ export default class AngularGenerator extends BaseApplicationGenerator {
* @param {string} clientFramework - The name of the client framework
* @param {string} translationKeyMenu - i18n key for entry in the menu
*/
addElementToMenu(routerName, iconName, enableTranslation, clientFramework, translationKeyMenu = _.camelCase(routerName)) {
addElementToMenu(routerName, iconName, enableTranslation, clientFramework, translationKeyMenu = camelCase(routerName)) {
this.needleApi.clientAngular.addElementToMenu(routerName, iconName, enableTranslation, translationKeyMenu);
}
}
1 change: 1 addition & 0 deletions generators/angular/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@
* limitations under the License.
*/
export { default } from './generator.js';
export { default as command } from './command.js';
6 changes: 3 additions & 3 deletions generators/angular/needle-api/needle-client-angular.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* limitations under the License.
*/
import chalk from 'chalk';
import * as _ from 'lodash-es';
import { startCase } from 'lodash-es';

import needleClientBase from '../../client/needle-api/needle-client.js';
import { LINE_LENGTH } from '../../generator-constants.js';
Expand Down Expand Up @@ -124,7 +124,7 @@ export default class extends needleClientBase {
const entityEntry = `<li class="nav-item" routerLinkActive="active" [routerLinkActiveOptions]="{exact: true}">
<a class="nav-link" ${routerLink} (click)="collapseNavbar()">
<fa-icon icon="${iconName}" [fixedWidth]="true"></fa-icon>
<span${enableTranslation ? ` ${jhiPrefix}Translate="global.menu.${translationKeyMenu}"` : ''}>${_.startCase(routerName)}</span>
<span${enableTranslation ? ` ${jhiPrefix}Translate="global.menu.${translationKeyMenu}"` : ''}>${startCase(routerName)}</span>
</a>
</li>`;
const rewriteFileModel = this.generateFileModel(entityMenuPath, 'jhipster-needle-add-element-to-menu', entityEntry);
Expand All @@ -142,7 +142,7 @@ export default class extends needleClientBase {
const entityEntry = `<li>
<a class="dropdown-item" ${routerLink} routerLinkActive="active" (click)="collapseNavbar()">
<fa-icon icon="${iconName}" [fixedWidth]="true"></fa-icon>
<span${enableTranslation ? ` ${jhiPrefix}Translate="global.menu.admin.${translationKeyMenu}"` : ''}>${_.startCase(routerName)}</span>
<span${enableTranslation ? ` ${jhiPrefix}Translate="global.menu.admin.${translationKeyMenu}"` : ''}>${startCase(routerName)}</span>
</a>
</li>`;
const rewriteFileModel = this.generateFileModel(navbarAdminPath, 'jhipster-needle-add-element-to-admin-menu', entityEntry);
Expand Down
16 changes: 8 additions & 8 deletions generators/angular/resources/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"dependencies": {
"@angular/common": "17.3.2",
"@angular/common": "17.3.3",
"@fortawesome/angular-fontawesome": "0.14.1",
"@fortawesome/fontawesome-svg-core": "6.5.1",
"@fortawesome/free-solid-svg-icons": "6.5.1",
"@fortawesome/fontawesome-svg-core": "6.5.2",
"@fortawesome/free-solid-svg-icons": "6.5.2",
"@ng-bootstrap/ng-bootstrap": "16.0.0",
"@ngx-translate/core": "15.0.0",
"@ngx-translate/http-loader": "8.0.0",
Expand All @@ -21,14 +21,14 @@
"devDependencies": {
"@angular-architects/module-federation": "17.0.8",
"@angular-architects/module-federation-runtime": "17.0.8",
"@angular-builders/custom-webpack": "17.0.1",
"@angular-builders/jest": "17.0.2",
"@angular-builders/custom-webpack": "17.0.2",
"@angular-builders/jest": "17.0.3",
"@angular-eslint/eslint-plugin": "17.3.0",
"@angular/cli": "17.3.2",
"@angular/cli": "17.3.3",
"@types/jest": "29.5.12",
"@types/node": "20.11.25",
"@types/sockjs-client": "1.5.4",
"@typescript-eslint/eslint-plugin": "7.4.0",
"@typescript-eslint/eslint-plugin": "7.5.0",
"browser-sync": "3.0.2",
"browser-sync-webpack-plugin": "2.3.0",
"buffer": "6.0.3",
Expand All @@ -46,7 +46,7 @@
"postcss-rtlcss": "5.1.0",
"rimraf": "5.0.5",
"ts-jest": "29.1.2",
"typescript": "5.4.3",
"typescript": "5.4.4",
"webpack": "5.91.0",
"webpack-bundle-analyzer": "4.10.1",
"webpack-merge": "5.10.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import SharedModule from 'app/shared/shared.module';
import { ActivateService } from './activate.service';

@Component({
selector: '<%= jhiPrefixDashed %>-activate',
standalone: true,
selector: '<%= jhiPrefixDashed %>-activate',
imports: [SharedModule, RouterModule],
templateUrl: './activate.component.html',
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import SharedModule from 'app/shared/shared.module';
import { PasswordResetFinishService } from './password-reset-finish.service';

@Component({
selector: '<%= jhiPrefixDashed %>-password-reset-finish',
standalone: true,
selector: '<%= jhiPrefixDashed %>-password-reset-finish',
imports: [SharedModule, RouterModule, FormsModule, ReactiveFormsModule, PasswordStrengthBarComponent],
templateUrl: './password-reset-finish.component.html',
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import SharedModule from 'app/shared/shared.module';
import { PasswordResetInitService } from './password-reset-init.service';

@Component({
selector: '<%= jhiPrefixDashed %>-password-reset-init',
standalone: true,
selector: '<%= jhiPrefixDashed %>-password-reset-init',
imports: [SharedModule, FormsModule, ReactiveFormsModule],
templateUrl: './password-reset-init.component.html',
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import { Component, ElementRef, inject, Input, Renderer2 } from '@angular/core';
import SharedModule from 'app/shared/shared.module';

@Component({
selector: '<%= jhiPrefixDashed %>-password-strength-bar',
standalone: true,
selector: '<%= jhiPrefixDashed %>-password-strength-bar',
imports: [SharedModule],
templateUrl: './password-strength-bar.component.html',
styleUrl: './password-strength-bar.component.scss',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import { PasswordService } from './password.service';
import PasswordStrengthBarComponent from './password-strength-bar/password-strength-bar.component';

@Component({
selector: '<%= jhiPrefixDashed %>-password',
standalone: true,
selector: '<%= jhiPrefixDashed %>-password',
imports: [SharedModule, FormsModule, ReactiveFormsModule, PasswordStrengthBarComponent],
templateUrl: './password.component.html',
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import SharedModule from 'app/shared/shared.module';
import PasswordStrengthBarComponent from '../password/password-strength-bar/password-strength-bar.component';

@Component({
selector: '<%= jhiPrefixDashed %>-register',
standalone: true,
selector: '<%= jhiPrefixDashed %>-register',
imports: [SharedModule, RouterModule, FormsModule, ReactiveFormsModule, PasswordStrengthBarComponent],
templateUrl: './register.component.html',
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import { SessionsService } from './sessions.service';
import { Account } from 'app/core/auth/account.model';

@Component({
selector: '<%= jhiPrefixDashed %>-sessions',
standalone: true,
selector: '<%= jhiPrefixDashed %>-sessions',
imports: [SharedModule],
templateUrl: './sessions.component.html',
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ import { LANGUAGES } from 'app/config/language.constants';
const initialAccount: Account = {} as Account;

@Component({
selector: '<%= jhiPrefixDashed %>-settings',
standalone: true,
selector: '<%= jhiPrefixDashed %>-settings',
imports: [SharedModule, FormsModule, ReactiveFormsModule],
templateUrl: './settings.component.html',
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class ConfigurationService {
Object.values(
Object.values(configProps.contexts)
.map(context => context.beans)
.reduce((allBeans: Beans, contextBeans: Beans) => ({ ...allBeans, ...contextBeans }))
.reduce((allBeans: Beans, contextBeans: Beans) => ({ ...allBeans, ...contextBeans }), {})
)
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import { TrackerActivity } from 'app/core/tracker/tracker-activity.model';
import SharedModule from 'app/shared/shared.module';

@Component({
selector: '<%= jhiPrefixDashed %>-tracker',
standalone: true,
selector: '<%= jhiPrefixDashed %>-tracker',
imports: [SharedModule],
templateUrl: './tracker.component.html',
})
Expand Down
Loading

0 comments on commit f24a2ac

Please sign in to comment.