From 8e3c9744ccb9ab670b5fe403a94e448847eb4f03 Mon Sep 17 00:00:00 2001 From: Marcelo Shima Date: Wed, 26 Jun 2024 22:24:19 -0300 Subject: [PATCH] drop airbnb eslint config --- .eslintrc.json | 2 +- cli/download.mts | 2 +- cli/environment-builder.mjs | 2 +- cli/program.mjs | 10 ++-- cli/program.spec.mts | 2 +- generators/angular/generator.spec.ts | 2 +- generators/angular/generator.ts | 20 +++---- generators/app/composing.spec.ts | 2 +- generators/app/generator.js | 4 +- generators/base-application/generator.spec.ts | 2 +- generators/base-application/generator.ts | 8 +-- .../base-application/support/enum.spec.ts | 2 +- .../support/prepare-entity.spec.ts | 2 +- .../support/prepare-entity.ts | 4 +- .../base-application/support/prepare-field.js | 2 +- .../support/prepare-field.spec.ts | 4 +- .../support/prepare-relationship.js | 2 +- .../update-application-entities-transform.ts | 2 +- generators/base-application/tasks.d.ts | 4 +- generators/base-core/generator-core.spec.ts | 2 +- generators/base-workspaces/generator.ts | 4 +- .../internal/docker-prompts.js | 4 +- generators/base/generator.spec.ts | 2 +- generators/base/generator.ts | 4 +- generators/base/shared-data.ts | 2 +- generators/base/support/jhipster7-context.js | 2 +- generators/base/support/string.spec.ts | 2 +- generators/base/support/write-files.spec.ts | 2 +- generators/base/support/write-files.ts | 2 +- .../generator.spec.ts | 2 +- .../bootstrap-application-base/generator.ts | 2 +- .../generator.spec.ts | 2 +- .../generator.spec.ts | 2 +- .../bootstrap-application/generator.spec.ts | 2 +- generators/bootstrap/generator.spec.ts | 2 +- generators/bootstrap/generator.ts | 10 ++-- .../support/auto-crlf-transform.spec.ts | 2 +- generators/ci-cd/generator.js | 2 +- generators/client/files-common.js | 2 +- generators/client/generator-needles.spec.ts | 2 +- generators/client/generator.js | 8 ++- generators/client/generator.spec.ts | 2 +- .../client/needle-api/needle-client-vue.ts | 2 +- .../client/support/entity-definition.js | 2 +- generators/common/generator.js | 4 +- generators/common/generator.spec.js | 2 +- generators/cucumber/files.ts | 2 +- generators/cucumber/generator.spec.ts | 2 +- generators/cypress/files.ts | 4 +- generators/cypress/generator.spec.ts | 2 +- generators/cypress/generator.ts | 2 +- generators/docker-compose/generator.js | 4 +- generators/docker-compose/generator.spec.js | 2 +- generators/docker/generator.js | 4 +- generators/docker/generator.spec.ts | 4 +- generators/entities/generator.spec.ts | 2 +- generators/entity/generator.js | 2 +- generators/export-jdl/generator.spec.ts | 2 +- generators/gatling/entity-files.ts | 2 +- generators/gatling/files.ts | 2 +- generators/gatling/generator.spec.ts | 2 +- generators/generate-blueprint/generator.js | 11 ++-- generators/gradle/generator.ts | 4 +- .../generators/code-quality/generator.spec.ts | 2 +- .../gradle/generators/jib/generator.spec.ts | 2 +- generators/heroku/generator.js | 2 +- generators/info/generator.spec.ts | 2 +- generators/info/generator.ts | 2 +- generators/init/command.ts | 2 +- generators/init/generator.js | 2 +- generators/init/generator.spec.ts | 2 +- .../java/generators/domain/generator.spec.ts | 2 +- .../java/generators/domain/generator.ts | 2 +- generators/java/types.d.ts | 2 +- generators/jdl/generator.spec.ts | 2 +- generators/jdl/generator.ts | 4 +- generators/kubernetes-helm/generator.js | 2 +- generators/kubernetes-helm/generator.spec.js | 2 +- generators/kubernetes-knative/generator.js | 4 +- .../kubernetes-knative/generator.spec.js | 2 +- generators/kubernetes/generator.js | 6 +-- generators/kubernetes/generator.spec.js | 2 +- generators/kubernetes/kubernetes-base.js | 2 +- generators/kubernetes/prompts.js | 3 +- .../languages/generator-needles.spec.ts | 2 +- generators/languages/generator.js | 10 ++-- generators/languages/generator.spec.js | 2 +- generators/liquibase/files.ts | 2 +- generators/liquibase/generator.ts | 20 +++---- generators/maven/generator.ts | 2 +- generators/project-name/command.ts | 2 +- generators/project-name/generator.js | 4 +- generators/react/generator.js | 10 ++-- generators/react/generator.spec.ts | 2 +- generators/server/generator.js | 19 ++++--- generators/server/generator.spec.js | 4 +- .../server/options/database-migration.spec.ts | 2 +- .../server/options/message-broker.spec.ts | 2 +- generators/server/support/database.ts | 2 +- generators/server/support/needles.spec.ts | 2 +- generators/server/support/prepare-entity.js | 2 +- generators/server/support/prepare-field.js | 4 +- generators/server/types.d.ts | 4 +- generators/spring-boot/cleanup.ts | 2 +- generators/spring-boot/entity-files.js | 2 +- generators/spring-boot/generator.ts | 6 +-- generators/spring-cache/files.ts | 2 +- generators/spring-cache/generator.spec.ts | 2 +- generators/spring-cache/generator.ts | 4 +- .../generator-pulsar.spec.ts | 3 +- .../spring-cloud-stream/generator.spec.ts | 3 +- generators/spring-data-cassandra/generator.js | 2 +- .../spring-data-couchbase/generator.spec.ts | 2 +- .../spring-data-elasticsearch/generator.js | 2 +- .../generator.spec.ts | 5 +- generators/spring-data-neo4j/entity-files.ts | 2 +- .../spring-data-relational/generator.ts | 6 +-- .../support/application-properties.ts | 2 +- generators/spring-websocket/files.ts | 2 +- generators/spring-websocket/generator.spec.ts | 2 +- generators/upgrade/generator.js | 2 +- generators/upgrade/generator.spec.js | 2 +- generators/vue/generator.js | 8 +-- generators/vue/generator.spec.ts | 2 +- .../jdl-to-json-option-converter.spec.ts | 2 +- ...jdl-to-json-relationship-converter.spec.ts | 2 +- ...jdl-with-applications-to-json-converter.ts | 8 +-- ...hout-application-to-json-converter.spec.ts | 3 +- ...l-without-application-to-json-converter.ts | 6 +-- jdl/converters/json-to-jdl-converter.ts | 6 +-- .../json-to-jdl-entity-converter.spec.ts | 2 +- .../json-to-jdl-entity-converter.ts | 2 +- .../application-converter.ts | 4 +- .../entity-converter.ts | 2 +- .../field-converter.spec.ts | 2 +- .../option-converter.ts | 2 +- ...parsed-jdl-to-jdl-object-converter.spec.ts | 2 +- .../parsed-jdl-to-jdl-object-converter.ts | 8 +-- jdl/exporters/config.ts | 2 +- jdl/exporters/export-utils.ts | 2 +- jdl/exporters/jhipster-deployment-exporter.ts | 2 +- jdl/exporters/types.d.ts | 2 +- jdl/integration-test.spec.ts | 2 +- jdl/jhipster/application-options.ts | 12 ++--- jdl/jhipster/default-application-options.ts | 2 +- jdl/jhipster/field-types.ts | 2 +- jdl/jhipster/reserved-keywords.ts | 4 +- jdl/linters/entity-linter.ts | 2 +- jdl/linters/issues/issues.spec.ts | 2 +- jdl/linters/jdl-linter.spec.ts | 2 +- jdl/linters/relationship-linter.ts | 2 +- jdl/linters/rule.ts | 3 +- jdl/models/jdl-binary-option.ts | 2 +- jdl/models/jdl-enum.ts | 2 +- jdl/models/jdl-object.ts | 2 +- jdl/models/jdl-unary-option.ts | 2 +- ...st-jdl-application-configuration-option.ts | 2 +- jdl/parsing/jdl-ast-builder-visitor.ts | 2 +- jdl/parsing/lexer/application-tokens.ts | 5 +- jdl/parsing/lexer/lexer.ts | 2 +- jdl/parsing/validator.ts | 2 +- jdl/readers/jdl-reader.spec.ts | 2 +- jdl/readers/json-file-reader.spec.ts | 2 +- jdl/readers/json-reader.spec.ts | 2 +- jdl/readers/json-reader.ts | 2 +- jdl/utils/files-utils.spec.ts | 2 +- jdl/validators/deployment-validator.ts | 2 +- jdl/validators/entity-validator.ts | 2 +- jdl/validators/enum-validator.ts | 2 +- .../jdl-with-application-validator.ts | 12 ++--- .../jdl-without-application-validator.ts | 12 ++--- jdl/validators/relationship-validator.ts | 2 +- jdl/validators/validation-validator.ts | 2 +- package-lock.json | 53 ------------------- package.json | 1 - test/integration-test.spec.ts | 2 +- testing/github.ts | 2 +- testing/helpers.ts | 8 +-- 178 files changed, 288 insertions(+), 353 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 2119c54045ad..920b4c9d8987 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -3,7 +3,7 @@ "node": true, "es2022": true }, - "extends": ["airbnb-base", "plugin:prettier/recommended", "plugin:@typescript-eslint/recommended"], + "extends": ["plugin:prettier/recommended", "plugin:@typescript-eslint/recommended"], "parser": "@typescript-eslint/parser", "plugins": ["mocha", "prettier", "chai-friendly", "@typescript-eslint", "unused-imports", "import"], "settings": { diff --git a/cli/download.mts b/cli/download.mts index 7e390ba8fa30..a8711a0b73a0 100644 --- a/cli/download.mts +++ b/cli/download.mts @@ -21,8 +21,8 @@ import path from 'path'; import { inspect } from 'util'; import axios from 'axios'; -import { logger } from './utils.mjs'; import { packageJson } from '../lib/index.js'; +import { logger } from './utils.mjs'; const downloadFile = async (url: string, filename: string): Promise => { logger.verboseInfo(`Downloading file: ${url}`); diff --git a/cli/environment-builder.mjs b/cli/environment-builder.mjs index b638cb4c4c04..333fa64b1dec 100644 --- a/cli/environment-builder.mjs +++ b/cli/environment-builder.mjs @@ -25,9 +25,9 @@ import { cloneDeep, mergeWith } from 'lodash-es'; import Environment from 'yeoman-environment'; import { QueuedAdapter } from '@yeoman/adapter'; -import { CLI_NAME, logger } from './utils.mjs'; import { createJHipsterLogger, packageNameToNamespace } from '../generators/base/support/index.js'; import { parseBlueprintInfo, loadBlueprintsFromConfiguration, mergeBlueprints } from '../generators/base/internal/index.js'; +import { CLI_NAME, logger } from './utils.mjs'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); diff --git a/cli/program.mjs b/cli/program.mjs index b4d767656831..a29612a056bc 100644 --- a/cli/program.mjs +++ b/cli/program.mjs @@ -25,16 +25,16 @@ import { fileURLToPath } from 'url'; import didYouMean from 'didyoumean'; import chalk from 'chalk'; -import logo from './logo.mjs'; -import EnvironmentBuilder from './environment-builder.mjs'; -import SUB_GENERATORS from './commands.mjs'; -import JHipsterCommand from './jhipster-command.mjs'; -import { CLI_NAME, logger, getCommand, done } from './utils.mjs'; import { packageJson } from '../lib/index.js'; import { packageNameToNamespace } from '../generators/base/support/index.js'; import command from '../generators/base/command.js'; import { GENERATOR_APP, GENERATOR_BOOTSTRAP, GENERATOR_JDL } from '../generators/generator-list.js'; import { extractArgumentsFromConfigs } from '../generators/base/internal/command.js'; +import logo from './logo.mjs'; +import EnvironmentBuilder from './environment-builder.mjs'; +import SUB_GENERATORS from './commands.mjs'; +import JHipsterCommand from './jhipster-command.mjs'; +import { CLI_NAME, logger, getCommand, done } from './utils.mjs'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); diff --git a/cli/program.spec.mts b/cli/program.spec.mts index 4980b7626b3a..b43444feb536 100644 --- a/cli/program.spec.mts +++ b/cli/program.spec.mts @@ -3,8 +3,8 @@ import { expect } from 'chai'; import { describe, it, beforeEach } from 'esmocha'; -import { createProgram } from './program.mjs'; import { defaultHelpers as helpers } from '../testing/index.js'; +import { createProgram } from './program.mjs'; describe('cli - program', () => { beforeEach(async () => { diff --git a/generators/angular/generator.spec.ts b/generators/angular/generator.spec.ts index 297654659950..a4413bdac620 100644 --- a/generators/angular/generator.spec.ts +++ b/generators/angular/generator.spec.ts @@ -5,10 +5,10 @@ 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'; -import Generator from './index.js'; import { clientFrameworkTypes } from '../../jdl/jhipster/index.js'; import { CLIENT_MAIN_SRC_DIR } from '../generator-constants.js'; import { GENERATOR_ANGULAR } from '../generator-list.js'; +import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); diff --git a/generators/angular/generator.ts b/generators/angular/generator.ts index 53cb4aec1cc2..e29716bd8075 100644 --- a/generators/angular/generator.ts +++ b/generators/angular/generator.ts @@ -23,10 +23,19 @@ import { isFileStateModified } from 'mem-fs-editor/state'; import BaseApplicationGenerator, { type Entity } from '../base-application/index.js'; import { GENERATOR_ANGULAR, GENERATOR_CLIENT, GENERATOR_LANGUAGES } from '../generator-list.js'; import { defaultLanguage } from '../languages/support/index.js'; +import { clientFrameworkTypes } from '../../jdl/jhipster/index.js'; +import { + generateEntityClientEnumImports as getClientEnumImportsFormat, + getTypescriptKeyType as getTSKeyType, + generateTestEntityId as getTestEntityId, + generateTestEntityPrimaryKey as getTestEntityPrimaryKey, + generateTypescriptTestEntity as generateTestEntity, +} from '../client/support/index.js'; +import type { CommonClientServerApplication } from '../base-application/types.js'; +import { createNeedleCallback, mutateData } from '../base/support/index.js'; import { writeEntitiesFiles, postWriteEntitiesFiles, cleanupEntitiesFiles } from './entity-files-angular.js'; import { writeFiles } from './files-angular.js'; import cleanupOldFilesTask from './cleanup.js'; -import { clientFrameworkTypes } from '../../jdl/jhipster/index.js'; import { buildAngularFormPath as angularFormPath, addEntitiesRoute, @@ -38,15 +47,6 @@ import { addItemToAdminMenu, addIconImport, } from './support/index.js'; -import { - generateEntityClientEnumImports as getClientEnumImportsFormat, - getTypescriptKeyType as getTSKeyType, - generateTestEntityId as getTestEntityId, - generateTestEntityPrimaryKey as getTestEntityPrimaryKey, - generateTypescriptTestEntity as generateTestEntity, -} from '../client/support/index.js'; -import type { CommonClientServerApplication } from '../base-application/types.js'; -import { createNeedleCallback, mutateData } from '../base/support/index.js'; const { ANGULAR } = clientFrameworkTypes; diff --git a/generators/app/composing.spec.ts b/generators/app/composing.spec.ts index e168a97778c1..2ea92899a5d5 100644 --- a/generators/app/composing.spec.ts +++ b/generators/app/composing.spec.ts @@ -1,5 +1,5 @@ -import { before, it, describe } from 'esmocha'; import assert from 'assert'; +import { before, it, describe } from 'esmocha'; import { defaultHelpers as helpers } from '../../testing/index.js'; import { GENERATOR_APP } from '../generator-list.js'; diff --git a/generators/app/generator.js b/generators/app/generator.js index 769516dd2bab..8ebd160c4cf2 100644 --- a/generators/app/generator.js +++ b/generators/app/generator.js @@ -21,13 +21,13 @@ import chalk from 'chalk'; import { camelCase } from 'lodash-es'; import BaseApplicationGenerator from '../base-application/index.js'; -import { checkNode, loadStoredAppOptions } from './support/index.js'; -import cleanupOldFilesTask from './cleanup.js'; import { GENERATOR_COMMON, GENERATOR_CLIENT, GENERATOR_SERVER } from '../generator-list.js'; import { getDefaultAppName } from '../project-name/support/index.js'; import { packageJson } from '../../lib/index.js'; import { applicationTypes } from '../../jdl/jhipster/index.js'; +import cleanupOldFilesTask from './cleanup.js'; +import { checkNode, loadStoredAppOptions } from './support/index.js'; import command from './command.js'; const { MICROSERVICE } = applicationTypes; diff --git a/generators/base-application/generator.spec.ts b/generators/base-application/generator.spec.ts index 2b566ff7f973..a55b214f5c7d 100644 --- a/generators/base-application/generator.spec.ts +++ b/generators/base-application/generator.spec.ts @@ -23,9 +23,9 @@ import { before, it, describe, expect, esmocha } from 'esmocha'; import { snakeCase } from 'lodash-es'; import EnvironmentBuilder from '../../cli/environment-builder.mjs'; -import Generator from './index.js'; import { defaultHelpers as helpers } from '../../testing/index.js'; import { shouldSupportFeatures } from '../../test/support/tests.js'; +import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); diff --git a/generators/base-application/generator.ts b/generators/base-application/generator.ts index 71344364da5c..bff8e7fa4dcf 100644 --- a/generators/base-application/generator.ts +++ b/generators/base-application/generator.ts @@ -20,12 +20,8 @@ import { upperFirst } from 'lodash-es'; import type { ComposeOptions, Storage } from 'yeoman-generator'; import BaseGenerator from '../base/index.js'; -import { CUSTOM_PRIORITIES, PRIORITY_NAMES, QUEUES } from './priorities.js'; import { JHIPSTER_CONFIG_DIR } from '../generator-constants.js'; -import type { BaseApplicationGeneratorDefinition, GenericApplicationDefinition } from './tasks.js'; import { GenericTaskGroup, GenericSourceTypeDefinition } from '../base/tasks.js'; -import type { BaseApplication, CommonClientServerApplication } from './types.js'; -import { getEntitiesFromDir } from './support/index.js'; import { SpringBootSourceType } from '../server/types.js'; import { ClientSourceType } from '../client/types.js'; import { I18nApplication } from '../languages/types.js'; @@ -37,6 +33,10 @@ import { GENERATOR_BOOTSTRAP_APPLICATION_CLIENT, GENERATOR_BOOTSTRAP_APPLICATION_SERVER, } from '../generator-list.js'; +import { getEntitiesFromDir } from './support/index.js'; +import type { BaseApplication, CommonClientServerApplication } from './types.js'; +import type { BaseApplicationGeneratorDefinition, GenericApplicationDefinition } from './tasks.js'; +import { CUSTOM_PRIORITIES, PRIORITY_NAMES, QUEUES } from './priorities.js'; const { LOADING, diff --git a/generators/base-application/support/enum.spec.ts b/generators/base-application/support/enum.spec.ts index 68f936d5686c..cf0ea0186785 100644 --- a/generators/base-application/support/enum.spec.ts +++ b/generators/base-application/support/enum.spec.ts @@ -1,5 +1,5 @@ -import { before, it, describe } from 'esmocha'; import assert from 'assert'; +import { before, it, describe } from 'esmocha'; import { getEnumInfo } from './enum.js'; describe('base-application - support - enum', () => { diff --git a/generators/base-application/support/prepare-entity.spec.ts b/generators/base-application/support/prepare-entity.spec.ts index 3479cf630558..349a0468ffc1 100644 --- a/generators/base-application/support/prepare-entity.spec.ts +++ b/generators/base-application/support/prepare-entity.spec.ts @@ -20,9 +20,9 @@ import { it, describe, beforeEach } from 'esmocha'; import { expect } from 'chai'; import { formatDateForChangelog } from '../../base/support/index.js'; -import { prepareEntityPrimaryKeyForTemplates, entityDefaultConfig } from './prepare-entity.js'; import BaseGenerator from '../../base/index.js'; import { getConfigWithDefaults } from '../../../jdl/jhipster/index.js'; +import { prepareEntityPrimaryKeyForTemplates, entityDefaultConfig } from './prepare-entity.js'; describe('generator - base-application - support - prepareEntity', () => { const defaultGenerator = { jhipsterConfig: getConfigWithDefaults() }; diff --git a/generators/base-application/support/prepare-entity.ts b/generators/base-application/support/prepare-entity.ts index 2dfc49fd6f93..67eed9158962 100644 --- a/generators/base-application/support/prepare-entity.ts +++ b/generators/base-application/support/prepare-entity.ts @@ -29,7 +29,6 @@ import { getMicroserviceAppName, mutateData, } from '../../base/support/index.js'; -import { fieldToReference } from './prepare-field.js'; import { getTypescriptKeyType, getEntityParentPathAddition } from '../../client/support/index.js'; import { applicationTypes, @@ -39,10 +38,11 @@ import { fieldTypes, searchEngineTypes, } from '../../../jdl/jhipster/index.js'; -import { fieldIsEnum } from './field-utils.js'; import { Entity } from '../types/index.js'; import type CoreGenerator from '../../base-core/generator.js'; +import { fieldIsEnum } from './field-utils.js'; +import { fieldToReference } from './prepare-field.js'; const NO_SEARCH_ENGINE = searchEngineTypes.NO; const { PaginationTypes, ServiceTypes, MapperTypes } = entityOptions; diff --git a/generators/base-application/support/prepare-field.js b/generators/base-application/support/prepare-field.js index d9ce539df671..7faa94b5de42 100644 --- a/generators/base-application/support/prepare-field.js +++ b/generators/base-application/support/prepare-field.js @@ -20,8 +20,8 @@ import { snakeCase, startCase, upperFirst, defaults, kebabCase } from 'lodash-es import { fieldTypes, validations } from '../../../jdl/jhipster/index.js'; import { getTypescriptType, prepareField as prepareClientFieldForTemplates } from '../../client/support/index.js'; import { prepareField as prepareServerFieldForTemplates } from '../../server/support/index.js'; -import { fieldIsEnum } from './field-utils.js'; import { mutateData } from '../../base/support/config.js'; +import { fieldIsEnum } from './field-utils.js'; import { prepareProperty } from './prepare-property.js'; const { BlobTypes, CommonDBTypes, RelationalOnlyDBTypes } = fieldTypes; diff --git a/generators/base-application/support/prepare-field.spec.ts b/generators/base-application/support/prepare-field.spec.ts index ea5836146138..5d7cdad65e51 100644 --- a/generators/base-application/support/prepare-field.spec.ts +++ b/generators/base-application/support/prepare-field.spec.ts @@ -19,11 +19,11 @@ import { it, describe, beforeEach } from 'esmocha'; import { expect } from 'chai'; -import prepareEntityForTemplates, { loadRequiredConfigIntoEntity } from './prepare-entity.js'; -import prepareFieldForTemplates, { getEnumValuesWithCustomValues } from './prepare-field.js'; import { formatDateForChangelog } from '../../base/support/index.js'; import BaseGenerator from '../../base/index.js'; import { getConfigWithDefaults } from '../../../jdl/jhipster/index.js'; +import prepareFieldForTemplates, { getEnumValuesWithCustomValues } from './prepare-field.js'; +import prepareEntityForTemplates, { loadRequiredConfigIntoEntity } from './prepare-entity.js'; const defaultConfig = getConfigWithDefaults(); diff --git a/generators/base-application/support/prepare-relationship.js b/generators/base-application/support/prepare-relationship.js index 27db1fbe455e..71c454b8f50a 100644 --- a/generators/base-application/support/prepare-relationship.js +++ b/generators/base-application/support/prepare-relationship.js @@ -21,8 +21,8 @@ import pluralize from 'pluralize'; import { databaseTypes, entityOptions, validations, checkAndReturnRelationshipOnValue } from '../../../jdl/jhipster/index.js'; import { getJoinTableName, hibernateSnakeCase } from '../../server/support/index.js'; -import { stringifyApplicationData } from './debug.js'; import { mutateData } from '../../base/support/config.js'; +import { stringifyApplicationData } from './debug.js'; import { prepareProperty } from './prepare-property.js'; const { NEO4J, NO: DATABASE_NO } = databaseTypes; diff --git a/generators/base-application/support/update-application-entities-transform.ts b/generators/base-application/support/update-application-entities-transform.ts index feee4bcbc6c6..370477009e43 100644 --- a/generators/base-application/support/update-application-entities-transform.ts +++ b/generators/base-application/support/update-application-entities-transform.ts @@ -1,9 +1,9 @@ import { readdir } from 'fs/promises'; +import { basename, join } from 'path'; import { loadFile } from 'mem-fs'; import type { MemFsEditorFile } from 'mem-fs-editor'; import { Minimatch } from 'minimatch'; import { transform } from 'p-transform'; -import { basename, join } from 'path'; import { GENERATOR_JHIPSTER } from '../../generator-constants.js'; export const updateApplicationEntitiesTransform = ({ diff --git a/generators/base-application/tasks.d.ts b/generators/base-application/tasks.d.ts index 6b1552c07287..4cbbea7d6752 100644 --- a/generators/base-application/tasks.d.ts +++ b/generators/base-application/tasks.d.ts @@ -1,9 +1,9 @@ import type { Storage } from 'yeoman-generator'; import { ControlTaskParam, BaseGeneratorDefinition, SourceTaskParam, GenericSourceTypeDefinition } from '../base/tasks.js'; -import { CommonClientServerApplication } from './types.js'; -import { Entity, Field, Relationship } from './types/index.js'; import { ClientSourceType } from '../client/types.js'; import { BaseChangelog } from '../base-entity-changes/types.js'; +import { CommonClientServerApplication } from './types.js'; +import { Entity, Field, Relationship } from './types/index.js'; export type GenericApplicationDefinition = { applicationType: ApplicationType; diff --git a/generators/base-core/generator-core.spec.ts b/generators/base-core/generator-core.spec.ts index 47afe19b8472..2a24645c47a7 100644 --- a/generators/base-core/generator-core.spec.ts +++ b/generators/base-core/generator-core.spec.ts @@ -2,8 +2,8 @@ import { it, describe, expect as jestExpect, beforeEach } from 'esmocha'; import { basicHelpers as helpers } from '../../testing/index.js'; -import Base from './index.js'; import { createJHipsterLogger } from '../base/support/logger.js'; +import Base from './index.js'; const BaseGenerator: any = Base.prototype; diff --git a/generators/base-workspaces/generator.ts b/generators/base-workspaces/generator.ts index 78ebfe113f0c..d47d39e20cfe 100644 --- a/generators/base-workspaces/generator.ts +++ b/generators/base-workspaces/generator.ts @@ -22,11 +22,11 @@ import { existsSync } from 'fs'; import chalk from 'chalk'; import BaseGenerator from '../base/index.js'; -import { PRIORITY_NAMES, CUSTOM_PRIORITIES } from './priorities.js'; import { YO_RC_FILE } from '../generator-constants.js'; import { GENERATOR_BOOTSTRAP_APPLICATION } from '../generator-list.js'; -import command from './command.js'; import { normalizePathEnd } from '../base/support/path.js'; +import command from './command.js'; +import { PRIORITY_NAMES, CUSTOM_PRIORITIES } from './priorities.js'; const { PROMPTING_WORKSPACES, diff --git a/generators/base-workspaces/internal/docker-prompts.js b/generators/base-workspaces/internal/docker-prompts.js index cbcd62538934..9b2e31f48966 100644 --- a/generators/base-workspaces/internal/docker-prompts.js +++ b/generators/base-workspaces/internal/docker-prompts.js @@ -16,13 +16,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import chalk from 'chalk'; import { readFileSync, readdirSync, statSync } from 'node:fs'; import { join } from 'node:path'; -import { loadConfigs } from './docker-base.js'; +import chalk from 'chalk'; import { applicationTypes, monitoringTypes, serviceDiscoveryTypes } from '../../../jdl/jhipster/index.js'; import { convertSecretToBase64 } from '../../base/support/index.js'; +import { loadConfigs } from './docker-base.js'; const { MICROSERVICE, MONOLITH, GATEWAY } = applicationTypes; const { PROMETHEUS } = monitoringTypes; diff --git a/generators/base/generator.spec.ts b/generators/base/generator.spec.ts index e0cb59127424..a17308665791 100644 --- a/generators/base/generator.spec.ts +++ b/generators/base/generator.spec.ts @@ -22,9 +22,9 @@ import { before, it, describe, expect, esmocha } from 'esmocha'; import { snakeCase } from 'lodash-es'; import EnvironmentBuilder from '../../cli/environment-builder.mjs'; -import BaseGenerator from './index.js'; import { defaultHelpers as helpers } from '../../testing/index.js'; import { getCommandHelpOutput, shouldSupportFeatures } from '../../test/support/tests.js'; +import BaseGenerator from './index.js'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); diff --git a/generators/base/generator.ts b/generators/base/generator.ts index b20cdb55094e..aebf4a4c00ee 100644 --- a/generators/base/generator.ts +++ b/generators/base/generator.ts @@ -23,14 +23,14 @@ import semver from 'semver'; import type { ComposeOptions } from 'yeoman-generator'; import { packageJson } from '../../lib/index.js'; +import CoreGenerator from '../base-core/index.js'; +import { loadStoredAppOptions } from '../app/support/index.js'; import { packageNameToNamespace } from './support/index.js'; import { mergeBlueprints, parseBluePrints, loadBlueprintsFromConfiguration, normalizeBlueprintName } from './internal/index.js'; import { PRIORITY_NAMES } from './priorities.js'; import { BaseGeneratorDefinition, GenericTaskGroup } from './tasks.js'; import type { JHipsterGeneratorFeatures, JHipsterGeneratorOptions } from './api.js'; -import CoreGenerator from '../base-core/index.js'; import { LOCAL_BLUEPRINT_PACKAGE_NAMESPACE } from './support/constants.js'; -import { loadStoredAppOptions } from '../app/support/index.js'; /** * Base class that contains blueprints support. diff --git a/generators/base/shared-data.ts b/generators/base/shared-data.ts index aaf6fff90ab2..dc5db5bcf564 100644 --- a/generators/base/shared-data.ts +++ b/generators/base/shared-data.ts @@ -23,8 +23,8 @@ import { lt as semverLessThan } from 'semver'; import { defaults } from 'lodash-es'; import { MemFsEditor, create } from 'mem-fs-editor'; import { type BaseApplication } from '../base-application/types.js'; -import { type Control } from './types.js'; import { GENERATOR_JHIPSTER } from '../generator-constants.js'; +import { type Control } from './types.js'; export default class SharedData { _storage: any; diff --git a/generators/base/support/jhipster7-context.js b/generators/base/support/jhipster7-context.js index 3f4a717c25bf..14ba76ec7b56 100644 --- a/generators/base/support/jhipster7-context.js +++ b/generators/base/support/jhipster7-context.js @@ -3,7 +3,6 @@ import chalk from 'chalk'; import { camelCase } from 'lodash-es'; import { isReservedTableName } from '../../../jdl/jhipster/reserved-keywords.js'; -import { upperFirstCamelCase } from './string.js'; import { getJavaValueGeneratorForType, getJoinTableName, @@ -14,6 +13,7 @@ import { import { getDBCExtraOption } from '../../spring-data-relational/support/database-data.js'; import { getJdbcUrl, getR2dbcUrl } from '../../spring-data-relational/support/database-url.js'; import { fieldTypes } from '../../../jdl/index.js'; +import { upperFirstCamelCase } from './string.js'; const { BYTES, BYTE_BUFFER } = fieldTypes.RelationalOnlyDBTypes; diff --git a/generators/base/support/string.spec.ts b/generators/base/support/string.spec.ts index 070464435623..396f4bcac294 100644 --- a/generators/base/support/string.spec.ts +++ b/generators/base/support/string.spec.ts @@ -1,5 +1,5 @@ -import { it, describe } from 'esmocha'; import assert from 'assert'; +import { it, describe } from 'esmocha'; import { stringHashCode } from './string.js'; describe('generator - base - support - string', () => { diff --git a/generators/base/support/write-files.spec.ts b/generators/base/support/write-files.spec.ts index e27004b02a9b..415fa2036c73 100644 --- a/generators/base/support/write-files.spec.ts +++ b/generators/base/support/write-files.spec.ts @@ -17,8 +17,8 @@ * limitations under the License. */ import { it, describe, expect, esmocha } from 'esmocha'; -import { joinCallbacks } from './write-files.js'; import { EditFileCallback } from '../api.js'; +import { joinCallbacks } from './write-files.js'; describe('generator - base - support - writeFiles', () => { describe('joinCallbacks', () => { diff --git a/generators/base/support/write-files.ts b/generators/base/support/write-files.ts index 2f98c3cfbbeb..eb6c95edf5de 100644 --- a/generators/base/support/write-files.ts +++ b/generators/base/support/write-files.ts @@ -18,8 +18,8 @@ */ import { platform } from 'os'; -import { normalizeLineEndings } from './contents.js'; import type { EditFileCallback } from '../api.js'; +import { normalizeLineEndings } from './contents.js'; const isWin32 = platform() === 'win32'; diff --git a/generators/bootstrap-application-base/generator.spec.ts b/generators/bootstrap-application-base/generator.spec.ts index f04f937ed09a..b64a95292eb8 100644 --- a/generators/bootstrap-application-base/generator.spec.ts +++ b/generators/bootstrap-application-base/generator.spec.ts @@ -21,10 +21,10 @@ import { fileURLToPath } from 'url'; import { before, it, describe, expect, beforeEach } from 'esmocha'; import { snakeCase } from 'lodash-es'; -import Generator from './index.js'; import { defaultHelpers as helpers, runResult } from '../../testing/index.js'; import { shouldSupportFeatures } from '../../test/support/tests.js'; import { parseChangelog } from '../base/support/timestamp.ts'; +import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); diff --git a/generators/bootstrap-application-base/generator.ts b/generators/bootstrap-application-base/generator.ts index 8da548cb1a47..c13c220b1bd6 100644 --- a/generators/bootstrap-application-base/generator.ts +++ b/generators/bootstrap-application-base/generator.ts @@ -33,12 +33,12 @@ import { prepareField as prepareFieldForTemplates, prepareRelationship, } from '../base-application/support/index.js'; -import { createAuthorityEntity, createUserEntity, createUserManagementEntity } from './utils.js'; import { JAVA_DOCKER_DIR } from '../generator-constants.js'; import { GENERATOR_BOOTSTRAP, GENERATOR_COMMON, GENERATOR_PROJECT_NAME } from '../generator-list.js'; import { packageJson } from '../../lib/index.js'; import { loadLanguagesConfig } from '../languages/support/index.js'; import { loadAppConfig, loadDerivedAppConfig, loadStoredAppOptions } from '../app/support/index.js'; +import { createAuthorityEntity, createUserEntity, createUserManagementEntity } from './utils.js'; import { exportJDLTransform, importJDLTransform } from './support/index.js'; import command from './command.js'; diff --git a/generators/bootstrap-application-client/generator.spec.ts b/generators/bootstrap-application-client/generator.spec.ts index 9b328d9ad69c..2e519225e9bc 100644 --- a/generators/bootstrap-application-client/generator.spec.ts +++ b/generators/bootstrap-application-client/generator.spec.ts @@ -21,9 +21,9 @@ import { fileURLToPath } from 'url'; import { before, it, describe, expect } from 'esmocha'; import { snakeCase } from 'lodash-es'; -import Generator from './index.js'; import { defaultHelpers as helpers } from '../../testing/index.js'; import { shouldSupportFeatures } from '../../test/support/tests.js'; +import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); diff --git a/generators/bootstrap-application-server/generator.spec.ts b/generators/bootstrap-application-server/generator.spec.ts index 9b328d9ad69c..2e519225e9bc 100644 --- a/generators/bootstrap-application-server/generator.spec.ts +++ b/generators/bootstrap-application-server/generator.spec.ts @@ -21,9 +21,9 @@ import { fileURLToPath } from 'url'; import { before, it, describe, expect } from 'esmocha'; import { snakeCase } from 'lodash-es'; -import Generator from './index.js'; import { defaultHelpers as helpers } from '../../testing/index.js'; import { shouldSupportFeatures } from '../../test/support/tests.js'; +import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); diff --git a/generators/bootstrap-application/generator.spec.ts b/generators/bootstrap-application/generator.spec.ts index b66da1bc3f91..3b09bd3c66d0 100644 --- a/generators/bootstrap-application/generator.spec.ts +++ b/generators/bootstrap-application/generator.spec.ts @@ -21,10 +21,10 @@ import { fileURLToPath } from 'url'; import { before, it, describe, expect } from 'esmocha'; import { snakeCase } from 'lodash-es'; -import Generator from './index.js'; import { defaultHelpers as helpers, result as runResult } from '../../testing/index.js'; import { fieldTypes } from '../../jdl/jhipster/index.js'; import { shouldSupportFeatures } from '../../test/support/tests.js'; +import Generator from './index.js'; const { CommonDBTypes: { UUID }, diff --git a/generators/bootstrap/generator.spec.ts b/generators/bootstrap/generator.spec.ts index c3c3d74464b6..b25895cf89f4 100644 --- a/generators/bootstrap/generator.spec.ts +++ b/generators/bootstrap/generator.spec.ts @@ -21,8 +21,8 @@ import { fileURLToPath } from 'url'; import { it, describe, expect } from 'esmocha'; import { snakeCase } from 'lodash-es'; -import Generator from './index.js'; import { shouldSupportFeatures } from '../../test/support/tests.js'; +import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); diff --git a/generators/bootstrap/generator.ts b/generators/bootstrap/generator.ts index f876865bcedd..4e553da74d9a 100644 --- a/generators/bootstrap/generator.ts +++ b/generators/bootstrap/generator.ts @@ -25,6 +25,11 @@ import prettier from 'prettier'; import type { FileTransform, PipelineOptions } from 'mem-fs'; import BaseGenerator from '../base/index.js'; +import { PRETTIER_EXTENSIONS } from '../generator-constants.js'; +import { GENERATOR_UPGRADE } from '../generator-list.js'; +import { PRIORITY_NAMES, QUEUES } from '../base-application/priorities.js'; +import type { BaseGeneratorDefinition, GenericTaskGroup } from '../base/tasks.js'; +import { loadStoredAppOptions } from '../app/support/index.js'; import { createMultiStepTransform, createPrettierTransform, @@ -35,11 +40,6 @@ import { createESLintTransform, createRemoveUnusedImportsTransform, } from './support/index.js'; -import { PRETTIER_EXTENSIONS } from '../generator-constants.js'; -import { GENERATOR_UPGRADE } from '../generator-list.js'; -import { PRIORITY_NAMES, QUEUES } from '../base-application/priorities.js'; -import type { BaseGeneratorDefinition, GenericTaskGroup } from '../base/tasks.js'; -import { loadStoredAppOptions } from '../app/support/index.js'; const { MULTISTEP_TRANSFORM, PRE_CONFLICTS } = PRIORITY_NAMES; const { MULTISTEP_TRANSFORM_QUEUE, PRE_CONFLICTS_QUEUE } = QUEUES; diff --git a/generators/bootstrap/support/auto-crlf-transform.spec.ts b/generators/bootstrap/support/auto-crlf-transform.spec.ts index 859950e11240..776cb4968133 100644 --- a/generators/bootstrap/support/auto-crlf-transform.spec.ts +++ b/generators/bootstrap/support/auto-crlf-transform.spec.ts @@ -1,6 +1,6 @@ import { before, it, describe, expect } from 'esmocha'; -import { detectCrLf } from './auto-crlf-transform.js'; import { defaultHelpers as helpers } from '../../../testing/index.js'; +import { detectCrLf } from './auto-crlf-transform.js'; describe('generator - bootstrap - utils', () => { describe('::detectCrLf', () => { diff --git a/generators/ci-cd/generator.js b/generators/ci-cd/generator.js index 3d9d9be66813..79e70265cc24 100644 --- a/generators/ci-cd/generator.js +++ b/generators/ci-cd/generator.js @@ -22,8 +22,8 @@ import chalk from 'chalk'; import BaseApplicationGenerator from '../base-application/index.js'; import { clientFrameworkTypes } from '../../jdl/jhipster/index.js'; import { createPomStorage } from '../maven/support/pom-store.js'; -import command from './command.js'; import { loadConfig, loadDerivedConfig } from '../../lib/internal/config-def.js'; +import command from './command.js'; const { REACT } = clientFrameworkTypes; diff --git a/generators/client/files-common.js b/generators/client/files-common.js index fbb847fe2f1a..99c012733d2f 100644 --- a/generators/client/files-common.js +++ b/generators/client/files-common.js @@ -16,8 +16,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { clientRootTemplatesBlock, clientSrcTemplatesBlock } from './support/files.js'; import { clientFrameworkTypes } from '../../jdl/index.js'; +import { clientRootTemplatesBlock, clientSrcTemplatesBlock } from './support/files.js'; const { ANGULAR, REACT, VUE } = clientFrameworkTypes; diff --git a/generators/client/generator-needles.spec.ts b/generators/client/generator-needles.spec.ts index e1d1007c535b..d611620abb2c 100644 --- a/generators/client/generator-needles.spec.ts +++ b/generators/client/generator-needles.spec.ts @@ -1,8 +1,8 @@ import { before, it, describe } from 'esmocha'; import { basicHelpers as helpers, result as runResult, getGenerator } from '../../testing/index.js'; -import ClientGenerator from './index.js'; import { CLIENT_WEBPACK_DIR } from '../generator-constants.js'; import { clientFrameworkTypes } from '../../jdl/jhipster/index.js'; +import ClientGenerator from './index.js'; const { ANGULAR, REACT } = clientFrameworkTypes; diff --git a/generators/client/generator.js b/generators/client/generator.js index 4fe4bb78da5f..8ba336ba9e59 100644 --- a/generators/client/generator.js +++ b/generators/client/generator.js @@ -19,17 +19,15 @@ import BaseApplicationGenerator from '../base-application/index.js'; -import { askForClientTheme, askForClientThemeVariant } from './prompts.js'; -import { writeFiles as writeCommonFiles } from './files-common.js'; - -import { addEnumerationFiles } from './entity-files.js'; - import { LOGIN_REGEX_JS } from '../generator-constants.js'; import { GENERATOR_CYPRESS, GENERATOR_COMMON, GENERATOR_CLIENT } from '../generator-list.js'; import { testFrameworkTypes, clientFrameworkTypes } from '../../jdl/jhipster/index.js'; import { createNeedleCallback } from '../base/support/index.js'; import { loadStoredAppOptions } from '../app/support/index.js'; +import { addEnumerationFiles } from './entity-files.js'; +import { writeFiles as writeCommonFiles } from './files-common.js'; +import { askForClientTheme, askForClientThemeVariant } from './prompts.js'; import command from './command.js'; const { ANGULAR, VUE, REACT, NO: CLIENT_FRAMEWORK_NO } = clientFrameworkTypes; diff --git a/generators/client/generator.spec.ts b/generators/client/generator.spec.ts index 0d72cb68d9fc..2855902ac727 100644 --- a/generators/client/generator.spec.ts +++ b/generators/client/generator.spec.ts @@ -22,10 +22,10 @@ import assert from 'assert'; import { snakeCase } from 'lodash-es'; import { before, it, describe, expect } from 'esmocha'; import { shouldSupportFeatures, testBlueprintSupport, checkEnforcements } from '../../test/support/index.js'; -import Generator from './index.js'; import { defaultHelpers as helpers, result } from '../../testing/index.js'; import { testFrameworkTypes } from '../../jdl/jhipster/index.js'; import { GENERATOR_CLIENT } from '../generator-list.js'; +import Generator from './index.js'; const { CYPRESS } = testFrameworkTypes; diff --git a/generators/client/needle-api/needle-client-vue.ts b/generators/client/needle-api/needle-client-vue.ts index adc2ad73041b..723bb73d146d 100644 --- a/generators/client/needle-api/needle-client-vue.ts +++ b/generators/client/needle-api/needle-client-vue.ts @@ -19,9 +19,9 @@ import chalk from 'chalk'; import { startCase } from 'lodash-es'; -import needleClientBase from './needle-client.js'; import { stripMargin } from '../../base/support/index.js'; import { createNeedleCallback } from '../../base/support/needles.js'; +import needleClientBase from './needle-client.js'; export default class extends needleClientBase { addEntityToMenu( diff --git a/generators/client/support/entity-definition.js b/generators/client/support/entity-definition.js index 2988032940b4..b5f7e14dfa37 100644 --- a/generators/client/support/entity-definition.js +++ b/generators/client/support/entity-definition.js @@ -17,9 +17,9 @@ * limitations under the License. */ +import { fieldTypes, validations, clientFrameworkTypes } from '../../../jdl/jhipster/index.js'; import getTypescriptKeyType from './types-utils.js'; -import { fieldTypes, validations, clientFrameworkTypes } from '../../../jdl/jhipster/index.js'; import { filterRelevantRelationships } from './template-utils.js'; const dbTypes = fieldTypes; diff --git a/generators/common/generator.js b/generators/common/generator.js index 890c983bc42c..f70275b7f307 100644 --- a/generators/common/generator.js +++ b/generators/common/generator.js @@ -20,7 +20,6 @@ import { isFileStateModified } from 'mem-fs-editor/state'; import BaseApplicationGenerator from '../base-application/index.js'; -import { writeFiles, prettierConfigFiles } from './files.js'; import { MAIN_DIR, TEST_DIR, @@ -30,9 +29,10 @@ import { } from '../generator-constants.js'; import { clientFrameworkTypes } from '../../jdl/jhipster/index.js'; import { GENERATOR_COMMON, GENERATOR_GIT } from '../generator-list.js'; -import command from './command.js'; import { createPrettierTransform } from '../bootstrap/support/prettier-support.js'; import { loadStoredAppOptions } from '../app/support/index.js'; +import command from './command.js'; +import { writeFiles, prettierConfigFiles } from './files.js'; const { REACT, ANGULAR } = clientFrameworkTypes; diff --git a/generators/common/generator.spec.js b/generators/common/generator.spec.js index eeb16134f5f8..46d459222184 100644 --- a/generators/common/generator.spec.js +++ b/generators/common/generator.spec.js @@ -23,8 +23,8 @@ import { snakeCase } from 'lodash-es'; import { defaultHelpers as helpers, basicHelpers, runResult } from '../../testing/index.js'; import { shouldSupportFeatures, testBlueprintSupport, checkEnforcements } from '../../test/support/index.js'; -import Generator from './index.js'; import { GENERATOR_COMMON } from '../generator-list.js'; +import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); diff --git a/generators/cucumber/files.ts b/generators/cucumber/files.ts index 1ea6a3f78941..3dee663fabbc 100644 --- a/generators/cucumber/files.ts +++ b/generators/cucumber/files.ts @@ -16,11 +16,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import Generator from './generator.js'; import { moveToJavaPackageTestDir } from '../server/support/index.js'; import { SERVER_TEST_SRC_DIR, SERVER_TEST_RES_DIR, GRADLE_BUILD_SRC_MAIN_DIR } from '../generator-constants.js'; import { WriteFileSection } from '../base/api.js'; import { CommonClientServerApplication } from '../base-application/types.js'; +import Generator from './generator.js'; const cucumberFiles: WriteFileSection = { cucumberFiles: [ diff --git a/generators/cucumber/generator.spec.ts b/generators/cucumber/generator.spec.ts index ac7e52de05e1..ea55093f8c63 100644 --- a/generators/cucumber/generator.spec.ts +++ b/generators/cucumber/generator.spec.ts @@ -4,10 +4,10 @@ import { before, it, describe, expect } from 'esmocha'; import { snakeCase } from 'lodash-es'; import { shouldSupportFeatures, testBlueprintSupport } from '../../test/support/tests.js'; -import Generator from './index.js'; import { defaultHelpers as helpers, result } from '../../testing/index.js'; import { GENERATOR_CUCUMBER } from '../generator-list.js'; +import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); diff --git a/generators/cypress/files.ts b/generators/cypress/files.ts index afa10e47be43..3bf3c4440143 100644 --- a/generators/cypress/files.ts +++ b/generators/cypress/files.ts @@ -19,11 +19,11 @@ import { CLIENT_TEST_SRC_DIR } from '../generator-constants.js'; import type { WriteFileSection } from '../base/api.js'; -import type CypressGenerator from './generator.js'; -import type { CypressApplication } from './types.js'; import { type Entity } from '../base-application/index.js'; import type { CommonClientServerApplication } from '../base-application/types.js'; import { clientRootTemplatesBlock } from '../client/support/index.js'; +import type { CypressApplication } from './types.js'; +import type CypressGenerator from './generator.js'; const CYPRESS_TEMPLATE_SOURCE_DIR = `${CLIENT_TEST_SRC_DIR}cypress/`; diff --git a/generators/cypress/generator.spec.ts b/generators/cypress/generator.spec.ts index 9e17568e5593..1e3eeb21c774 100644 --- a/generators/cypress/generator.spec.ts +++ b/generators/cypress/generator.spec.ts @@ -23,8 +23,8 @@ import { snakeCase } from 'lodash-es'; import { clientFrameworkTypes, testFrameworkTypes } from '../../jdl/jhipster/index.js'; import { fromMatrix, extendMatrix, AuthenticationTypeMatrix, defaultHelpers as helpers } from '../../testing/index.js'; import { shouldSupportFeatures, testBlueprintSupport, checkEnforcements } from '../../test/support/index.js'; -import Generator from './generator.js'; import { GENERATOR_CYPRESS } from '../generator-list.js'; +import Generator from './generator.js'; const { CYPRESS } = testFrameworkTypes; const { ANGULAR, REACT, VUE } = clientFrameworkTypes; diff --git a/generators/cypress/generator.ts b/generators/cypress/generator.ts index 4f4719e2a40a..88953d2ec2fc 100644 --- a/generators/cypress/generator.ts +++ b/generators/cypress/generator.ts @@ -19,11 +19,11 @@ import { stringHashCode, createFaker } from '../base/support/index.js'; import BaseApplicationGenerator from '../base-application/index.js'; -import { cypressFiles, cypressEntityFiles } from './files.js'; import { clientFrameworkTypes } from '../../jdl/jhipster/index.js'; import { CLIENT_MAIN_SRC_DIR } from '../generator-constants.js'; import { generateTestEntity as entityWithFakeValues } from '../client/support/index.js'; +import { cypressFiles, cypressEntityFiles } from './files.js'; const { ANGULAR } = clientFrameworkTypes; diff --git a/generators/docker-compose/generator.js b/generators/docker-compose/generator.js index 9a26f3d01b9d..9eee9546ed79 100644 --- a/generators/docker-compose/generator.js +++ b/generators/docker-compose/generator.js @@ -25,14 +25,14 @@ import { defaults } from 'lodash-es'; import BaseWorkspacesGenerator from '../base-workspaces/index.js'; -import { writeFiles } from './files.js'; import { deploymentOptions, monitoringTypes, serviceDiscoveryTypes } from '../../jdl/jhipster/index.js'; import { GENERATOR_BOOTSTRAP_WORKSPACES } from '../generator-list.js'; import { stringHashCode, createFaker, convertSecretToBase64, createBase64Secret } from '../base/support/index.js'; import { checkDocker } from '../base-workspaces/internal/docker-base.js'; import { loadDockerDependenciesTask } from '../base-workspaces/internal/index.js'; -import command from './command.js'; import { loadDerivedPlatformConfig, loadPlatformConfig } from '../server/support/index.js'; +import command from './command.js'; +import { writeFiles } from './files.js'; const { PROMETHEUS, NO: NO_MONITORING } = monitoringTypes; const { CONSUL, EUREKA, NO: NO_SERVICE_DISCOVERY } = serviceDiscoveryTypes; diff --git a/generators/docker-compose/generator.spec.js b/generators/docker-compose/generator.spec.js index c3c3d74464b6..b25895cf89f4 100644 --- a/generators/docker-compose/generator.spec.js +++ b/generators/docker-compose/generator.spec.js @@ -21,8 +21,8 @@ import { fileURLToPath } from 'url'; import { it, describe, expect } from 'esmocha'; import { snakeCase } from 'lodash-es'; -import Generator from './index.js'; import { shouldSupportFeatures } from '../../test/support/tests.js'; +import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); diff --git a/generators/docker/generator.js b/generators/docker/generator.js index 240e83fba9f9..08daf0989f29 100644 --- a/generators/docker/generator.js +++ b/generators/docker/generator.js @@ -20,10 +20,10 @@ import { intersection } from 'lodash-es'; import BaseApplicationGenerator from '../base-application/index.js'; import { createDockerComposeFile, createDockerExtendedServices } from '../docker/support/index.js'; -import { dockerFiles } from './files.js'; -import { SERVICE_COMPLETED_SUCCESSFULLY, SERVICE_HEALTHY } from './constants.js'; import { stringHashCode, createFaker } from '../base/support/index.js'; import { getJdbcUrl, getR2dbcUrl } from '../spring-data-relational/support/index.js'; +import { dockerFiles } from './files.js'; +import { SERVICE_COMPLETED_SUCCESSFULLY, SERVICE_HEALTHY } from './constants.js'; export default class DockerGenerator extends BaseApplicationGenerator { hasServicesFile = false; diff --git a/generators/docker/generator.spec.ts b/generators/docker/generator.spec.ts index 238f4ae79040..0912712d9768 100644 --- a/generators/docker/generator.spec.ts +++ b/generators/docker/generator.spec.ts @@ -21,7 +21,6 @@ import { fileURLToPath } from 'url'; import { before, it, describe, expect } from 'esmocha'; import { snakeCase } from 'lodash-es'; -import Generator from './index.js'; import { buildSamplesFromMatrix, extendFilteredMatrix, @@ -31,11 +30,12 @@ import { buildServerMatrix, } from '../../testing/index.js'; import { matchElasticSearchDocker } from '../spring-data-elasticsearch/__test-support/elastic-search-matcher.js'; -import { matchConsul, matchEureka } from './__test-support/service-discovery-matcher.js'; import { databaseTypes, searchEngineTypes, serviceDiscoveryTypes, cacheTypes } from '../../jdl/jhipster/index.js'; import { MESSAGE_BROKER_KAFKA, MESSAGE_BROKER_NO, MESSAGE_BROKER_PULSAR } from '../server/options/message-broker.js'; import { shouldSupportFeatures } from '../../test/support/tests.js'; +import { matchConsul, matchEureka } from './__test-support/service-discovery-matcher.js'; +import Generator from './index.js'; const { CASSANDRA, COUCHBASE, MONGODB, NEO4J, MARIADB, MSSQL, MYSQL, ORACLE, POSTGRESQL } = databaseTypes; const { NO: NO_SEARCH_ENGINE, ELASTICSEARCH } = searchEngineTypes; diff --git a/generators/entities/generator.spec.ts b/generators/entities/generator.spec.ts index eb6fc76534c5..94cb19108dad 100644 --- a/generators/entities/generator.spec.ts +++ b/generators/entities/generator.spec.ts @@ -23,8 +23,8 @@ import { snakeCase } from 'lodash-es'; import { SERVER_MAIN_RES_DIR, SERVER_MAIN_SRC_DIR, CLIENT_MAIN_SRC_DIR } from '../generator-constants.js'; import { shouldSupportFeatures, testBlueprintSupport } from '../../test/support/tests.js'; -import Generator from './generator.js'; import { skipPrettierHelpers as helpers, result as runResult } from '../../testing/index.js'; +import Generator from './generator.js'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); diff --git a/generators/entity/generator.js b/generators/entity/generator.js index 410e726e8b20..b6d7fbaee4b2 100644 --- a/generators/entity/generator.js +++ b/generators/entity/generator.js @@ -23,11 +23,11 @@ import chalk from 'chalk'; import { upperFirst } from 'lodash-es'; import BaseApplicationGenerator from '../base-application/index.js'; -import prompts from './prompts.js'; import { JHIPSTER_CONFIG_DIR } from '../generator-constants.js'; import { applicationTypes, reservedKeywords } from '../../jdl/jhipster/index.js'; import { GENERATOR_ENTITIES } from '../generator-list.js'; import { getDBTypeFromDBValue, hibernateSnakeCase } from '../server/support/index.js'; +import prompts from './prompts.js'; const { GATEWAY, MICROSERVICE } = applicationTypes; const { isReservedClassName } = reservedKeywords; diff --git a/generators/export-jdl/generator.spec.ts b/generators/export-jdl/generator.spec.ts index c3c3d74464b6..b25895cf89f4 100644 --- a/generators/export-jdl/generator.spec.ts +++ b/generators/export-jdl/generator.spec.ts @@ -21,8 +21,8 @@ import { fileURLToPath } from 'url'; import { it, describe, expect } from 'esmocha'; import { snakeCase } from 'lodash-es'; -import Generator from './index.js'; import { shouldSupportFeatures } from '../../test/support/tests.js'; +import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); diff --git a/generators/gatling/entity-files.ts b/generators/gatling/entity-files.ts index efbdd41281c7..99b916e27db2 100644 --- a/generators/gatling/entity-files.ts +++ b/generators/gatling/entity-files.ts @@ -16,8 +16,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import Generator from './generator.js'; import { TEST_DIR } from '../generator-constants.js'; +import Generator from './generator.js'; export const gatlingFiles = { gatlingFiles: [ diff --git a/generators/gatling/files.ts b/generators/gatling/files.ts index 2e03f87928fc..e9b70c5529b4 100644 --- a/generators/gatling/files.ts +++ b/generators/gatling/files.ts @@ -16,10 +16,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import Generator from './generator.js'; import { TEST_DIR, GRADLE_BUILD_SRC_MAIN_DIR } from '../generator-constants.js'; import { WriteFileSection } from '../base/api.js'; import { SpringBootApplication } from '../server/types.js'; +import Generator from './generator.js'; const gatlingFiles: WriteFileSection = { gatlingFiles: [ diff --git a/generators/gatling/generator.spec.ts b/generators/gatling/generator.spec.ts index c6f00b03d53d..3eac68382a35 100644 --- a/generators/gatling/generator.spec.ts +++ b/generators/gatling/generator.spec.ts @@ -4,10 +4,10 @@ import { before, it, describe, expect } from 'esmocha'; import { snakeCase } from 'lodash-es'; import { shouldSupportFeatures, testBlueprintSupport } from '../../test/support/tests.js'; -import Generator from './index.js'; import { defaultHelpers as helpers, result } from '../../testing/index.js'; import { GENERATOR_GATLING } from '../generator-list.js'; +import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); diff --git a/generators/generate-blueprint/generator.js b/generators/generate-blueprint/generator.js index 58fbd5f460b1..7fb81081ba0a 100644 --- a/generators/generate-blueprint/generator.js +++ b/generators/generate-blueprint/generator.js @@ -22,6 +22,11 @@ import { camelCase, upperFirst, snakeCase } from 'lodash-es'; import BaseGenerator from '../base/index.js'; import { PRIORITY_NAMES_LIST as BASE_PRIORITY_NAMES_LIST } from '../base/priorities.js'; +import * as GENERATOR_LIST from '../generator-list.js'; +import { packageJson } from '../../lib/index.js'; +import { SKIP_COMMIT_HOOK } from '../init/constants.js'; +import { BLUEPRINT_API_VERSION, NODE_VERSION } from '../generator-constants.js'; +import { files, generatorFiles } from './files.js'; import { requiredConfig, defaultConfig, @@ -42,12 +47,6 @@ import { DYNAMIC, } from './constants.js'; -import * as GENERATOR_LIST from '../generator-list.js'; -import { files, generatorFiles } from './files.js'; -import { packageJson } from '../../lib/index.js'; -import { SKIP_COMMIT_HOOK } from '../init/constants.js'; -import { BLUEPRINT_API_VERSION, NODE_VERSION } from '../generator-constants.js'; - const { GENERATOR_PROJECT_NAME, GENERATOR_INIT } = GENERATOR_LIST; const defaultPublishedFiles = ['generators', '!**/__*', '!**/*.snap', '!**/*.spec.?(c|m)js']; diff --git a/generators/gradle/generator.ts b/generators/gradle/generator.ts index 087114424aa4..3210a4de82cb 100644 --- a/generators/gradle/generator.ts +++ b/generators/gradle/generator.ts @@ -21,9 +21,10 @@ import assert from 'assert/strict'; import BaseApplicationGenerator from '../base-application/index.js'; +import { GRADLE_BUILD_SRC_DIR } from '../generator-constants.js'; +import { mutateData } from '../base/support/config.js'; import files from './files.js'; import { GRADLE } from './constants.js'; -import { GRADLE_BUILD_SRC_DIR } from '../generator-constants.js'; import cleanupOldServerFilesTask from './cleanup.js'; import { applyFromGradleCallback, @@ -40,7 +41,6 @@ import { sortDependencies, gradleNeedleOptionsWithDefaults, } from './internal/needles.js'; -import { mutateData } from '../base/support/config.js'; export default class GradleGenerator extends BaseApplicationGenerator { gradleVersionFromWrapper; diff --git a/generators/gradle/generators/code-quality/generator.spec.ts b/generators/gradle/generators/code-quality/generator.spec.ts index b7803c9df557..1a83f071acf4 100644 --- a/generators/gradle/generators/code-quality/generator.spec.ts +++ b/generators/gradle/generators/code-quality/generator.spec.ts @@ -3,8 +3,8 @@ import { fileURLToPath } from 'url'; import { before, it, describe, expect } from 'esmocha'; import { shouldSupportFeatures, testBlueprintSupport } from '../../../../test/support/tests.js'; -import Generator from './index.js'; import { defaultHelpers as helpers, result } from '../../../../testing/index.js'; +import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); diff --git a/generators/gradle/generators/jib/generator.spec.ts b/generators/gradle/generators/jib/generator.spec.ts index b7803c9df557..1a83f071acf4 100644 --- a/generators/gradle/generators/jib/generator.spec.ts +++ b/generators/gradle/generators/jib/generator.spec.ts @@ -3,8 +3,8 @@ import { fileURLToPath } from 'url'; import { before, it, describe, expect } from 'esmocha'; import { shouldSupportFeatures, testBlueprintSupport } from '../../../../test/support/tests.js'; -import Generator from './index.js'; import { defaultHelpers as helpers, result } from '../../../../testing/index.js'; +import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); diff --git a/generators/heroku/generator.js b/generators/heroku/generator.js index 5d3ff385924a..1d3921feb6eb 100644 --- a/generators/heroku/generator.js +++ b/generators/heroku/generator.js @@ -24,9 +24,9 @@ import { glob } from 'glob'; import BaseGenerator from '../base-application/index.js'; import { JAVA_COMPATIBLE_VERSIONS, JAVA_VERSION, SERVER_MAIN_RES_DIR } from '../generator-constants.js'; -import { mavenProfileContent } from './templates.js'; import { createPomStorage } from '../maven/support/pom-store.js'; import { addGradlePluginCallback, applyFromGradleCallback } from '../gradle/internal/needles.js'; +import { mavenProfileContent } from './templates.js'; export default class HerokuGenerator extends BaseGenerator { hasHerokuCli; diff --git a/generators/info/generator.spec.ts b/generators/info/generator.spec.ts index c3c3d74464b6..b25895cf89f4 100644 --- a/generators/info/generator.spec.ts +++ b/generators/info/generator.spec.ts @@ -21,8 +21,8 @@ import { fileURLToPath } from 'url'; import { it, describe, expect } from 'esmocha'; import { snakeCase } from 'lodash-es'; -import Generator from './index.js'; import { shouldSupportFeatures } from '../../test/support/tests.js'; +import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); diff --git a/generators/info/generator.ts b/generators/info/generator.ts index 05cd20c6185e..2abfa3bfa582 100644 --- a/generators/info/generator.ts +++ b/generators/info/generator.ts @@ -26,8 +26,8 @@ import JSONToJDLEntityConverter from '../../jdl/converters/json-to-jdl-entity-co import JSONToJDLOptionConverter from '../../jdl/converters/json-to-jdl-option-converter.js'; import type { JHipsterGeneratorFeatures, JHipsterGeneratorOptions } from '../base/api.js'; import { YO_RC_FILE } from '../generator-constants.js'; -import { replaceSensitiveConfig } from './support/utils.js'; import { JSONEntity } from '../../jdl/converters/types.js'; +import { replaceSensitiveConfig } from './support/utils.js'; const isInfoCommand = commandName => commandName === 'info' || undefined; diff --git a/generators/init/command.ts b/generators/init/command.ts index f028ec564306..4a8af767302b 100644 --- a/generators/init/command.ts +++ b/generators/init/command.ts @@ -16,9 +16,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { SKIP_COMMIT_HOOK, SKIP_COMMIT_HOOK_DESCRIPTION } from './constants.js'; import { JHipsterCommandDefinition } from '../base/api.js'; import { GENERATOR_PROJECT_NAME } from '../generator-list.js'; +import { SKIP_COMMIT_HOOK, SKIP_COMMIT_HOOK_DESCRIPTION } from './constants.js'; const command: JHipsterCommandDefinition = { options: { diff --git a/generators/init/generator.js b/generators/init/generator.js index a13647b55e6c..e89c743aa4dd 100644 --- a/generators/init/generator.js +++ b/generators/init/generator.js @@ -18,10 +18,10 @@ */ import BaseApplicationGenerator from '../base-application/index.js'; import { GENERATOR_INIT, GENERATOR_GIT, GENERATOR_PROJECT_NAME } from '../generator-list.js'; +import { packageJson } from '../../lib/index.js'; import { defaultConfig } from './config.js'; import { SKIP_COMMIT_HOOK } from './constants.js'; import { files, commitHooksFiles, readme } from './files.js'; -import { packageJson } from '../../lib/index.js'; /** * @class diff --git a/generators/init/generator.spec.ts b/generators/init/generator.spec.ts index 2084ac8af14b..793ed9710110 100644 --- a/generators/init/generator.spec.ts +++ b/generators/init/generator.spec.ts @@ -21,9 +21,9 @@ import { fileURLToPath } from 'url'; import { before, it, describe, expect } from 'esmocha'; import { basicTests, getCommandHelpOutput, testBlueprintSupport } from '../../test/support/tests.js'; import { defaultHelpers as helpers } from '../../testing/index.js'; -import { defaultConfig, requiredConfig } from './config.js'; import { GENERATOR_JHIPSTER } from '../generator-constants.js'; import { GENERATOR_INIT } from '../generator-list.js'; +import { defaultConfig, requiredConfig } from './config.js'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); diff --git a/generators/java/generators/domain/generator.spec.ts b/generators/java/generators/domain/generator.spec.ts index 41795f584c10..9c29cda1d6e5 100644 --- a/generators/java/generators/domain/generator.spec.ts +++ b/generators/java/generators/domain/generator.spec.ts @@ -2,9 +2,9 @@ import { basename, dirname, resolve } from 'path'; import { fileURLToPath } from 'url'; import { before, it, describe, expect } from 'esmocha'; -import Generator from './index.js'; import { shouldSupportFeatures, testBlueprintSupport } from '../../../../test/support/tests.js'; import { defaultHelpers as helpers, result } from '../../../../testing/index.js'; +import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); diff --git a/generators/java/generators/domain/generator.ts b/generators/java/generators/domain/generator.ts index 052b948348ba..8bf17a8e2403 100644 --- a/generators/java/generators/domain/generator.ts +++ b/generators/java/generators/domain/generator.ts @@ -19,9 +19,9 @@ import BaseApplicationGenerator from '../../../base-application/index.js'; import { mutateData } from '../../../base/support/index.js'; import { javaBeanCase, javaTestPackageTemplatesBlock } from '../../../server/support/index.js'; -import { entityServerFiles, enumFiles } from './entity-files.js'; import { getEnumInfo } from '../../../base-application/support/index.js'; import { isReservedJavaKeyword } from '../../support/reserved-keywords.js'; +import { entityServerFiles, enumFiles } from './entity-files.js'; export default class DomainGenerator extends BaseApplicationGenerator { generateEntities!: boolean; diff --git a/generators/java/types.d.ts b/generators/java/types.d.ts index 5c123b5d13ba..111c90012bf9 100644 --- a/generators/java/types.d.ts +++ b/generators/java/types.d.ts @@ -1,8 +1,8 @@ import { RequireOneOrNone } from 'type-fest'; import { BaseApplication } from '../base-application/types.js'; import { GradleApplication, GradleNeedleOptions } from '../gradle/types.js'; -import { JavaAnnotation } from './support/add-java-annotation.ts'; import { EditFileCallback } from '../base/api.js'; +import { JavaAnnotation } from './support/add-java-annotation.ts'; export type JavaDependencyVersion = { name: string; diff --git a/generators/jdl/generator.spec.ts b/generators/jdl/generator.spec.ts index 7a74f7f1ff30..b670f2a34b23 100644 --- a/generators/jdl/generator.spec.ts +++ b/generators/jdl/generator.spec.ts @@ -23,11 +23,11 @@ import { snakeCase } from 'lodash-es'; import { SinonSpy } from 'sinon'; import { RunResult } from 'yeoman-test'; -import Generator from './index.js'; import { getCommandHelpOutput, shouldSupportFeatures, testBlueprintSupport } from '../../test/support/tests.js'; import { defaultHelpers as helpers, result as runResult } from '../../testing/index.js'; import * as GENERATORS from '../generator-list.js'; import { GENERATOR_JDL } from '../generator-list.js'; +import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); diff --git a/generators/jdl/generator.ts b/generators/jdl/generator.ts index d59daeb2cf93..9c6a8cbb0d8e 100644 --- a/generators/jdl/generator.ts +++ b/generators/jdl/generator.ts @@ -17,12 +17,12 @@ * limitations under the License. */ import { extname } from 'path'; +import { readFile } from 'fs/promises'; import { QueuedAdapter } from '@yeoman/adapter'; import { upperFirst } from 'lodash-es'; import { create as createMemFs, type Store as MemFs } from 'mem-fs'; import { create as createMemFsEditor, type MemFsEditor } from 'mem-fs-editor'; -import { readFile } from 'fs/promises'; import BaseGenerator from '../base/index.js'; import { downloadJdlFile } from '../../cli/download.mjs'; import EnvironmentBuilder from '../../cli/environment-builder.mjs'; @@ -30,10 +30,10 @@ import { CLI_NAME } from '../../cli/utils.mjs'; import { GENERATOR_APP, GENERATOR_ENTITIES, GENERATOR_WORKSPACES } from '../generator-list.js'; import { ApplicationWithEntities, createImporterFromContent } from '../../jdl/jdl-importer.js'; import { GENERATOR_JHIPSTER, JHIPSTER_CONFIG_DIR } from '../generator-constants.js'; -import { addApplicationIndex, allNewApplications, customizeForMicroservices } from './internal/index.js'; import { mergeYoRcContent } from '../../jdl/index.js'; import { normalizeBlueprintName } from '../base/internal/blueprint.js'; import { updateApplicationEntitiesTransform } from '../base-application/support/update-application-entities-transform.js'; +import { addApplicationIndex, allNewApplications, customizeForMicroservices } from './internal/index.js'; /** * Add jdl extension to the file diff --git a/generators/kubernetes-helm/generator.js b/generators/kubernetes-helm/generator.js index fb7ec6eb3f4a..3fc4c6915b91 100644 --- a/generators/kubernetes-helm/generator.js +++ b/generators/kubernetes-helm/generator.js @@ -23,7 +23,6 @@ import chalk from 'chalk'; import BaseWorkspacesGenerator from '../base-workspaces/index.js'; import prompts from '../kubernetes/prompts.js'; -import { writeFiles } from './files.js'; import { checkImages, generateJwtSecret, configureImageNames, loadFromYoRc } from '../base-workspaces/internal/docker-base.js'; import { checkKubernetes, @@ -39,6 +38,7 @@ import { loadDeploymentConfig, loadDockerDependenciesTask } from '../base-worksp import { checkDocker } from '../docker/support/index.js'; import { loadDerivedServerConfig } from '../server/support/index.js'; import { loadDerivedAppConfig } from '../app/support/index.js'; +import { writeFiles } from './files.js'; const { KAFKA } = messageBrokerTypes; diff --git a/generators/kubernetes-helm/generator.spec.js b/generators/kubernetes-helm/generator.spec.js index c3c3d74464b6..b25895cf89f4 100644 --- a/generators/kubernetes-helm/generator.spec.js +++ b/generators/kubernetes-helm/generator.spec.js @@ -21,8 +21,8 @@ import { fileURLToPath } from 'url'; import { it, describe, expect } from 'esmocha'; import { snakeCase } from 'lodash-es'; -import Generator from './index.js'; import { shouldSupportFeatures } from '../../test/support/tests.js'; +import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); diff --git a/generators/kubernetes-knative/generator.js b/generators/kubernetes-knative/generator.js index 4b49071b222e..447344e0fd49 100644 --- a/generators/kubernetes-knative/generator.js +++ b/generators/kubernetes-knative/generator.js @@ -22,8 +22,6 @@ import chalk from 'chalk'; import BaseWorkspacesGenerator from '../base-workspaces/index.js'; -import prompts from './prompts.js'; -import { writeFiles } from './files.js'; import { checkImages, generateJwtSecret, configureImageNames, loadFromYoRc } from '../base-workspaces/internal/docker-base.js'; import { checkHelm, @@ -39,6 +37,8 @@ import { loadDeploymentConfig, loadDockerDependenciesTask } from '../base-worksp import { checkDocker } from '../docker/support/index.js'; import { loadDerivedServerConfig } from '../server/support/index.js'; import { loadDerivedAppConfig } from '../app/support/index.js'; +import { writeFiles } from './files.js'; +import prompts from './prompts.js'; const { GeneratorTypes } = kubernetesPlatformTypes; const { MAVEN } = buildToolTypes; diff --git a/generators/kubernetes-knative/generator.spec.js b/generators/kubernetes-knative/generator.spec.js index c3c3d74464b6..b25895cf89f4 100644 --- a/generators/kubernetes-knative/generator.spec.js +++ b/generators/kubernetes-knative/generator.spec.js @@ -21,8 +21,8 @@ import { fileURLToPath } from 'url'; import { it, describe, expect } from 'esmocha'; import { snakeCase } from 'lodash-es'; -import Generator from './index.js'; import { shouldSupportFeatures } from '../../test/support/tests.js'; +import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); diff --git a/generators/kubernetes/generator.js b/generators/kubernetes/generator.js index 9d298464cd4a..3bc3ebf3b494 100644 --- a/generators/kubernetes/generator.js +++ b/generators/kubernetes/generator.js @@ -22,17 +22,17 @@ import chalk from 'chalk'; import BaseWorkspacesGenerator from '../base-workspaces/index.js'; -import prompts from './prompts.js'; -import { writeFiles } from './files.js'; import { buildToolTypes, messageBrokerTypes } from '../../jdl/jhipster/index.js'; import { checkImages, generateJwtSecret, configureImageNames, loadFromYoRc } from '../base-workspaces/internal/docker-base.js'; -import { checkKubernetes, loadConfig, setupKubernetesConstants, derivedKubernetesPlatformProperties } from './kubernetes-base.js'; import { getJdbcUrl, getR2dbcUrl } from '../spring-data-relational/support/index.js'; import { loadDeploymentConfig, loadDockerDependenciesTask } from '../base-workspaces/internal/index.js'; import { checkDocker } from '../docker/support/index.js'; import { loadDerivedServerConfig } from '../server/support/index.js'; import { loadDerivedAppConfig } from '../app/support/index.js'; +import { checkKubernetes, loadConfig, setupKubernetesConstants, derivedKubernetesPlatformProperties } from './kubernetes-base.js'; +import { writeFiles } from './files.js'; +import prompts from './prompts.js'; const { KAFKA } = messageBrokerTypes; const { MAVEN } = buildToolTypes; diff --git a/generators/kubernetes/generator.spec.js b/generators/kubernetes/generator.spec.js index c3c3d74464b6..b25895cf89f4 100644 --- a/generators/kubernetes/generator.spec.js +++ b/generators/kubernetes/generator.spec.js @@ -21,8 +21,8 @@ import { fileURLToPath } from 'url'; import { it, describe, expect } from 'esmocha'; import { snakeCase } from 'lodash-es'; -import Generator from './index.js'; import { shouldSupportFeatures } from '../../test/support/tests.js'; +import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); diff --git a/generators/kubernetes/kubernetes-base.js b/generators/kubernetes/kubernetes-base.js index b04c4e95ae33..f86b7d535c7a 100644 --- a/generators/kubernetes/kubernetes-base.js +++ b/generators/kubernetes/kubernetes-base.js @@ -19,7 +19,6 @@ import crypto from 'crypto'; import { defaults } from 'lodash-es'; -import { defaultKubernetesConfig } from './kubernetes-constants.js'; import { loadFromYoRc } from '../base-workspaces/internal/docker-base.js'; import { KUBERNETES_CORE_API_VERSION, @@ -40,6 +39,7 @@ import { HELM_COUCHBASE_OPERATOR, } from '../generator-constants.js'; import { applicationTypes, kubernetesPlatformTypes } from '../../jdl/jhipster/index.js'; +import { defaultKubernetesConfig } from './kubernetes-constants.js'; const { MICROSERVICE } = applicationTypes; const { GeneratorTypes, IngressTypes, ServiceTypes } = kubernetesPlatformTypes; diff --git a/generators/kubernetes/prompts.js b/generators/kubernetes/prompts.js index 1b1267a1f3b2..703a2d85221d 100644 --- a/generators/kubernetes/prompts.js +++ b/generators/kubernetes/prompts.js @@ -17,9 +17,8 @@ * limitations under the License. */ import dockerPrompts from '../base-workspaces/internal/docker-prompts.js'; -import { defaultKubernetesConfig, ingressDefaultConfig } from './kubernetes-constants.js'; - import { applicationTypes, databaseTypes, kubernetesPlatformTypes } from '../../jdl/jhipster/index.js'; +import { defaultKubernetesConfig, ingressDefaultConfig } from './kubernetes-constants.js'; const { MONOLITH } = applicationTypes; const { IngressTypes, ServiceTypes } = kubernetesPlatformTypes; diff --git a/generators/languages/generator-needles.spec.ts b/generators/languages/generator-needles.spec.ts index 8e7650884ec0..f647f96ccb5e 100644 --- a/generators/languages/generator-needles.spec.ts +++ b/generators/languages/generator-needles.spec.ts @@ -1,8 +1,8 @@ import { before, it, describe } from 'esmocha'; import { defaultHelpers as helpers, result as runResult, getGenerator } from '../../testing/index.js'; -import LanguagesGenerator from './index.js'; import { CLIENT_MAIN_SRC_DIR } from '../generator-constants.js'; +import LanguagesGenerator from './index.js'; const generatorPath = getGenerator('languages'); diff --git a/generators/languages/generator.js b/generators/languages/generator.js index d229051ce17e..9534fd1493f8 100644 --- a/generators/languages/generator.js +++ b/generators/languages/generator.js @@ -21,11 +21,6 @@ import chalk from 'chalk'; import { padEnd, startCase } from 'lodash-es'; import BaseApplicationGenerator from '../base-application/index.js'; -import { askForLanguages, askI18n } from './prompts.js'; -import { clientI18nFiles } from './files.js'; -import { writeEntityFiles } from './entity-files.js'; -import TranslationData, { createTranslationsFileFilter, createTranslationsFilter } from './translation-data.js'; -import { findLanguageForTag, supportedLanguages } from './support/languages.js'; import { updateLanguagesTask as updateLanguagesInAngularTask } from '../angular/support/index.js'; import { updateLanguagesTask as updateLanguagesInReact } from '../react/support/index.js'; import { updateLanguagesTask as updateLanguagesInVue } from '../vue/support/index.js'; @@ -34,6 +29,11 @@ import { SERVER_MAIN_RES_DIR, SERVER_TEST_RES_DIR } from '../generator-constants import { QUEUES } from '../base-application/priorities.js'; import { PRIORITY_NAMES } from '../base/priorities.js'; import { clientFrameworkTypes } from '../../jdl/index.js'; +import { findLanguageForTag, supportedLanguages } from './support/languages.js'; +import TranslationData, { createTranslationsFileFilter, createTranslationsFilter } from './translation-data.js'; +import { writeEntityFiles } from './entity-files.js'; +import { clientI18nFiles } from './files.js'; +import { askForLanguages, askI18n } from './prompts.js'; const { NO: NO_CLIENT_FRAMEWORK, ANGULAR } = clientFrameworkTypes; /** diff --git a/generators/languages/generator.spec.js b/generators/languages/generator.spec.js index 76ccfd8ec7ea..7a87d7ddc914 100644 --- a/generators/languages/generator.spec.js +++ b/generators/languages/generator.spec.js @@ -23,8 +23,8 @@ import { snakeCase } from 'lodash-es'; import { defaultHelpers as helpers, result as runResult } from '../../testing/index.js'; import { shouldSupportFeatures, testBlueprintSupport } from '../../test/support/tests.js'; -import Generator from './index.js'; import { GENERATOR_LANGUAGES } from '../generator-list.js'; +import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); diff --git a/generators/liquibase/files.ts b/generators/liquibase/files.ts index a61b7047cedb..814594e158b2 100644 --- a/generators/liquibase/files.ts +++ b/generators/liquibase/files.ts @@ -17,10 +17,10 @@ * limitations under the License. */ import type { WriteFileSection } from '../base/api.js'; -import type LiquibaseGenerator from './generator.js'; import { SERVER_MAIN_RES_DIR, SERVER_MAIN_SRC_DIR } from '../generator-constants.js'; import { moveToJavaPackageSrcDir } from '../server/support/index.js'; import { CommonClientServerApplication } from '../base-application/types.js'; +import type LiquibaseGenerator from './generator.js'; // eslint-disable-next-line import/prefer-default-export export const liquibaseFiles: WriteFileSection = { diff --git a/generators/liquibase/generator.ts b/generators/liquibase/generator.ts index d1557a2b9798..b15131f7d914 100644 --- a/generators/liquibase/generator.ts +++ b/generators/liquibase/generator.ts @@ -20,13 +20,6 @@ import fs from 'fs'; import { escape, min } from 'lodash-es'; import BaseEntityChangesGenerator from '../base-entity-changes/index.js'; -import { liquibaseFiles } from './files.js'; -import { - prepareField as prepareFieldForLiquibase, - postPrepareEntity, - prepareRelationshipForLiquibase, - liquibaseComment, -} from './support/index.js'; import { getFKConstraintName, getUXConstraintName, prepareEntity as prepareEntityForServer } from '../server/support/index.js'; import { prepareEntityPrimaryKeyForTemplates, @@ -35,16 +28,23 @@ import { prepareEntity, loadRequiredConfigIntoEntity, } from '../base-application/support/index.js'; +import { prepareSqlApplicationProperties } from '../spring-data-relational/support/index.js'; +import { fieldTypes } from '../../jdl/jhipster/index.js'; +import type { MavenProperty } from '../maven/types.js'; +import { liquibaseFiles } from './files.js'; +import { + prepareField as prepareFieldForLiquibase, + postPrepareEntity, + prepareRelationshipForLiquibase, + liquibaseComment, +} from './support/index.js'; import mavenPlugin from './support/maven-plugin.js'; import { addLiquibaseChangelogCallback, addLiquibaseConstraintsChangelogCallback, addLiquibaseIncrementalChangelogCallback, } from './internal/needles.js'; -import { prepareSqlApplicationProperties } from '../spring-data-relational/support/index.js'; import { addEntityFiles, updateEntityFiles, updateConstraintsFiles, updateMigrateFiles, fakeFiles } from './changelog-files.js'; -import { fieldTypes } from '../../jdl/jhipster/index.js'; -import type { MavenProperty } from '../maven/types.js'; const { CommonDBTypes: { LONG: TYPE_LONG, INTEGER: TYPE_INTEGER }, diff --git a/generators/maven/generator.ts b/generators/maven/generator.ts index bbcca920371d..bd28f7c78293 100644 --- a/generators/maven/generator.ts +++ b/generators/maven/generator.ts @@ -21,10 +21,10 @@ import assert from 'assert/strict'; import BaseApplicationGenerator from '../base-application/index.js'; +import { type GeneratorDefinition as SpringBootGeneratorDefinition } from '../server/index.js'; import files from './files.js'; import { MAVEN } from './constants.js'; import cleanupOldServerFilesTask from './cleanup.js'; -import { type GeneratorDefinition as SpringBootGeneratorDefinition } from '../server/index.js'; import { createPomStorage, type PomStorage } from './support/index.js'; export default class MavenGenerator extends BaseApplicationGenerator { diff --git a/generators/project-name/command.ts b/generators/project-name/command.ts index 6d2f53ef5202..e8d1ea371518 100644 --- a/generators/project-name/command.ts +++ b/generators/project-name/command.ts @@ -16,8 +16,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { BASE_NAME, BASE_NAME_DESCRIPTION } from './constants.js'; import { JHipsterCommandDefinition } from '../base/api.js'; +import { BASE_NAME, BASE_NAME_DESCRIPTION } from './constants.js'; const command: JHipsterCommandDefinition = { options: { diff --git a/generators/project-name/generator.js b/generators/project-name/generator.js index c316c3fc9ff0..18bfbf7a1f64 100644 --- a/generators/project-name/generator.js +++ b/generators/project-name/generator.js @@ -19,11 +19,11 @@ /* eslint-disable consistent-return */ import { defaults, kebabCase, upperFirst, camelCase, startCase } from 'lodash-es'; -import { getDefaultAppName } from './support/index.js'; import BaseApplicationGenerator from '../base-application/index.js'; +import { getHipster } from '../base/support/index.js'; +import { getDefaultAppName } from './support/index.js'; import { BASE_NAME } from './constants.js'; -import { getHipster } from '../base/support/index.js'; import { validateProjectName } from './support/name-resolver.js'; /** diff --git a/generators/react/generator.js b/generators/react/generator.js index da5d02d070b7..23bd56980e08 100644 --- a/generators/react/generator.js +++ b/generators/react/generator.js @@ -22,10 +22,6 @@ import { camelCase, startCase } from 'lodash-es'; import BaseApplicationGenerator from '../base-application/index.js'; import { GENERATOR_CLIENT, GENERATOR_LANGUAGES, GENERATOR_REACT } from '../generator-list.js'; -import { writeEntitiesFiles, postWriteEntitiesFiles, cleanupEntitiesFiles } from './entity-files-react.js'; -import cleanupOldFilesTask from './cleanup.js'; -import { writeFiles } from './files-react.js'; -import { prepareEntity } from './application/entities/index.js'; import { fieldTypes, clientFrameworkTypes } from '../../jdl/jhipster/index.js'; import { generateEntityClientEnumImports as getClientEnumImportsFormat, @@ -34,8 +30,12 @@ import { generateTestEntityId as getTestEntityId, generateTestEntityPrimaryKey as getTestEntityPrimaryKey, } from '../client/support/index.js'; -import { isTranslatedReactFile, translateReactFilesTransform } from './support/index.js'; import { createNeedleCallback, upperFirstCamelCase } from '../base/support/index.js'; +import { writeEntitiesFiles, postWriteEntitiesFiles, cleanupEntitiesFiles } from './entity-files-react.js'; +import cleanupOldFilesTask from './cleanup.js'; +import { writeFiles } from './files-react.js'; +import { prepareEntity } from './application/entities/index.js'; +import { isTranslatedReactFile, translateReactFilesTransform } from './support/index.js'; const { CommonDBTypes } = fieldTypes; const TYPE_BOOLEAN = CommonDBTypes.BOOLEAN; diff --git a/generators/react/generator.spec.ts b/generators/react/generator.spec.ts index 37332e03fe4f..b8f58766fc11 100644 --- a/generators/react/generator.spec.ts +++ b/generators/react/generator.spec.ts @@ -5,12 +5,12 @@ 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'; -import Generator from './index.js'; import { clientFrameworkTypes } from '../../jdl/jhipster/index.js'; import { CLIENT_MAIN_SRC_DIR } from '../generator-constants.js'; import BaseApplicationGenerator from '../base-application/index.js'; import { GENERATOR_REACT } from '../generator-list.js'; +import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); diff --git a/generators/server/generator.js b/generators/server/generator.js index 2710ef632781..7b25a2687d0a 100644 --- a/generators/server/generator.js +++ b/generators/server/generator.js @@ -22,16 +22,6 @@ import { existsSync } from 'fs'; import chalk from 'chalk'; -import { - buildJavaGet as javaGetCall, - javaBeanCase as javaBeanClassNameFormat, - buildJavaGetter as javaGetter, - buildJavaSetter as javaSetter, - getJavaValueGeneratorForType as getJavaValueForType, - getPrimaryKeyValue as getPKValue, - hibernateSnakeCase, -} from './support/index.js'; - import { GENERATOR_COMMON, GENERATOR_SPRING_BOOT } from '../generator-list.js'; import BaseApplicationGenerator from '../base-application/index.js'; import { packageJson } from '../../lib/index.js'; @@ -65,6 +55,15 @@ import { createNeedleCallback, mutateData } from '../base/support/index.js'; import { isReservedPaginationWords } from '../../jdl/jhipster/reserved-keywords.js'; import { loadStoredAppOptions } from '../app/support/index.js'; import { isReservedH2Keyword } from '../spring-data-relational/support/h2-reserved-keywords.js'; +import { + buildJavaGet as javaGetCall, + javaBeanCase as javaBeanClassNameFormat, + buildJavaGetter as javaGetter, + buildJavaSetter as javaSetter, + getJavaValueGeneratorForType as getJavaValueForType, + getPrimaryKeyValue as getPKValue, + hibernateSnakeCase, +} from './support/index.js'; const dbTypes = fieldTypes; const { diff --git a/generators/server/generator.spec.js b/generators/server/generator.spec.js index 9ec179aa9ce3..fc29e3417037 100644 --- a/generators/server/generator.spec.js +++ b/generators/server/generator.spec.js @@ -23,9 +23,9 @@ import { snakeCase } from 'lodash-es'; import { shouldSupportFeatures, testBlueprintSupport, checkEnforcements } from '../../test/support/index.js'; import { defaultHelpers as helpers, result as runResult } from '../../testing/index.js'; -import Generator from './index.js'; -import { mockedGenerators, shouldComposeWithCouchbase, shouldComposeWithSpringCloudStream } from './__test-support/index.js'; import { GENERATOR_SERVER, GENERATOR_SPRING_BOOT } from '../generator-list.js'; +import { mockedGenerators, shouldComposeWithCouchbase, shouldComposeWithSpringCloudStream } from './__test-support/index.js'; +import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); diff --git a/generators/server/options/database-migration.spec.ts b/generators/server/options/database-migration.spec.ts index 15e85a9bf949..2f40b0933b7d 100644 --- a/generators/server/options/database-migration.spec.ts +++ b/generators/server/options/database-migration.spec.ts @@ -1,7 +1,7 @@ import { before, it, describe, expect } from 'esmocha'; import { createImporterFromContent, ImportState } from '../../../jdl/jdl-importer.js'; -import { DATABASE_MIGRATION as optionName } from './index.js'; import optionDefinition from './database-migration.js'; +import { DATABASE_MIGRATION as optionName } from './index.js'; describe(`generators - server - jdl - ${optionName}`, () => { optionDefinition.knownChoices!.forEach(optionValue => { diff --git a/generators/server/options/message-broker.spec.ts b/generators/server/options/message-broker.spec.ts index cab5f7370573..d8ed76c310a9 100644 --- a/generators/server/options/message-broker.spec.ts +++ b/generators/server/options/message-broker.spec.ts @@ -1,7 +1,7 @@ import { before, it, describe, expect } from 'esmocha'; import { createImporterFromContent, ImportState } from '../../../jdl/jdl-importer.js'; -import { MESSAGE_BROKER } from './index.js'; import optionDefinition from './message-broker.js'; +import { MESSAGE_BROKER } from './index.js'; describe('generators - server - jdl - messageBroker', () => { optionDefinition.knownChoices!.forEach(optionValue => { diff --git a/generators/server/support/database.ts b/generators/server/support/database.ts index 39ef8cce4448..8fae360bd3c3 100644 --- a/generators/server/support/database.ts +++ b/generators/server/support/database.ts @@ -19,9 +19,9 @@ import crypto from 'crypto'; import { databaseTypes, fieldTypes } from '../../../jdl/jhipster/index.js'; -import { hibernateSnakeCase } from './string.js'; import { databaseData } from '../../spring-data-relational/support/index.js'; import { ValidationResult } from '../../base/api.js'; +import { hibernateSnakeCase } from './string.js'; const dbTypes = fieldTypes; const { STRING: TYPE_STRING, LONG: TYPE_LONG, UUID: TYPE_UUID } = dbTypes.CommonDBTypes; diff --git a/generators/server/support/needles.spec.ts b/generators/server/support/needles.spec.ts index 26c97347e8ad..91c391222fab 100644 --- a/generators/server/support/needles.spec.ts +++ b/generators/server/support/needles.spec.ts @@ -19,8 +19,8 @@ import { before, it, describe, expect } from 'esmocha'; import { defaultHelpers as helpers, runResult } from '../../../testing/index.js'; import { GENERATOR_SPRING_BOOT } from '../../generator-list.js'; -import { insertContentIntoApplicationProperties } from './needles.js'; import type { SpringBootApplication } from '../types.js'; +import { insertContentIntoApplicationProperties } from './needles.js'; describe('generator - server - support - needles', () => { describe('generated project', () => { diff --git a/generators/server/support/prepare-entity.js b/generators/server/support/prepare-entity.js index b3feac1b8fef..82b22189f868 100644 --- a/generators/server/support/prepare-entity.js +++ b/generators/server/support/prepare-entity.js @@ -22,9 +22,9 @@ import { databaseTypes, searchEngineTypes } from '../../../jdl/jhipster/index.js import { isReservedTableName } from '../../../jdl/jhipster/reserved-keywords.js'; import { mutateData, normalizePathEnd } from '../../base/support/index.js'; +import { formatDocAsApiDescription, formatDocAsJavaDoc } from '../../java/support/doc.js'; import { hibernateSnakeCase } from './string.js'; import { getDatabaseTypeData } from './database.js'; -import { formatDocAsApiDescription, formatDocAsJavaDoc } from '../../java/support/doc.js'; const { NO: NO_SEARCH_ENGINE, ELASTICSEARCH } = searchEngineTypes; const { POSTGRESQL, MYSQL, MARIADB, COUCHBASE, SQL, NEO4J } = databaseTypes; diff --git a/generators/server/support/prepare-field.js b/generators/server/support/prepare-field.js index 1380d9b16d37..acdff7938be3 100644 --- a/generators/server/support/prepare-field.js +++ b/generators/server/support/prepare-field.js @@ -20,10 +20,10 @@ import assert from 'assert'; import { snakeCase, upperFirst } from 'lodash-es'; import { databaseTypes, entityOptions, fieldTypes, reservedKeywords } from '../../../jdl/jhipster/index.js'; -import { getUXConstraintName } from './database.js'; -import { getJavaValueGeneratorForType } from './templates/field-values.js'; import { formatDocAsApiDescription, formatDocAsJavaDoc } from '../../java/support/doc.js'; import { mutateData } from '../../base/support/config.js'; +import { getUXConstraintName } from './database.js'; +import { getJavaValueGeneratorForType } from './templates/field-values.js'; const { isReservedTableName } = reservedKeywords; const { CommonDBTypes } = fieldTypes; diff --git a/generators/server/types.d.ts b/generators/server/types.d.ts index cff96b83df0b..f930b7d8e130 100644 --- a/generators/server/types.d.ts +++ b/generators/server/types.d.ts @@ -3,11 +3,11 @@ import { GradleSourceType } from '../gradle/types.js'; import { MavenSourceType } from '../maven/types.js'; import { LiquibaseSourceType } from '../liquibase/types.js'; import { SpringCacheSourceType } from '../spring-cache/types.js'; -import { MessageBrokerApplicationType } from './options/message-broker.js'; import type { DeterministicOptionWithDerivedProperties, OptionWithDerivedProperties } from '../base-application/application-options.js'; -import { ApplicationPropertiesNeedles } from './support/needles.ts'; import { GatewayApplication } from '../spring-cloud/generators/gateway/types.ts'; import { JavaAnnotation } from '../java/support/add-java-annotation.ts'; +import { ApplicationPropertiesNeedles } from './support/needles.ts'; +import { MessageBrokerApplicationType } from './options/message-broker.js'; export type SpringEntity = { /* Generate entity's Entity */ diff --git a/generators/spring-boot/cleanup.ts b/generators/spring-boot/cleanup.ts index af2413b26120..4e48ef58794e 100644 --- a/generators/spring-boot/cleanup.ts +++ b/generators/spring-boot/cleanup.ts @@ -16,10 +16,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import cleanupOauth2 from './cleanup-oauth2.js'; import { JAVA_DOCKER_DIR } from '../generator-constants.js'; import { asWritingTask } from '../base-application/support/task-type-inference.js'; +import cleanupOauth2 from './cleanup-oauth2.js'; /** * Removes server files that where generated in previous JHipster versions and therefore diff --git a/generators/spring-boot/entity-files.js b/generators/spring-boot/entity-files.js index e441b22aa43c..a0e3c628fb82 100644 --- a/generators/spring-boot/entity-files.js +++ b/generators/spring-boot/entity-files.js @@ -19,10 +19,10 @@ import fs from 'fs'; import * as _ from 'lodash-es'; import chalk from 'chalk'; -import { cleanupOldFiles } from './entity-cleanup.js'; import { moveToJavaPackageSrcDir, javaMainPackageTemplatesBlock, javaTestPackageTemplatesBlock } from '../java/support/index.js'; import { SERVER_TEST_SRC_DIR } from '../generator-constants.js'; import { databaseTypes, entityOptions } from '../../jdl/jhipster/index.js'; +import { cleanupOldFiles } from './entity-cleanup.js'; const { COUCHBASE, MONGODB, NEO4J, SQL } = databaseTypes; const { MapperTypes } = entityOptions; diff --git a/generators/spring-boot/generator.ts b/generators/spring-boot/generator.ts index cf43013b7e55..216ec72db1e9 100644 --- a/generators/spring-boot/generator.ts +++ b/generators/spring-boot/generator.ts @@ -37,8 +37,6 @@ import { GENERATOR_SPRING_DATA_RELATIONAL, GENERATOR_SPRING_WEBSOCKET, } from '../generator-list.js'; -import { serverFiles } from './files.js'; -import cleanupTask from './cleanup.js'; import { ADD_SPRING_MILESTONE_REPOSITORY } from '../generator-constants.js'; import { addSpringFactory, @@ -61,8 +59,10 @@ import { testFrameworkTypes, websocketTypes, } from '../../jdl/index.js'; -import { writeFiles as writeEntityFiles } from './entity-files.js'; import { getPomVersionProperties, parseMavenPom } from '../maven/support/index.js'; +import { writeFiles as writeEntityFiles } from './entity-files.js'; +import cleanupTask from './cleanup.js'; +import { serverFiles } from './files.js'; import { askForOptionalItems, askForServerSideOpts, askForServerTestOpts } from './prompts.js'; const { CAFFEINE, EHCACHE, HAZELCAST, INFINISPAN, MEMCACHED, REDIS, NO: NO_CACHE } = cacheTypes; diff --git a/generators/spring-cache/files.ts b/generators/spring-cache/files.ts index 628998c9977b..a0ae79046d9f 100644 --- a/generators/spring-cache/files.ts +++ b/generators/spring-cache/files.ts @@ -16,10 +16,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import Generator from './generator.js'; import { moveToJavaPackageSrcDir, moveToJavaPackageTestDir } from '../java/support/index.js'; import { SERVER_MAIN_SRC_DIR, SERVER_TEST_SRC_DIR, GRADLE_BUILD_SRC_MAIN_DIR } from '../generator-constants.js'; import { WriteFileSection } from '../base/api.js'; +import Generator from './generator.js'; const files: WriteFileSection = { cacheFiles: [ diff --git a/generators/spring-cache/generator.spec.ts b/generators/spring-cache/generator.spec.ts index 68dcb1edfa35..acf2a8370f38 100644 --- a/generators/spring-cache/generator.spec.ts +++ b/generators/spring-cache/generator.spec.ts @@ -5,10 +5,10 @@ import { snakeCase } from 'lodash-es'; import { fromMatrix, defaultHelpers as helpers, result } from '../../testing/index.js'; import { shouldSupportFeatures, testBlueprintSupport } from '../../test/support/tests.js'; -import Generator from './index.js'; import { GENERATOR_SPRING_CACHE } from '../generator-list.js'; import { cacheTypes, buildToolTypes } from '../../jdl/jhipster/index.js'; +import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); diff --git a/generators/spring-cache/generator.ts b/generators/spring-cache/generator.ts index 06400a190f88..bd6a8a48e9b5 100644 --- a/generators/spring-cache/generator.ts +++ b/generators/spring-cache/generator.ts @@ -17,11 +17,11 @@ * limitations under the License. */ import BaseApplicationGenerator from '../base-application/index.js'; +import { createNeedleCallback } from '../base/support/needles.js'; +import { JavaDependency, JavaDependencyVersion } from '../java/types.js'; import writeTask from './files.js'; import cleanupTask from './cleanup.js'; -import { createNeedleCallback } from '../base/support/needles.js'; import { getCacheProviderMavenDefinition } from './internal/dependencies.js'; -import { JavaDependency, JavaDependencyVersion } from '../java/types.js'; export default class SpringCacheGenerator extends BaseApplicationGenerator { async beforeQueue() { diff --git a/generators/spring-cloud-stream/generator-pulsar.spec.ts b/generators/spring-cloud-stream/generator-pulsar.spec.ts index 032fe8790dbe..2e7fbba64019 100644 --- a/generators/spring-cloud-stream/generator-pulsar.spec.ts +++ b/generators/spring-cloud-stream/generator-pulsar.spec.ts @@ -23,9 +23,8 @@ import { snakeCase } from 'lodash-es'; import { shouldSupportFeatures, testBlueprintSupport } from '../../test/support/tests.js'; import { buildSamplesFromMatrix, buildServerMatrix, defaultHelpers as helpers } from '../../testing/index.js'; -import Generator from './index.js'; - import { messageBrokerTypes } from '../../jdl/jhipster/index.js'; +import Generator from './index.js'; const { PULSAR } = messageBrokerTypes; diff --git a/generators/spring-cloud-stream/generator.spec.ts b/generators/spring-cloud-stream/generator.spec.ts index 8ffb8d68ae9b..0a469fb493bd 100644 --- a/generators/spring-cloud-stream/generator.spec.ts +++ b/generators/spring-cloud-stream/generator.spec.ts @@ -23,9 +23,8 @@ import { snakeCase } from 'lodash-es'; import { shouldSupportFeatures, testBlueprintSupport } from '../../test/support/tests.js'; import { buildSamplesFromMatrix, buildServerMatrix, defaultHelpers as helpers } from '../../testing/index.js'; -import Generator from './index.js'; - import { messageBrokerTypes } from '../../jdl/jhipster/index.js'; +import Generator from './index.js'; const { KAFKA } = messageBrokerTypes; diff --git a/generators/spring-data-cassandra/generator.js b/generators/spring-data-cassandra/generator.js index 75e844d7f4c9..e507923234d9 100644 --- a/generators/spring-data-cassandra/generator.js +++ b/generators/spring-data-cassandra/generator.js @@ -18,10 +18,10 @@ */ import BaseApplicationGenerator from '../base-application/index.js'; +import { PaginationTypes } from '../../jdl/jhipster/entity-options.js'; import writeCassandraFilesTask from './files.js'; import cleanupCassandraFilesTask from './cleanup.js'; import writeCassandraEntityFilesTask, { cleanupCassandraEntityFilesTask } from './entity-files.js'; -import { PaginationTypes } from '../../jdl/jhipster/entity-options.js'; const { NO: NO_PAGINATION } = PaginationTypes; diff --git a/generators/spring-data-couchbase/generator.spec.ts b/generators/spring-data-couchbase/generator.spec.ts index 40ec9e1baaf3..d4527e441ae5 100644 --- a/generators/spring-data-couchbase/generator.spec.ts +++ b/generators/spring-data-couchbase/generator.spec.ts @@ -30,7 +30,6 @@ import { runResult, } from '../../testing/index.js'; import { shouldSupportFeatures, testBlueprintSupport } from '../../test/support/tests.js'; -import Generator from './generator.js'; import { databaseTypes } from '../../jdl/jhipster/index.js'; import { @@ -39,6 +38,7 @@ import { shouldComposeWithLiquibase, } from '../server/__test-support/index.js'; import { GENERATOR_SPRING_DATA_COUCHBASE } from '../generator-list.js'; +import Generator from './generator.js'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); diff --git a/generators/spring-data-elasticsearch/generator.js b/generators/spring-data-elasticsearch/generator.js index 59d2784c6e17..6cc09667c841 100644 --- a/generators/spring-data-elasticsearch/generator.js +++ b/generators/spring-data-elasticsearch/generator.js @@ -18,10 +18,10 @@ */ import BaseApplicationGenerator from '../base-application/index.js'; +import { mutateData } from '../base/support/index.js'; import writeElasticsearchFilesTask from './files.js'; import cleanupElasticsearchFilesTask from './cleanup.js'; import writeElasticsearchEntityFilesTask, { cleanupElasticsearchEntityFilesTask } from './entity-files.js'; -import { mutateData } from '../base/support/index.js'; export default class ElasticsearchGenerator extends BaseApplicationGenerator { async beforeQueue() { diff --git a/generators/spring-data-elasticsearch/generator.spec.ts b/generators/spring-data-elasticsearch/generator.spec.ts index f62d64795fed..216ee8356d5d 100644 --- a/generators/spring-data-elasticsearch/generator.spec.ts +++ b/generators/spring-data-elasticsearch/generator.spec.ts @@ -30,11 +30,10 @@ import { runResult, } from '../../testing/index.js'; import { shouldSupportFeatures, testBlueprintSupport } from '../../test/support/tests.js'; -import Generator from './generator.js'; -import { matchElasticSearch, matchElasticSearchUser } from './__test-support/elastic-search-matcher.js'; - import { databaseTypes, searchEngineTypes, authenticationTypes, applicationTypes } from '../../jdl/jhipster/index.js'; import { mockedGenerators, shouldComposeWithSpringCloudStream } from '../server/__test-support/index.js'; +import Generator from './generator.js'; +import { matchElasticSearch, matchElasticSearchUser } from './__test-support/elastic-search-matcher.js'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); diff --git a/generators/spring-data-neo4j/entity-files.ts b/generators/spring-data-neo4j/entity-files.ts index cfd2ead2956c..8cbed6591ecc 100644 --- a/generators/spring-data-neo4j/entity-files.ts +++ b/generators/spring-data-neo4j/entity-files.ts @@ -16,8 +16,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import Generator from './generator.js'; import { javaMainPackageTemplatesBlock } from '../server/support/index.js'; +import Generator from './generator.js'; const domainFiles = [ { diff --git a/generators/spring-data-relational/generator.ts b/generators/spring-data-relational/generator.ts index e36bd0f57c4b..c9cd609d9b43 100644 --- a/generators/spring-data-relational/generator.ts +++ b/generators/spring-data-relational/generator.ts @@ -19,12 +19,12 @@ import BaseApplicationGenerator from '../base-application/index.js'; import { GENERATOR_LIQUIBASE } from '../generator-list.js'; -import writeTask from './files.js'; -import cleanupTask from './cleanup.js'; -import writeEntitiesTask, { cleanupEntitiesTask } from './entity-files.js'; import { isReservedTableName } from '../../jdl/jhipster/reserved-keywords.js'; import { databaseTypes } from '../../jdl/jhipster/index.js'; import { GeneratorDefinition as SpringBootGeneratorDefinition } from '../server/index.js'; +import writeTask from './files.js'; +import cleanupTask from './cleanup.js'; +import writeEntitiesTask, { cleanupEntitiesTask } from './entity-files.js'; import { getDBCExtraOption, getJdbcUrl, getR2dbcUrl } from './support/index.js'; import { getDatabaseDriverForDatabase, getDatabaseTypeMavenDefinition, getH2MavenDefinition } from './internal/dependencies.js'; diff --git a/generators/spring-data-relational/support/application-properties.ts b/generators/spring-data-relational/support/application-properties.ts index 456d9eae4306..232c4ad10b07 100644 --- a/generators/spring-data-relational/support/application-properties.ts +++ b/generators/spring-data-relational/support/application-properties.ts @@ -17,9 +17,9 @@ * limitations under the License. */ +import { databaseTypes } from '../../../jdl/jhipster/index.js'; import { getDatabaseData } from './database-data.js'; import { getJdbcUrl, getR2dbcUrl } from './database-url.js'; -import { databaseTypes } from '../../../jdl/jhipster/index.js'; const { ORACLE, MYSQL, POSTGRESQL, MARIADB, MSSQL, H2_MEMORY, H2_DISK } = databaseTypes; diff --git a/generators/spring-websocket/files.ts b/generators/spring-websocket/files.ts index 9b271d0a84ef..046cd3c30f60 100644 --- a/generators/spring-websocket/files.ts +++ b/generators/spring-websocket/files.ts @@ -16,11 +16,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import Generator from './generator.js'; import { moveToJavaPackageSrcDir } from '../server/support/index.js'; import { SERVER_MAIN_SRC_DIR } from '../generator-constants.js'; import { WriteFileSection } from '../base/api.js'; import { SpringBootApplication } from '../server/types.js'; +import Generator from './generator.js'; const files: WriteFileSection = { websocketFiles: [ diff --git a/generators/spring-websocket/generator.spec.ts b/generators/spring-websocket/generator.spec.ts index 1051175bcc60..25f9e2cc0a48 100644 --- a/generators/spring-websocket/generator.spec.ts +++ b/generators/spring-websocket/generator.spec.ts @@ -4,10 +4,10 @@ import { before, it, describe, expect } from 'esmocha'; import { snakeCase } from 'lodash-es'; import { shouldSupportFeatures, testBlueprintSupport } from '../../test/support/tests.js'; -import Generator from './index.js'; import { defaultHelpers as helpers, result } from '../../testing/index.js'; import { GENERATOR_SPRING_WEBSOCKET } from '../generator-list.js'; +import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); diff --git a/generators/upgrade/generator.js b/generators/upgrade/generator.js index 03797dac1d8d..18231bd95c35 100644 --- a/generators/upgrade/generator.js +++ b/generators/upgrade/generator.js @@ -26,8 +26,8 @@ import { ResetMode } from 'simple-git'; import BaseGenerator from '../base/index.js'; import { packageJson } from '../../lib/index.js'; import EnvironmentBuilder from '../../cli/environment-builder.mjs'; -import { GIT_VERSION_NOT_ALLOW_MERGE_UNRELATED_HISTORIES, UPGRADE_BRANCH } from './support/index.js'; import { SERVER_MAIN_RES_DIR } from '../generator-constants.js'; +import { GIT_VERSION_NOT_ALLOW_MERGE_UNRELATED_HISTORIES, UPGRADE_BRANCH } from './support/index.js'; /* Constants used throughout */ const GENERATOR_JHIPSTER = 'generator-jhipster'; diff --git a/generators/upgrade/generator.spec.js b/generators/upgrade/generator.spec.js index bc0f5b6a7ece..512092a9d8cd 100644 --- a/generators/upgrade/generator.spec.js +++ b/generators/upgrade/generator.spec.js @@ -22,10 +22,10 @@ import { it, describe, expect, before, fn } from 'esmocha'; import { snakeCase } from 'lodash-es'; import git from 'simple-git'; -import Generator from './index.js'; import { shouldSupportFeatures } from '../../test/support/tests.js'; import { basicHelpers as helpers, result } from '../../testing/index.js'; import { UPGRADE_BRANCH } from './support/index.js'; +import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); diff --git a/generators/vue/generator.js b/generators/vue/generator.js index c5079dbbbf9d..d2e78e361225 100644 --- a/generators/vue/generator.js +++ b/generators/vue/generator.js @@ -24,9 +24,6 @@ import { camelCase, startCase } from 'lodash-es'; import BaseApplicationGenerator from '../base-application/index.js'; import { fieldTypes, clientFrameworkTypes } from '../../jdl/jhipster/index.js'; import { GENERATOR_VUE, GENERATOR_CLIENT, GENERATOR_LANGUAGES } from '../generator-list.js'; -import { writeEntityFiles, postWriteEntityFiles, cleanupEntitiesFiles } from './entity-files-vue.js'; -import cleanupOldFilesTask from './cleanup.js'; -import { writeFiles, writeEntitiesFiles } from './files-vue.js'; import { generateEntityClientEnumImports as getClientEnumImportsFormat, generateEntityClientFields as getHydratedEntityClientFields, @@ -34,8 +31,11 @@ import { generateTestEntityId as getTestEntityId, getTypescriptKeyType as getTSKeyType, } from '../client/support/index.js'; -import { convertTranslationsSupport, isTranslatedVueFile, translateVueFilesTransform } from './support/index.js'; import { createNeedleCallback } from '../base/support/index.js'; +import { writeEntityFiles, postWriteEntityFiles, cleanupEntitiesFiles } from './entity-files-vue.js'; +import cleanupOldFilesTask from './cleanup.js'; +import { writeFiles, writeEntitiesFiles } from './files-vue.js'; +import { convertTranslationsSupport, isTranslatedVueFile, translateVueFilesTransform } from './support/index.js'; const { CommonDBTypes } = fieldTypes; const { VUE } = clientFrameworkTypes; diff --git a/generators/vue/generator.spec.ts b/generators/vue/generator.spec.ts index a647d6317011..d13bc71eb013 100644 --- a/generators/vue/generator.spec.ts +++ b/generators/vue/generator.spec.ts @@ -5,11 +5,11 @@ 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'; -import Generator from './index.js'; import { clientFrameworkTypes } from '../../jdl/jhipster/index.js'; import { CLIENT_MAIN_SRC_DIR } from '../generator-constants.js'; import { GENERATOR_VUE } from '../generator-list.js'; +import Generator from './index.js'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); diff --git a/jdl/converters/jdl-to-json/jdl-to-json-option-converter.spec.ts b/jdl/converters/jdl-to-json/jdl-to-json-option-converter.spec.ts index 2d6685b1126f..c51e44413104 100644 --- a/jdl/converters/jdl-to-json/jdl-to-json-option-converter.spec.ts +++ b/jdl/converters/jdl-to-json/jdl-to-json-option-converter.spec.ts @@ -29,8 +29,8 @@ import { JDLEntity } from '../../models/index.js'; import JDLUnaryOption from '../../models/jdl-unary-option.js'; import JDLBinaryOption from '../../models/jdl-binary-option.js'; import { unaryOptions, binaryOptions } from '../../jhipster/index.js'; -import { convert } from './jdl-to-json-option-converter.js'; import logger from '../../utils/objects/logger.js'; +import { convert } from './jdl-to-json-option-converter.js'; describe('jdl - JDLToJSONOptionConverter', () => { describe('convert', () => { diff --git a/jdl/converters/jdl-to-json/jdl-to-json-relationship-converter.spec.ts b/jdl/converters/jdl-to-json/jdl-to-json-relationship-converter.spec.ts index 90635a7b0bd2..03c93a8a34de 100644 --- a/jdl/converters/jdl-to-json/jdl-to-json-relationship-converter.spec.ts +++ b/jdl/converters/jdl-to-json/jdl-to-json-relationship-converter.spec.ts @@ -21,8 +21,8 @@ import { before, it, describe, expect as jestExpect } from 'esmocha'; import { expect } from 'chai'; import JDLRelationship from '../../models/jdl-relationship.js'; -import { convert } from './jdl-to-json-relationship-converter.js'; import { relationshipTypes, relationshipOptions } from '../../jhipster/index.js'; +import { convert } from './jdl-to-json-relationship-converter.js'; const { ONE_TO_ONE, MANY_TO_MANY, MANY_TO_ONE, ONE_TO_MANY } = relationshipTypes; const { BUILT_IN_ENTITY } = relationshipOptions; diff --git a/jdl/converters/jdl-to-json/jdl-with-applications-to-json-converter.ts b/jdl/converters/jdl-to-json/jdl-with-applications-to-json-converter.ts index e7281f99b56b..b1b722956730 100644 --- a/jdl/converters/jdl-to-json/jdl-with-applications-to-json-converter.ts +++ b/jdl/converters/jdl-to-json/jdl-with-applications-to-json-converter.ts @@ -17,14 +17,14 @@ * limitations under the License. */ -import BasicEntityConverter from './jdl-to-json-basic-entity-converter.js'; -import FieldConverter from './jdl-to-json-field-converter.js'; -import RelationshipConverter from './jdl-to-json-relationship-converter.js'; -import OptionConverter from './jdl-to-json-option-converter.js'; import JDLObject from '../../models/jdl-object.js'; import JDLApplication from '../../models/jdl-application.js'; import JSONEntity from '../../jhipster/json-entity.js'; import { JdlObjectWrapper } from '../../models/jdl-object-wrapper.js'; +import BasicEntityConverter from './jdl-to-json-basic-entity-converter.js'; +import FieldConverter from './jdl-to-json-field-converter.js'; +import RelationshipConverter from './jdl-to-json-relationship-converter.js'; +import OptionConverter from './jdl-to-json-option-converter.js'; let entities: Record | null | undefined; let jdlObject: JDLObject; diff --git a/jdl/converters/jdl-to-json/jdl-without-application-to-json-converter.spec.ts b/jdl/converters/jdl-to-json/jdl-without-application-to-json-converter.spec.ts index 8258d5cb9ad7..6ae01932b5eb 100644 --- a/jdl/converters/jdl-to-json/jdl-without-application-to-json-converter.spec.ts +++ b/jdl/converters/jdl-to-json/jdl-without-application-to-json-converter.spec.ts @@ -25,8 +25,6 @@ import sinonChai from 'sinon-chai'; chai.use(sinonChai); -import { convert } from './jdl-without-application-to-json-converter.js'; - import { applicationTypes, databaseTypes, @@ -46,6 +44,7 @@ import JDLRelationship from '../../models/jdl-relationship.js'; import JDLUnaryOption from '../../models/jdl-unary-option.js'; import JDLBinaryOption from '../../models/jdl-binary-option.js'; import logger from '../../utils/objects/logger.js'; +import { convert } from './jdl-without-application-to-json-converter.js'; const { Validations: { REQUIRED, UNIQUE, MIN, MAX, MINLENGTH, MAXLENGTH, PATTERN, MINBYTES, MAXBYTES }, diff --git a/jdl/converters/jdl-to-json/jdl-without-application-to-json-converter.ts b/jdl/converters/jdl-to-json/jdl-without-application-to-json-converter.ts index 2f77b40c71c0..518541016915 100644 --- a/jdl/converters/jdl-to-json/jdl-without-application-to-json-converter.ts +++ b/jdl/converters/jdl-to-json/jdl-without-application-to-json-converter.ts @@ -17,13 +17,13 @@ * limitations under the License. */ +import JDLObject from '../../models/jdl-object.js'; +import JSONEntity from '../../jhipster/json-entity.js'; +import { JdlObjectWrapper } from '../../models/jdl-object-wrapper.js'; import BasicEntityConverter from './jdl-to-json-basic-entity-converter.js'; import FieldConverter from './jdl-to-json-field-converter.js'; import RelationshipConverter from './jdl-to-json-relationship-converter.js'; import OptionConverter from './jdl-to-json-option-converter.js'; -import JDLObject from '../../models/jdl-object.js'; -import JSONEntity from '../../jhipster/json-entity.js'; -import { JdlObjectWrapper } from '../../models/jdl-object-wrapper.js'; let entities: Record | null | undefined; let jdlObject: JDLObject | null | undefined; diff --git a/jdl/converters/json-to-jdl-converter.ts b/jdl/converters/json-to-jdl-converter.ts index 6aeb0e982151..915df293f437 100644 --- a/jdl/converters/json-to-jdl-converter.ts +++ b/jdl/converters/json-to-jdl-converter.ts @@ -23,13 +23,13 @@ import JDLObject from '../models/jdl-object.js'; import mergeJDLObjects from '../models/jdl-object-merger.js'; import { doesFileExist, doesDirectoryExist } from '../utils/file-utils.js'; import { readJSONFile } from '../readers/json-file-reader.js'; -import { convertApplicationToJDL } from './json-to-jdl-application-converter.js'; -import { convertEntitiesToJDL } from './json-to-jdl-entity-converter.js'; import exportJDLObject from '../exporters/jdl-exporter.js'; -import { JSONEntity, JHipsterYoRcContent, PostProcessedJSONRootObject } from './types.js'; import { removeFieldsWithNullishValues } from '../../generators/base/support/config.js'; import { GENERATOR_JHIPSTER } from '../../generators/generator-constants.js'; import JDLApplication from '../models/jdl-application.js'; +import { JSONEntity, JHipsterYoRcContent, PostProcessedJSONRootObject } from './types.js'; +import { convertEntitiesToJDL } from './json-to-jdl-entity-converter.js'; +import { convertApplicationToJDL } from './json-to-jdl-application-converter.js'; export default { convertToJDL, diff --git a/jdl/converters/json-to-jdl-entity-converter.spec.ts b/jdl/converters/json-to-jdl-entity-converter.spec.ts index eb7ecbcd160d..fd00cdf96b81 100644 --- a/jdl/converters/json-to-jdl-entity-converter.spec.ts +++ b/jdl/converters/json-to-jdl-entity-converter.spec.ts @@ -19,10 +19,10 @@ /* eslint-disable no-new, no-unused-expressions */ -import { before, it, describe } from 'esmocha'; import fs from 'fs'; import path, { dirname } from 'path'; import { fileURLToPath } from 'url'; +import { before, it, describe } from 'esmocha'; import { expect } from 'chai'; import { convertEntitiesToJDL } from '../converters/json-to-jdl-entity-converter.js'; import { unaryOptions, relationshipOptions, binaryOptions } from '../jhipster/index.js'; diff --git a/jdl/converters/json-to-jdl-entity-converter.ts b/jdl/converters/json-to-jdl-entity-converter.ts index 9337907fe808..072cae18aca9 100644 --- a/jdl/converters/json-to-jdl-entity-converter.ts +++ b/jdl/converters/json-to-jdl-entity-converter.ts @@ -28,8 +28,8 @@ import JDLBinaryOption from '../models/jdl-binary-option.js'; import { lowerFirst, upperFirst } from '../utils/string-utils.js'; import { fieldTypes, unaryOptions, binaryOptions, relationshipOptions } from '../jhipster/index.js'; -import { JSONEntity, JSONField, JSONRelationship } from './types.js'; import { asJdlRelationshipType } from '../jhipster/relationship-types.js'; +import { JSONEntity, JSONField, JSONRelationship } from './types.js'; const { BlobTypes, CommonDBTypes, RelationalOnlyDBTypes } = fieldTypes; const { BUILT_IN_ENTITY } = relationshipOptions; diff --git a/jdl/converters/parsed-jdl-to-jdl-object/application-converter.ts b/jdl/converters/parsed-jdl-to-jdl-object/application-converter.ts index 346556675191..50799e0f5595 100644 --- a/jdl/converters/parsed-jdl-to-jdl-object/application-converter.ts +++ b/jdl/converters/parsed-jdl-to-jdl-object/application-converter.ts @@ -18,13 +18,13 @@ */ import createJDLApplication from '../../models/jdl-application-factory.js'; -import { convertOptions } from './option-converter.js'; import ApplicationOptions from '../../jhipster/application-options.js'; import JDLUnaryOption from '../../models/jdl-unary-option.js'; import JDLBinaryOption from '../../models/jdl-binary-option.js'; -import { ParsedJDLApplication } from './types.js'; import AbstractJDLOption from '../../models/abstract-jdl-option.js'; import JDLApplication from '../../models/jdl-application.js'; +import { ParsedJDLApplication } from './types.js'; +import { convertOptions } from './option-converter.js'; const { OptionNames: { BASE_NAME }, diff --git a/jdl/converters/parsed-jdl-to-jdl-object/entity-converter.ts b/jdl/converters/parsed-jdl-to-jdl-object/entity-converter.ts index 4f7274c6c3ef..2ceeed67b395 100644 --- a/jdl/converters/parsed-jdl-to-jdl-object/entity-converter.ts +++ b/jdl/converters/parsed-jdl-to-jdl-object/entity-converter.ts @@ -20,8 +20,8 @@ import { lowerFirst } from 'lodash-es'; import { JDLEntity } from '../../models/index.js'; import { formatComment } from '../../utils/format-utils.js'; -import { ParsedJDLEntity } from './types.js'; import JDLField from '../../models/jdl-field.js'; +import { ParsedJDLEntity } from './types.js'; export default { convertEntities }; diff --git a/jdl/converters/parsed-jdl-to-jdl-object/field-converter.spec.ts b/jdl/converters/parsed-jdl-to-jdl-object/field-converter.spec.ts index ea8cdfc72d58..42ab515e9a89 100644 --- a/jdl/converters/parsed-jdl-to-jdl-object/field-converter.spec.ts +++ b/jdl/converters/parsed-jdl-to-jdl-object/field-converter.spec.ts @@ -18,8 +18,8 @@ */ import { before, it, describe, expect } from 'esmocha'; -import { convertField } from './field-converter.js'; import JDLField from '../../models/jdl-field.js'; +import { convertField } from './field-converter.js'; describe('jdl - FieldConverter', () => { describe('convertField', () => { diff --git a/jdl/converters/parsed-jdl-to-jdl-object/option-converter.ts b/jdl/converters/parsed-jdl-to-jdl-object/option-converter.ts index bd0fd7d23aa5..9cca1ca19131 100644 --- a/jdl/converters/parsed-jdl-to-jdl-object/option-converter.ts +++ b/jdl/converters/parsed-jdl-to-jdl-object/option-converter.ts @@ -20,8 +20,8 @@ import JDLUnaryOption from '../../models/jdl-unary-option.js'; import JDLBinaryOption from '../../models/jdl-binary-option.js'; import { unaryOptions, binaryOptions } from '../../jhipster/index.js'; -import { ParsedJDLOption, ParsedJDLUseOption } from './types.js'; import AbstractJDLOption from '../../models/abstract-jdl-option.js'; +import { ParsedJDLOption, ParsedJDLUseOption } from './types.js'; const { OptionValues, getOptionName } = binaryOptions; export default { convertOptions }; diff --git a/jdl/converters/parsed-jdl-to-jdl-object/parsed-jdl-to-jdl-object-converter.spec.ts b/jdl/converters/parsed-jdl-to-jdl-object/parsed-jdl-to-jdl-object-converter.spec.ts index 97fd46c8b504..530350b5523d 100644 --- a/jdl/converters/parsed-jdl-to-jdl-object/parsed-jdl-to-jdl-object-converter.spec.ts +++ b/jdl/converters/parsed-jdl-to-jdl-object/parsed-jdl-to-jdl-object-converter.spec.ts @@ -24,7 +24,6 @@ import { before, it, describe, expect as jestExpect } from 'esmocha'; import { expect } from 'chai'; import matchEntity from '../../matchers/entity-matcher.js'; import * as JDLReader from '../../readers/jdl-reader.js'; -import ParsedJDLToJDLObjectConverter from './parsed-jdl-to-jdl-object-converter.js'; import { JDLEntity, JDLEnum } from '../../models/index.js'; import JDLField from '../../models/jdl-field.js'; import JDLValidation from '../../models/jdl-validation.js'; @@ -39,6 +38,7 @@ import { entityOptions, binaryOptions, } from '../../jhipster/index.js'; +import ParsedJDLToJDLObjectConverter from './parsed-jdl-to-jdl-object-converter.js'; const { GATEWAY, MICROSERVICE, MONOLITH } = applicationTypes; const { OptionNames } = applicationOptions; diff --git a/jdl/converters/parsed-jdl-to-jdl-object/parsed-jdl-to-jdl-object-converter.ts b/jdl/converters/parsed-jdl-to-jdl-object/parsed-jdl-to-jdl-object-converter.ts index 59a51e235e1f..7a7b2539f639 100644 --- a/jdl/converters/parsed-jdl-to-jdl-object/parsed-jdl-to-jdl-object-converter.ts +++ b/jdl/converters/parsed-jdl-to-jdl-object/parsed-jdl-to-jdl-object-converter.ts @@ -21,6 +21,10 @@ import JDLObject from '../../models/jdl-object.js'; import JDLBinaryOption from '../../models/jdl-binary-option.js'; import { applicationTypes, binaryOptions } from '../../jhipster/index.js'; +import JDLApplication from '../../models/jdl-application.js'; +import JDLField from '../../models/jdl-field.js'; +import JDLValidation from '../../models/jdl-validation.js'; +import { JDLEntity } from '../../models/index.js'; import { convertApplications } from './application-converter.js'; import { convertEntities } from './entity-converter.js'; import { convertEnums } from './enum-converter.js'; @@ -37,10 +41,6 @@ import { ParsedJDLEntityField, ParsedJDLRoot, } from './types.js'; -import JDLApplication from '../../models/jdl-application.js'; -import JDLField from '../../models/jdl-field.js'; -import JDLValidation from '../../models/jdl-validation.js'; -import { JDLEntity } from '../../models/index.js'; let parsedContent: ParsedJDLApplications; let configuration: ParsedJDLRoot; diff --git a/jdl/exporters/config.ts b/jdl/exporters/config.ts index b5a67794ffa7..86cb4417d326 100644 --- a/jdl/exporters/config.ts +++ b/jdl/exporters/config.ts @@ -1,5 +1,5 @@ -import { GENERATOR_NAME } from './export-utils.js'; import { JHipsterYoRcContent } from '../converters/types.js'; +import { GENERATOR_NAME } from './export-utils.js'; export const mergeYoRcContent = (oldConfig: JHipsterYoRcContent, newConfig: JHipsterYoRcContent): JHipsterYoRcContent => { // @ts-expect-error partial assignment diff --git a/jdl/exporters/export-utils.ts b/jdl/exporters/export-utils.ts index ef409829f6f4..2330aa9864a7 100644 --- a/jdl/exporters/export-utils.ts +++ b/jdl/exporters/export-utils.ts @@ -19,8 +19,8 @@ import fs from 'fs'; import { doesFileExist } from '../utils/file-utils.js'; -import { mergeYoRcContent } from './config.js'; import { JHipsterYoRcContent } from '../converters/types.js'; +import { mergeYoRcContent } from './config.js'; export const GENERATOR_NAME = 'generator-jhipster'; diff --git a/jdl/exporters/jhipster-deployment-exporter.ts b/jdl/exporters/jhipster-deployment-exporter.ts index bac608294d9d..a0d1484e76b0 100644 --- a/jdl/exporters/jhipster-deployment-exporter.ts +++ b/jdl/exporters/jhipster-deployment-exporter.ts @@ -20,9 +20,9 @@ import path from 'path'; import { createFolderIfItDoesNotExist, doesFileExist } from '../utils/file-utils.js'; import DeploymentValidator from '../validators/deployment-validator.js'; -import { GENERATOR_NAME, writeConfigFile } from './export-utils.js'; import JDLDeployment from '../models/jdl-deployment.js'; import { JHipsterYoRcContent } from '../converters/types.js'; +import { GENERATOR_NAME, writeConfigFile } from './export-utils.js'; /** * Exports JDL deployments to .yo-rc.json files in separate folders (based on deployment type). diff --git a/jdl/exporters/types.d.ts b/jdl/exporters/types.d.ts index f05299430b7a..b3a4837265ce 100644 --- a/jdl/exporters/types.d.ts +++ b/jdl/exporters/types.d.ts @@ -16,8 +16,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { GENERATOR_NAME } from './export-utils.js'; import { JSONEntity } from '../converters/types.js'; +import { GENERATOR_NAME } from './export-utils.js'; export type JDLJSONApplicationContent = { entities?: string[]; diff --git a/jdl/integration-test.spec.ts b/jdl/integration-test.spec.ts index c0f78e8fdab5..1381359ab1d8 100644 --- a/jdl/integration-test.spec.ts +++ b/jdl/integration-test.spec.ts @@ -22,11 +22,11 @@ import path, { dirname } from 'path'; import { fileURLToPath } from 'url'; import { expect } from 'chai'; import { it, describe, expect as jestExpect, beforeEach } from 'esmocha'; +import { basicHelpers as helpers } from '../testing/index.js'; import { applicationTypes } from './jhipster/index.js'; import { parseFromContent, parseFromFiles } from './readers/jdl-reader.js'; import DocumentParser from './converters/parsed-jdl-to-jdl-object/parsed-jdl-to-jdl-object-converter.js'; import exportToJDL from './exporters/jdl-exporter.js'; -import { basicHelpers as helpers } from '../testing/index.js'; import { convert as convertWithoutApplication } from './converters/jdl-to-json/jdl-without-application-to-json-converter.js'; import { ApplicationWithEntities, createImporterFromContent } from './jdl-importer.js'; diff --git a/jdl/jhipster/application-options.ts b/jdl/jhipster/application-options.ts index 50433fac4b06..e12db90d6702 100644 --- a/jdl/jhipster/application-options.ts +++ b/jdl/jhipster/application-options.ts @@ -17,6 +17,12 @@ * limitations under the License. */ +import jhipsterDefinition from '../../generators/app/jdl/application-options.js'; +import { + JDLApplicationOptionType, + JDLApplicationOptionTypeValue, + JDLApplicationOptionValue, +} from '../models/jdl-application-definition.js'; import applicationTypes from './application-types.js'; import authenticationTypes from './authentication-types.js'; import databaseTypes from './database-types.js'; @@ -27,12 +33,6 @@ import buildToolTypes from './build-tool-types.js'; import searchEngineTypes from './search-engine-types.js'; import testFrameworkTypes from './test-framework-types.js'; import websocketTypes from './websocket-types.js'; -import jhipsterDefinition from '../../generators/app/jdl/application-options.js'; -import { - JDLApplicationOptionType, - JDLApplicationOptionTypeValue, - JDLApplicationOptionValue, -} from '../models/jdl-application-definition.js'; const { GATEWAY, MONOLITH, MICROSERVICE } = applicationTypes; const { CASSANDRA, COUCHBASE, MARIADB, MONGODB, MSSQL, MYSQL, NEO4J, ORACLE, POSTGRESQL, SQL, H2_DISK, H2_MEMORY } = databaseTypes; diff --git a/jdl/jhipster/default-application-options.ts b/jdl/jhipster/default-application-options.ts index fc36ed84b5f3..17e2fcbb77a0 100644 --- a/jdl/jhipster/default-application-options.ts +++ b/jdl/jhipster/default-application-options.ts @@ -17,6 +17,7 @@ * limitations under the License. */ +import { MESSAGE_BROKER, MESSAGE_BROKER_NO } from '../../generators/server/options/index.js'; import applicationTypes from './application-types.js'; import authenticationTypes from './authentication-types.js'; import databaseTypes from './database-types.js'; @@ -25,7 +26,6 @@ import cacheTypes from './cache-types.js'; import serviceDiscoveryTypes from './service-discovery-types.js'; import clientFrameworkTypes from './client-framework-types.js'; import buildToolTypes from './build-tool-types.js'; -import { MESSAGE_BROKER, MESSAGE_BROKER_NO } from '../../generators/server/options/index.js'; const { MONOLITH, MICROSERVICE, GATEWAY } = applicationTypes; const { CONSUL } = serviceDiscoveryTypes; diff --git a/jdl/jhipster/field-types.ts b/jdl/jhipster/field-types.ts index 95c8128ecbc8..213c159e8660 100644 --- a/jdl/jhipster/field-types.ts +++ b/jdl/jhipster/field-types.ts @@ -18,8 +18,8 @@ */ import { snakeCase } from 'lodash-es'; -import validations from './validations.js'; import JDLEnum from '../models/jdl-enum.js'; +import validations from './validations.js'; import databaseTypes from './database-types.js'; const { diff --git a/jdl/jhipster/reserved-keywords.ts b/jdl/jhipster/reserved-keywords.ts index 50711e034f05..408c222bca51 100644 --- a/jdl/jhipster/reserved-keywords.ts +++ b/jdl/jhipster/reserved-keywords.ts @@ -17,8 +17,6 @@ * limitations under the License. */ -import JHipsterReservedKeywords from './reserved-keywords/jhipster.js'; -import PagingReservedKeywords from './reserved-keywords/paging.js'; import { angularReservedKeywords } from '../../generators/angular/support/reserved-keywords.js'; import { mysqlReservedKeywords } from '../../generators/spring-data-relational/support/mysql-reserved-keywords.js'; import { javaReservedKeywords } from '../../generators/java/support/reserved-keywords.js'; @@ -29,6 +27,8 @@ import { couchbaseReservedKeywords } from '../../generators/spring-data-couchbas import { oracleReservedKeywords } from '../../generators/spring-data-relational/support/oracle-reserved-keywords.js'; import { mssqlReservedKeywords } from '../../generators/spring-data-relational/support/mssql-reserved-keywords.js'; import { neo4jReservedKeywords } from '../../generators/spring-data-neo4j/support/reserved-keywords.js'; +import PagingReservedKeywords from './reserved-keywords/paging.js'; +import JHipsterReservedKeywords from './reserved-keywords/jhipster.js'; import applicationOptions from './application-options.js'; const clientFrameworks = applicationOptions.OptionValues[applicationOptions.OptionNames.CLIENT_FRAMEWORK] as Record; diff --git a/jdl/linters/entity-linter.ts b/jdl/linters/entity-linter.ts index 6751f7e06687..ebed01aed1f8 100644 --- a/jdl/linters/entity-linter.ts +++ b/jdl/linters/entity-linter.ts @@ -17,8 +17,8 @@ * limitations under the License. */ -import EntityIssue from './issues/entity-issue.js'; import { shouldWriteEntityTableName } from '../jhipster/index.js'; +import EntityIssue from './issues/entity-issue.js'; import { rulesNames } from './rules.js'; let issues: EntityIssue[]; diff --git a/jdl/linters/issues/issues.spec.ts b/jdl/linters/issues/issues.spec.ts index 1dbf9d3dadd6..ed1d07baac15 100644 --- a/jdl/linters/issues/issues.spec.ts +++ b/jdl/linters/issues/issues.spec.ts @@ -19,9 +19,9 @@ import { it, describe, beforeEach } from 'esmocha'; import { expect } from 'chai'; -import Issues from './issues.js'; import { rulesNames } from '../rules.js'; import { relationshipTypes } from '../../jhipster/index.js'; +import Issues from './issues.js'; import EntityIssue from './entity-issue.js'; import FieldIssue from './field-issue.js'; import EnumIssue from './enum-issue.js'; diff --git a/jdl/linters/jdl-linter.spec.ts b/jdl/linters/jdl-linter.spec.ts index ea797cf24a46..8638dcb9ff1c 100644 --- a/jdl/linters/jdl-linter.spec.ts +++ b/jdl/linters/jdl-linter.spec.ts @@ -24,11 +24,11 @@ import path, { dirname } from 'path'; import { fileURLToPath } from 'url'; import { expect } from 'chai'; import { it, describe, expect as jestExpect, beforeEach } from 'esmocha'; +import { basicHelpers as helpers } from '../../testing/index.js'; import { createJDLLinterFromFile, createJDLLinterFromContent, JDLLinter } from './jdl-linter.js'; import Issues from './issues/issues.js'; import EnumIssue from './issues/enum-issue.js'; import relationshipIssue from './issues/relationship-issue.js'; -import { basicHelpers as helpers } from '../../testing/index.js'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); diff --git a/jdl/linters/relationship-linter.ts b/jdl/linters/relationship-linter.ts index fc5378f147c4..d88823dc1b76 100644 --- a/jdl/linters/relationship-linter.ts +++ b/jdl/linters/relationship-linter.ts @@ -17,10 +17,10 @@ * limitations under the License. */ +import { relationshipTypes } from '../jhipster/index.js'; import RelationshipIssue from './issues/relationship-issue.js'; import { rulesNames } from './rules.js'; -import { relationshipTypes } from '../jhipster/index.js'; let issues: RelationshipIssue[]; diff --git a/jdl/linters/rule.ts b/jdl/linters/rule.ts index 289ef8bf19b6..57fdc821a80c 100644 --- a/jdl/linters/rule.ts +++ b/jdl/linters/rule.ts @@ -17,9 +17,8 @@ * limitations under the License. */ -import { RuleLevel, INFO } from './rule-levels.js'; - import { merge } from '../utils/object-utils.js'; +import { RuleLevel, INFO } from './rule-levels.js'; /** * Represents a rule for the linters. diff --git a/jdl/models/jdl-binary-option.ts b/jdl/models/jdl-binary-option.ts index c639fd7a6d8e..8d85da476053 100644 --- a/jdl/models/jdl-binary-option.ts +++ b/jdl/models/jdl-binary-option.ts @@ -17,9 +17,9 @@ * limitations under the License. */ -import AbstractJDLOption, { JDLOptionParams } from './abstract-jdl-option.js'; import BinaryOptions from '../jhipster/binary-options.js'; import { join } from '../utils/set-utils.js'; +import AbstractJDLOption, { JDLOptionParams } from './abstract-jdl-option.js'; /** * For options like the DTO, the service, etc. diff --git a/jdl/models/jdl-enum.ts b/jdl/models/jdl-enum.ts index fe4b297a773a..50636222d201 100644 --- a/jdl/models/jdl-enum.ts +++ b/jdl/models/jdl-enum.ts @@ -18,8 +18,8 @@ */ import { merge } from '../utils/object-utils.js'; -import JDLEnumValue from './jdl-enum-value.js'; import { ParsedJDLEnumValue } from '../converters/parsed-jdl-to-jdl-object/types.js'; +import JDLEnumValue from './jdl-enum-value.js'; export default class JDLEnum { comment?: string; diff --git a/jdl/models/jdl-object.ts b/jdl/models/jdl-object.ts index ff42f46661f9..a1d3c1b18c1c 100644 --- a/jdl/models/jdl-object.ts +++ b/jdl/models/jdl-object.ts @@ -17,10 +17,10 @@ * limitations under the License. */ +import { binaryOptions } from '../jhipster/index.js'; import JDLEnums from './jdl-enums.js'; import JDLRelationships from './jdl-relationships.js'; import JDLOptions from './jdl-options.js'; -import { binaryOptions } from '../jhipster/index.js'; import JDLEntity from './jdl-entity.js'; import JDLRelationship from './jdl-relationship.js'; import AbstractJDLOption from './abstract-jdl-option.js'; diff --git a/jdl/models/jdl-unary-option.ts b/jdl/models/jdl-unary-option.ts index 2d258c290b5a..02ae687c736c 100644 --- a/jdl/models/jdl-unary-option.ts +++ b/jdl/models/jdl-unary-option.ts @@ -17,8 +17,8 @@ * limitations under the License. */ -import AbstractJDLOption from './abstract-jdl-option.js'; import { join } from '../utils/set-utils.js'; +import AbstractJDLOption from './abstract-jdl-option.js'; /** * For flags such as skipServer, skipClient, etc. diff --git a/jdl/models/list-jdl-application-configuration-option.ts b/jdl/models/list-jdl-application-configuration-option.ts index 67b6dcc5378a..f42454ed5a70 100644 --- a/jdl/models/list-jdl-application-configuration-option.ts +++ b/jdl/models/list-jdl-application-configuration-option.ts @@ -17,8 +17,8 @@ * limitations under the License. */ -import JDLApplicationConfigurationOption from './jdl-application-configuration-option.js'; import { join } from '../utils/set-utils.js'; +import JDLApplicationConfigurationOption from './jdl-application-configuration-option.js'; export default class ListJDLApplicationConfigurationOption extends JDLApplicationConfigurationOption { // TODO for v9, use set everywhere diff --git a/jdl/parsing/jdl-ast-builder-visitor.ts b/jdl/parsing/jdl-ast-builder-visitor.ts index 294606855c3a..eef11b8dedfa 100644 --- a/jdl/parsing/jdl-ast-builder-visitor.ts +++ b/jdl/parsing/jdl-ast-builder-visitor.ts @@ -16,10 +16,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import JDLParser from './jdl-parser.js'; import deduplicate from '../utils/array-utils.js'; import { applicationOptions, entityOptions, validations, relationshipOptions } from '../jhipster/index.js'; +import JDLParser from './jdl-parser.js'; const { BUILT_IN_ENTITY } = relationshipOptions; const { OptionNames } = applicationOptions; diff --git a/jdl/parsing/lexer/application-tokens.ts b/jdl/parsing/lexer/application-tokens.ts index e711381eda2b..8c9e48e19eee 100644 --- a/jdl/parsing/lexer/application-tokens.ts +++ b/jdl/parsing/lexer/application-tokens.ts @@ -18,11 +18,10 @@ */ import { ITokenConfig, Lexer } from 'chevrotain'; -import createTokenFromConfig from './token-creator.js'; -import { UNARY_OPTION, KEYWORD } from './shared-tokens.js'; - import { applicationOptions } from '../../jhipster/index.js'; import jhipsterDefinition from '../../../generators/app/jdl/index.js'; +import createTokenFromConfig from './token-creator.js'; +import { UNARY_OPTION, KEYWORD } from './shared-tokens.js'; const { OptionNames } = applicationOptions; diff --git a/jdl/parsing/lexer/lexer.ts b/jdl/parsing/lexer/lexer.ts index a688077366e8..eb5851d944eb 100644 --- a/jdl/parsing/lexer/lexer.ts +++ b/jdl/parsing/lexer/lexer.ts @@ -19,8 +19,8 @@ import { Lexer, TokenType } from 'chevrotain'; -import { NAME, UNARY_OPTION, BINARY_OPTION } from './shared-tokens.js'; import { relationshipOptions } from '../../jhipster/index.js'; +import { NAME, UNARY_OPTION, BINARY_OPTION } from './shared-tokens.js'; import ValidationTokens from './validation-tokens.js'; import ApplicationTokens from './application-tokens.js'; diff --git a/jdl/parsing/validator.ts b/jdl/parsing/validator.ts index 58c25bb15fdb..6b83b6647c16 100644 --- a/jdl/parsing/validator.ts +++ b/jdl/parsing/validator.ts @@ -21,10 +21,10 @@ import { first, flatten, includes, values } from 'lodash-es'; import { tokenMatcher as matchesToken } from 'chevrotain'; +import jhipsterDefinition from '../../generators/app/jdl/index.js'; import JDLParser from './jdl-parser.js'; import { tokens as LexerTokens } from './lexer/lexer.js'; import { checkConfigKeys } from './self-checks/parsing-system-checker.js'; -import jhipsterDefinition from '../../generators/app/jdl/index.js'; const CONSTANT_PATTERN = /^[A-Z_]+$/; const ENTITY_NAME_PATTERN = /^[A-Z][A-Za-z0-9]*$/; diff --git a/jdl/readers/jdl-reader.spec.ts b/jdl/readers/jdl-reader.spec.ts index 21e39cab984e..c6bc3337a6b1 100644 --- a/jdl/readers/jdl-reader.spec.ts +++ b/jdl/readers/jdl-reader.spec.ts @@ -18,11 +18,11 @@ */ /* eslint-disable no-new, no-unused-expressions */ -import { it, describe, after, beforeEach } from 'esmocha'; import fs from 'fs'; import path, { dirname } from 'path'; import { fileURLToPath } from 'url'; +import { it, describe, after, beforeEach } from 'esmocha'; import { expect } from 'chai'; import * as JDLReader from '../readers/jdl-reader.js'; import { basicHelpers as helpers } from '../../testing/index.js'; diff --git a/jdl/readers/json-file-reader.spec.ts b/jdl/readers/json-file-reader.spec.ts index a6c0f7450e0b..9eb25a17c6b5 100644 --- a/jdl/readers/json-file-reader.spec.ts +++ b/jdl/readers/json-file-reader.spec.ts @@ -18,8 +18,8 @@ */ /* eslint-disable no-new, no-unused-expressions */ -import { it, describe } from 'esmocha'; import path from 'path'; +import { it, describe } from 'esmocha'; import { expect } from 'chai'; import * as JSONFileReader from '../readers/json-file-reader.js'; diff --git a/jdl/readers/json-reader.spec.ts b/jdl/readers/json-reader.spec.ts index 6a9ef62ceab5..0db4fe59f631 100644 --- a/jdl/readers/json-reader.spec.ts +++ b/jdl/readers/json-reader.spec.ts @@ -18,10 +18,10 @@ */ /* eslint-disable no-new, no-unused-expressions */ -import { before, it, describe, after } from 'esmocha'; import { renameSync } from 'fs'; import { join, dirname } from 'path'; import { fileURLToPath } from 'url'; +import { before, it, describe, after } from 'esmocha'; import { expect } from 'chai'; import parseFromDir from '../readers/json-reader.js'; diff --git a/jdl/readers/json-reader.ts b/jdl/readers/json-reader.ts index 9c3245669a64..3c2e92939b6d 100644 --- a/jdl/readers/json-reader.ts +++ b/jdl/readers/json-reader.ts @@ -22,9 +22,9 @@ import { convertEntitiesToJDL } from '../converters/json-to-jdl-entity-converter import { convertServerOptionsToJDL } from '../converters/json-to-jdl-option-converter.js'; import mergeJDLObjects from '../models/jdl-object-merger.js'; import { doesDirectoryExist } from '../utils/file-utils.js'; -import { readJSONFile } from './json-file-reader.js'; import JDLObject from '../models/jdl-object.js'; import { JSONEntity } from '../converters/types.js'; +import { readJSONFile } from './json-file-reader.js'; /* Parse the given jhipster app dir and return a JDLObject */ export default function parseFromDir(dir: string): JDLObject { diff --git a/jdl/utils/files-utils.spec.ts b/jdl/utils/files-utils.spec.ts index 7b99eed50042..cc434c56e7bb 100644 --- a/jdl/utils/files-utils.spec.ts +++ b/jdl/utils/files-utils.spec.ts @@ -19,10 +19,10 @@ /* eslint-disable no-unused-expressions */ -import { before, it, describe, after } from 'esmocha'; import fs from 'fs'; import path, { dirname } from 'path'; import { fileURLToPath } from 'url'; +import { before, it, describe, after } from 'esmocha'; import { expect } from 'chai'; import { createFolderIfItDoesNotExist, doesFileExist, doesDirectoryExist } from '../utils/file-utils.js'; diff --git a/jdl/validators/deployment-validator.ts b/jdl/validators/deployment-validator.ts index 392b0f4959f4..e760ff38c2a3 100644 --- a/jdl/validators/deployment-validator.ts +++ b/jdl/validators/deployment-validator.ts @@ -17,9 +17,9 @@ * limitations under the License. */ -import Validator from './validator.js'; import { applicationTypes, databaseTypes, searchEngineTypes, deploymentOptions, applicationOptions } from '../jhipster/index.js'; import JDLDeployment from '../models/jdl-deployment.js'; +import Validator from './validator.js'; const { Options } = deploymentOptions; const { MICROSERVICE } = applicationTypes; diff --git a/jdl/validators/entity-validator.ts b/jdl/validators/entity-validator.ts index f177e2647fa1..bd01d814e226 100644 --- a/jdl/validators/entity-validator.ts +++ b/jdl/validators/entity-validator.ts @@ -17,8 +17,8 @@ * limitations under the License. */ -import Validator, { ValidatorOptions } from './validator.js'; import { reservedKeywords } from '../jhipster/index.js'; +import Validator, { ValidatorOptions } from './validator.js'; const { isReservedClassName } = reservedKeywords; diff --git a/jdl/validators/enum-validator.ts b/jdl/validators/enum-validator.ts index 82fdaef3b3ce..312953435de2 100644 --- a/jdl/validators/enum-validator.ts +++ b/jdl/validators/enum-validator.ts @@ -17,8 +17,8 @@ * limitations under the License. */ -import Validator, { ValidatorOptions } from './validator.js'; import { reservedKeywords } from '../jhipster/index.js'; +import Validator, { ValidatorOptions } from './validator.js'; const { isReservedClassName } = reservedKeywords; export default class EnumValidator extends Validator { diff --git a/jdl/validators/jdl-with-application-validator.ts b/jdl/validators/jdl-with-application-validator.ts index 33c624e0d720..1be02a45e11e 100644 --- a/jdl/validators/jdl-with-application-validator.ts +++ b/jdl/validators/jdl-with-application-validator.ts @@ -17,21 +17,21 @@ * limitations under the License. */ +import { fieldTypes, applicationOptions, relationshipOptions } from '../jhipster/index.js'; +import JDLObject from '../models/jdl-object.js'; +import JDLRelationship from '../models/jdl-relationship.js'; +import JDLApplication from '../models/jdl-application.js'; +import JDLField from '../models/jdl-field.js'; +import JDLApplicationConfigurationOption from '../models/jdl-application-configuration-option.js'; import EntityValidator from './entity-validator.js'; import FieldValidator from './field-validator.js'; -import { fieldTypes, applicationOptions, relationshipOptions } from '../jhipster/index.js'; import ValidationValidator from './validation-validator.js'; import RelationshipValidator from './relationship-validator.js'; import EnumValidator from './enum-validator.js'; import DeploymentValidator from './deployment-validator.js'; import UnaryOptionValidator from './unary-option-validator.js'; import BinaryOptionValidator from './binary-option-validator.js'; -import JDLObject from '../models/jdl-object.js'; -import JDLRelationship from '../models/jdl-relationship.js'; -import JDLApplication from '../models/jdl-application.js'; import { ValidatorOptions } from './validator.js'; -import JDLField from '../models/jdl-field.js'; -import JDLApplicationConfigurationOption from '../models/jdl-application-configuration-option.js'; const { OptionNames } = applicationOptions; diff --git a/jdl/validators/jdl-without-application-validator.ts b/jdl/validators/jdl-without-application-validator.ts index d4d41bd05abd..6de9a55cf401 100644 --- a/jdl/validators/jdl-without-application-validator.ts +++ b/jdl/validators/jdl-without-application-validator.ts @@ -17,9 +17,14 @@ * limitations under the License. */ +import { fieldTypes, applicationTypes, databaseTypes, binaryOptions, relationshipOptions } from '../jhipster/index.js'; +import JDLObject from '../models/jdl-object.js'; +import JDLRelationship from '../models/jdl-relationship.js'; +import { isReservedFieldName, isReservedPaginationWords, isReservedTableName } from '../jhipster/reserved-keywords.js'; +import JDLField from '../models/jdl-field.js'; +import AbstractJDLOption from '../models/abstract-jdl-option.js'; import EntityValidator from './entity-validator.js'; import FieldValidator from './field-validator.js'; -import { fieldTypes, applicationTypes, databaseTypes, binaryOptions, relationshipOptions } from '../jhipster/index.js'; import ValidationValidator from './validation-validator.js'; import RelationshipValidator from './relationship-validator.js'; import EnumValidator from './enum-validator.js'; @@ -27,12 +32,7 @@ import DeploymentValidator from './deployment-validator.js'; import UnaryOptionValidator from './unary-option-validator.js'; import BinaryOptionValidator from './binary-option-validator.js'; -import JDLObject from '../models/jdl-object.js'; -import JDLRelationship from '../models/jdl-relationship.js'; import { ValidatorOptions } from './validator.js'; -import { isReservedFieldName, isReservedPaginationWords, isReservedTableName } from '../jhipster/reserved-keywords.js'; -import JDLField from '../models/jdl-field.js'; -import AbstractJDLOption from '../models/abstract-jdl-option.js'; const { BUILT_IN_ENTITY } = relationshipOptions; const { SQL } = databaseTypes; diff --git a/jdl/validators/relationship-validator.ts b/jdl/validators/relationship-validator.ts index bd375da49260..af8a96180e19 100644 --- a/jdl/validators/relationship-validator.ts +++ b/jdl/validators/relationship-validator.ts @@ -17,10 +17,10 @@ * limitations under the License. */ -import Validator from './validator.js'; import { relationshipTypes } from '../jhipster/index.js'; import JDLRelationship from '../models/jdl-relationship.js'; import { relationshipTypeExists } from '../jhipster/relationship-types.js'; +import Validator from './validator.js'; const { ONE_TO_ONE, MANY_TO_MANY, MANY_TO_ONE, ONE_TO_MANY } = relationshipTypes; diff --git a/jdl/validators/validation-validator.ts b/jdl/validators/validation-validator.ts index de1abf20e316..e864002459a4 100644 --- a/jdl/validators/validation-validator.ts +++ b/jdl/validators/validation-validator.ts @@ -17,8 +17,8 @@ * limitations under the License. */ -import Validator from './validator.js'; import { validations } from '../jhipster/index.js'; +import Validator from './validator.js'; const { Validations: { exists, needsValue, MINLENGTH, MAXLENGTH, MAXBYTES, MINBYTES }, diff --git a/package-lock.json b/package-lock.json index c36a6907f957..6924ccc74eae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -78,7 +78,6 @@ "chai": "4.4.1", "cpy-cli": "5.0.0", "ejs-lint": "2.0.0", - "eslint-config-airbnb-base": "15.0.0", "eslint-config-prettier": "9.1.0", "eslint-plugin-chai-friendly": "1.0.0", "eslint-plugin-mocha": "10.4.3", @@ -4803,13 +4802,6 @@ "proto-list": "~1.2.1" } }, - "node_modules/confusing-browser-globals": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/confusing-browser-globals/-/confusing-browser-globals-1.0.11.tgz", - "integrity": "sha512-JsPKdmh8ZkmnHxDk55FZ1TqVLvEQTvoByJZRN9jzI0UjxK/QgAmsphz7PGtqgPieQZ/CQcHWXCR7ATDNhGe+YA==", - "dev": true, - "license": "MIT" - }, "node_modules/convert-source-map": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", @@ -5791,36 +5783,6 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint-config-airbnb-base": { - "version": "15.0.0", - "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-15.0.0.tgz", - "integrity": "sha512-xaX3z4ZZIcFLvh2oUNvcX5oEofXda7giYmuplVxoOg5A7EXJMrUyqRgR+mhDhPK8LZ4PttFOBvCYDbX3sUoUig==", - "dev": true, - "license": "MIT", - "dependencies": { - "confusing-browser-globals": "^1.0.10", - "object.assign": "^4.1.2", - "object.entries": "^1.1.5", - "semver": "^6.3.0" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - }, - "peerDependencies": { - "eslint": "^7.32.0 || ^8.2.0", - "eslint-plugin-import": "^2.25.2" - } - }, - "node_modules/eslint-config-airbnb-base/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - } - }, "node_modules/eslint-config-prettier": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", @@ -10867,21 +10829,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/object.entries": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.8.tgz", - "integrity": "sha512-cmopxi8VwRIAw/fkijJohSfpef5PdN0pMQJN6VC/ZKvn0LIknWD8KtgY6KlQdEc4tIjcQ3HxSMmnvtzIscdaYQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-object-atoms": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/object.fromentries": { "version": "2.0.8", "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz", diff --git a/package.json b/package.json index 8b8da7bc0010..6c20f7e7ffce 100644 --- a/package.json +++ b/package.json @@ -183,7 +183,6 @@ "chai": "4.4.1", "cpy-cli": "5.0.0", "ejs-lint": "2.0.0", - "eslint-config-airbnb-base": "15.0.0", "eslint-config-prettier": "9.1.0", "eslint-plugin-chai-friendly": "1.0.0", "eslint-plugin-mocha": "10.4.3", diff --git a/test/integration-test.spec.ts b/test/integration-test.spec.ts index 1b7bcc8c8920..d7eadae0de9d 100644 --- a/test/integration-test.spec.ts +++ b/test/integration-test.spec.ts @@ -16,11 +16,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { before, it, describe } from 'esmocha'; import assert from 'assert'; import fs, { existsSync, writeFileSync } from 'fs'; import path, { dirname } from 'path'; import { fileURLToPath } from 'url'; +import { before, it, describe } from 'esmocha'; import sortKeys from 'sort-keys'; import { applicationTypes, authenticationTypes } from '../jdl/jhipster/index.js'; diff --git a/testing/github.ts b/testing/github.ts index 2bbaca281b4a..eea0e4b548f8 100644 --- a/testing/github.ts +++ b/testing/github.ts @@ -1,7 +1,7 @@ -import axios from 'axios'; import { randomUUID } from 'node:crypto'; import { appendFileSync, existsSync } from 'node:fs'; import { EOL } from 'node:os'; +import axios from 'axios'; export const parseIssue = (issue: string): undefined | { owner: string; repository: string; issue: string } => { if (issue.includes('#')) { diff --git a/testing/helpers.ts b/testing/helpers.ts index bfc85d23c22d..37704562d087 100644 --- a/testing/helpers.ts +++ b/testing/helpers.ts @@ -1,21 +1,21 @@ /* eslint-disable max-classes-per-file */ -import type { BaseEnvironmentOptions, GetGeneratorConstructor, BaseGenerator as YeomanGenerator } from '@yeoman/types'; +import { basename, dirname, join } from 'path'; +import { fileURLToPath } from 'url'; import { YeomanTest, RunContext, RunContextSettings, RunResult, result } from 'yeoman-test'; import { merge, set } from 'lodash-es'; import { globSync } from 'glob'; -import { basename, dirname, join } from 'path'; -import { fileURLToPath } from 'url'; +import type { BaseEnvironmentOptions, GetGeneratorConstructor, BaseGenerator as YeomanGenerator } from '@yeoman/types'; import EnvironmentBuilder from '../cli/environment-builder.mjs'; import { JHIPSTER_CONFIG_DIR } from '../generators/generator-constants.js'; import { GENERATOR_WORKSPACES } from '../generators/generator-list.js'; -import getGenerator from './get-generator.js'; import { createJHipsterLogger, normalizePathEnd, parseCreationTimestamp } from '../generators/base/support/index.js'; import BaseGenerator from '../generators/base/index.js'; import type { JHipsterGeneratorOptions } from '../generators/base/api.js'; import { getPackageRoot, isDistFolder } from '../lib/index.js'; import type { JSONEntity } from '../jdl/converters/types.js'; import CoreGenerator from '../generators/base-core/generator.js'; +import getGenerator from './get-generator.js'; type BaseEntity = { name: string } & JSONEntity; type GeneratorTestType = YeomanGenerator;