From 1c6d2c3da8368050efd16bc1bafaf1373d863a37 Mon Sep 17 00:00:00 2001 From: Marcelo Shima Date: Fri, 6 Oct 2023 14:44:09 -0300 Subject: [PATCH] replace lodash with lodash-es --- .blueprint/code-workspace/generator.mjs | 2 +- cli/environment-builder.mjs | 2 +- generators/angular/generator.mts | 2 +- generators/angular/needle-api/needle-client-angular.mts | 2 +- generators/app/generator.mjs | 2 +- generators/app/support/config.mts | 2 +- generators/base-application/support/entity.mts | 2 +- generators/base-application/support/enum.mjs | 2 +- generators/base-application/support/prepare-entity.mts | 2 +- generators/base-application/support/prepare-field.mjs | 2 +- generators/base-application/support/prepare-relationship.mjs | 2 +- generators/base-application/support/relationship.mts | 2 +- generators/base-core/generator.mts | 2 +- generators/base-workspaces/internal/deployments.mts | 2 +- generators/base/generator.mts | 2 +- generators/base/shared-data.mts | 2 +- generators/base/support/basename.mts | 2 +- generators/base/support/needles.mts | 2 +- generators/base/support/string.mts | 2 +- generators/bootstrap-application-base/generator.mts | 2 +- generators/bootstrap-application-base/utils.mjs | 2 +- generators/bootstrap-application-server/generator.mts | 2 +- generators/ci-cd/command.mts | 2 +- generators/client/command.mts | 2 +- generators/client/needle-api/needle-client-vue.mts | 2 +- generators/docker-compose/generator.mjs | 2 +- generators/docker/generator.mjs | 2 +- generators/docker/utils.mjs | 2 +- generators/entity/generator.mjs | 2 +- generators/entity/prompts.mjs | 2 +- generators/heroku/generator.mjs | 2 +- generators/java/support/util.mts | 2 +- generators/jdl/generator.mts | 2 +- generators/kubernetes/kubernetes-base.mjs | 2 +- generators/languages/generator.mjs | 2 +- generators/languages/translation-data.mjs | 2 +- generators/liquibase/generator.mts | 2 +- generators/liquibase/support/prepare-field.mjs | 2 +- generators/liquibase/support/relationship.mts | 2 +- generators/maven/internal/xml-store.mts | 2 +- generators/maven/support/pom-store.mts | 2 +- generators/project-name/generator.mjs | 2 +- generators/react/generator.mjs | 2 +- generators/react/needle-api/needle-client-react.mts | 2 +- generators/server/entity-files.mjs | 2 +- generators/server/jdl/application-definition.mts | 2 +- generators/server/prompts.mjs | 2 +- generators/server/support/java-formatting.mjs | 2 +- generators/server/support/prepare-field.mjs | 2 +- generators/upgrade/upgrade.spec.mts | 2 +- generators/vue/generator.mjs | 2 +- jdl/converters/jdl-to-json/jdl-to-json-field-converter.ts | 2 +- .../jdl-to-json/jdl-to-json-relationship-converter.ts | 2 +- .../parsed-jdl-to-jdl-object-converter.ts | 2 +- jdl/jdl-importer.ts | 2 +- jdl/jhipster/entity-table-name-creator.ts | 2 +- jdl/jhipster/field-types.ts | 2 +- jdl/jhipster/relationship-types.ts | 2 +- jdl/models/jdl-deployment.ts | 2 +- jdl/parsing/api.ts | 2 +- jdl/parsing/lexer/token-creator.ts | 2 +- jdl/parsing/self-checks/parsing-system-checker.ts | 2 +- jdl/parsing/validator.ts | 2 +- package-lock.json | 1 - package.json | 1 - testing/helpers.mts | 2 +- 66 files changed, 64 insertions(+), 66 deletions(-) diff --git a/.blueprint/code-workspace/generator.mjs b/.blueprint/code-workspace/generator.mjs index dd22ce81a2b1..cab998ae28c8 100644 --- a/.blueprint/code-workspace/generator.mjs +++ b/.blueprint/code-workspace/generator.mjs @@ -1,5 +1,5 @@ import { join } from 'path'; -import _ from 'lodash'; +import * as _ from 'lodash-es'; import BaseGenerator from '../../generators/base/index.mjs'; import { getPackageRoot } from '../../lib/index.mjs'; import command from './command.mjs'; diff --git a/cli/environment-builder.mjs b/cli/environment-builder.mjs index 291a0378dee8..987b16a5135d 100644 --- a/cli/environment-builder.mjs +++ b/cli/environment-builder.mjs @@ -21,7 +21,7 @@ import { existsSync, readFileSync } from 'fs'; import path, { dirname, resolve } from 'path'; import { fileURLToPath, pathToFileURL } from 'url'; import chalk from 'chalk'; -import _ from 'lodash'; +import * as _ from 'lodash-es'; import Environment from 'yeoman-environment'; import { QueuedAdapter } from '@yeoman/adapter'; diff --git a/generators/angular/generator.mts b/generators/angular/generator.mts index 96df78ae131d..d6e0734de28c 100644 --- a/generators/angular/generator.mts +++ b/generators/angular/generator.mts @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import _ from 'lodash'; +import * as _ from 'lodash-es'; import chalk from 'chalk'; import { isFilePending } from 'mem-fs-editor/state'; diff --git a/generators/angular/needle-api/needle-client-angular.mts b/generators/angular/needle-api/needle-client-angular.mts index 58c6e51cdf1e..be61323c1230 100644 --- a/generators/angular/needle-api/needle-client-angular.mts +++ b/generators/angular/needle-api/needle-client-angular.mts @@ -17,7 +17,7 @@ * limitations under the License. */ import chalk from 'chalk'; -import _ from 'lodash'; +import * as _ from 'lodash-es'; import needleClientBase from '../../client/needle-api/needle-client.mjs'; import { LINE_LENGTH } from '../../generator-constants.mjs'; diff --git a/generators/app/generator.mjs b/generators/app/generator.mjs index 413f08a3d386..32389264a4c8 100644 --- a/generators/app/generator.mjs +++ b/generators/app/generator.mjs @@ -18,7 +18,7 @@ */ /* eslint-disable consistent-return, import/no-named-as-default-member */ import chalk from 'chalk'; -import _ from 'lodash'; +import * as _ from 'lodash-es'; import BaseApplicationGenerator from '../base-application/index.mjs'; import { checkNode, loadStoredAppOptions } from './support/index.mjs'; diff --git a/generators/app/support/config.mts b/generators/app/support/config.mts index fc8042195f14..5065e8e0455b 100644 --- a/generators/app/support/config.mts +++ b/generators/app/support/config.mts @@ -1,4 +1,4 @@ -import _ from 'lodash'; +import * as _ from 'lodash-es'; import { NODE_VERSION } from '../../generator-constants.mjs'; import { applicationTypes, authenticationTypes, databaseTypes, testFrameworkTypes } from '../../../jdl/index.js'; import { getHipster, upperFirstCamelCase } from '../../base/support/index.mjs'; diff --git a/generators/base-application/support/entity.mts b/generators/base-application/support/entity.mts index 8102371c45d4..b6ec6c08dfeb 100644 --- a/generators/base-application/support/entity.mts +++ b/generators/base-application/support/entity.mts @@ -17,7 +17,7 @@ * limitations under the License. */ -import _ from 'lodash'; +import * as _ from 'lodash-es'; import { Entity } from '../../../jdl/converters/types.js'; const { upperFirst } = _; diff --git a/generators/base-application/support/enum.mjs b/generators/base-application/support/enum.mjs index 7a935ff016ef..bf72d8735d85 100644 --- a/generators/base-application/support/enum.mjs +++ b/generators/base-application/support/enum.mjs @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import _ from 'lodash'; +import * as _ from 'lodash-es'; import { formatDocAsJavaDoc } from '../../server/support/doc.mjs'; const doesTheEnumValueHaveACustomValue = enumValue => { diff --git a/generators/base-application/support/prepare-entity.mts b/generators/base-application/support/prepare-entity.mts index ffa88e6b3d1a..955959e1d20d 100644 --- a/generators/base-application/support/prepare-entity.mts +++ b/generators/base-application/support/prepare-entity.mts @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import _ from 'lodash'; +import * as _ from 'lodash-es'; import pluralize from 'pluralize'; import type BaseGenerator from '../../base-core/index.mjs'; diff --git a/generators/base-application/support/prepare-field.mjs b/generators/base-application/support/prepare-field.mjs index 62839ad8f02d..30319f644c97 100644 --- a/generators/base-application/support/prepare-field.mjs +++ b/generators/base-application/support/prepare-field.mjs @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import _ from 'lodash'; +import * as _ from 'lodash-es'; import { fieldTypes, validations } from '../../../jdl/jhipster/index.mjs'; import { getTypescriptType, prepareField as prepareClientFieldForTemplates } from '../../client/support/index.mjs'; import { prepareField as prepareServerFieldForTemplates } from '../../server/support/index.mjs'; diff --git a/generators/base-application/support/prepare-relationship.mjs b/generators/base-application/support/prepare-relationship.mjs index 79fcc8598ab5..30f6862de900 100644 --- a/generators/base-application/support/prepare-relationship.mjs +++ b/generators/base-application/support/prepare-relationship.mjs @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import _ from 'lodash'; +import * as _ from 'lodash-es'; import pluralize from 'pluralize'; import { diff --git a/generators/base-application/support/relationship.mts b/generators/base-application/support/relationship.mts index 8e3efb3971f9..0a0dfe1b5801 100644 --- a/generators/base-application/support/relationship.mts +++ b/generators/base-application/support/relationship.mts @@ -17,7 +17,7 @@ * limitations under the License. */ -import _ from 'lodash'; +import * as _ from 'lodash-es'; import { Relationship, Entity } from '../../../jdl/converters/types.js'; import { ValidationResult } from '../../base/api.mjs'; diff --git a/generators/base-core/generator.mts b/generators/base-core/generator.mts index 915debf791e4..c2cef6683096 100644 --- a/generators/base-core/generator.mts +++ b/generators/base-core/generator.mts @@ -25,7 +25,7 @@ import assert from 'assert'; import { requireNamespace } from '@yeoman/namespace'; import chalk from 'chalk'; import { parse as parseYaml, stringify as stringifyYaml } from 'yaml'; -import _ from 'lodash'; +import * as _ from 'lodash-es'; import { simpleGit } from 'simple-git'; import type { CopyOptions } from 'mem-fs-editor'; import type { Data as TemplateData, Options as TemplateOptions } from 'ejs'; diff --git a/generators/base-workspaces/internal/deployments.mts b/generators/base-workspaces/internal/deployments.mts index 6a89b43f62c4..71cdd880e496 100644 --- a/generators/base-workspaces/internal/deployments.mts +++ b/generators/base-workspaces/internal/deployments.mts @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import _ from 'lodash'; +import * as _ from 'lodash-es'; import { applicationOptions, deploymentOptions } from '../../../jdl/index.js'; import { loadDerivedPlatformConfig, loadPlatformConfig, loadDerivedServerAndPlatformProperties } from '../../server/support/index.mjs'; import type { GeneratorBaseCore } from '../../index.js'; diff --git a/generators/base/generator.mts b/generators/base/generator.mts index 10558bde26b6..73031eff6472 100644 --- a/generators/base/generator.mts +++ b/generators/base/generator.mts @@ -20,7 +20,7 @@ import fs from 'fs'; import path from 'path'; import chalk from 'chalk'; import semver from 'semver'; -import _ from 'lodash'; +import * as _ from 'lodash-es'; import type { ComposeOptions } from 'yeoman-generator'; import { packageJson } from '../../lib/index.mjs'; diff --git a/generators/base/shared-data.mts b/generators/base/shared-data.mts index 356dbd9cb821..ee2aee24f373 100644 --- a/generators/base/shared-data.mts +++ b/generators/base/shared-data.mts @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import _ from 'lodash'; +import * as _ from 'lodash-es'; import { type BaseApplication } from '../base-application/types.mjs'; import { type Control } from './types.mjs'; diff --git a/generators/base/support/basename.mts b/generators/base/support/basename.mts index bfb4a2b4ca7c..53a5aed41bfe 100644 --- a/generators/base/support/basename.mts +++ b/generators/base/support/basename.mts @@ -1,4 +1,4 @@ -import _ from 'lodash'; +import * as _ from 'lodash-es'; const { camelCase } = _; diff --git a/generators/base/support/needles.mts b/generators/base/support/needles.mts index 1ee0bcf6b744..861b2e497f1f 100644 --- a/generators/base/support/needles.mts +++ b/generators/base/support/needles.mts @@ -17,7 +17,7 @@ * limitations under the License. */ import assert from 'assert'; -import _ from 'lodash'; +import * as _ from 'lodash-es'; import escapeStringRegexp from 'escape-string-regexp'; import CoreGenerator from '../../base-core/index.mjs'; import { CascatedEditFileCallback, EditFileCallback } from '../api.mjs'; diff --git a/generators/base/support/string.mts b/generators/base/support/string.mts index ed83d3b0d61d..3b59df2707a7 100644 --- a/generators/base/support/string.mts +++ b/generators/base/support/string.mts @@ -17,7 +17,7 @@ * limitations under the License. */ -import _ from 'lodash'; +import * as _ from 'lodash-es'; /** * Calculate a hash code for a given string. diff --git a/generators/bootstrap-application-base/generator.mts b/generators/bootstrap-application-base/generator.mts index 1e91a5ea0ad1..6b320a7aed11 100644 --- a/generators/bootstrap-application-base/generator.mts +++ b/generators/bootstrap-application-base/generator.mts @@ -18,7 +18,7 @@ */ import assert from 'assert'; import os from 'os'; -import _ from 'lodash'; +import * as _ from 'lodash-es'; import chalk from 'chalk'; import { passthrough } from '@yeoman/transform'; diff --git a/generators/bootstrap-application-base/utils.mjs b/generators/bootstrap-application-base/utils.mjs index 7e1798d26ce2..67d72f4e5ce4 100644 --- a/generators/bootstrap-application-base/utils.mjs +++ b/generators/bootstrap-application-base/utils.mjs @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import _ from 'lodash'; +import * as _ from 'lodash-es'; import { authenticationTypes, databaseTypes, fieldTypes } from '../../jdl/jhipster/index.mjs'; import { loadRequiredConfigIntoEntity } from '../base-application/support/index.mjs'; import { hibernateSnakeCase } from '../server/support/string.mjs'; diff --git a/generators/bootstrap-application-server/generator.mts b/generators/bootstrap-application-server/generator.mts index 7559f63715eb..2a5aaa0a07c2 100644 --- a/generators/bootstrap-application-server/generator.mts +++ b/generators/bootstrap-application-server/generator.mts @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import _ from 'lodash'; +import * as _ from 'lodash-es'; import BaseApplicationGenerator from '../base-application/index.mjs'; import { GENERATOR_BOOTSTRAP_APPLICATION_BASE } from '../generator-list.mjs'; diff --git a/generators/ci-cd/command.mts b/generators/ci-cd/command.mts index 22888aab7e86..e044a7d8a7bf 100644 --- a/generators/ci-cd/command.mts +++ b/generators/ci-cd/command.mts @@ -17,7 +17,7 @@ * limitations under the License. */ import chalk from 'chalk'; -import _ from 'lodash'; +import * as _ from 'lodash-es'; import { JHipsterCommandDefinition } from '../base/api.mjs'; const { kebabCase, intersection } = _; diff --git a/generators/client/command.mts b/generators/client/command.mts index 8bf092f0671c..d2eb392ad806 100644 --- a/generators/client/command.mts +++ b/generators/client/command.mts @@ -17,7 +17,7 @@ * limitations under the License. */ import chalk from 'chalk'; -import _ from 'lodash'; +import * as _ from 'lodash-es'; import { testFrameworkTypes } from '../../jdl/jhipster/index.mjs'; import { JHipsterCommandDefinition } from '../base/api.mjs'; import { APPLICATION_TYPE_GATEWAY, APPLICATION_TYPE_MICROSERVICE, clientFrameworkTypes } from '../../jdl/index.js'; diff --git a/generators/client/needle-api/needle-client-vue.mts b/generators/client/needle-api/needle-client-vue.mts index ee6b1a8bc160..ebf51da233ac 100644 --- a/generators/client/needle-api/needle-client-vue.mts +++ b/generators/client/needle-api/needle-client-vue.mts @@ -17,7 +17,7 @@ * limitations under the License. */ import chalk from 'chalk'; -import _ from 'lodash'; +import * as _ from 'lodash-es'; import needleClientBase from './needle-client.mjs'; import { stripMargin } from '../../base/support/index.mjs'; import { createNeedleCallback } from '../../base/support/needles.mjs'; diff --git a/generators/docker-compose/generator.mjs b/generators/docker-compose/generator.mjs index 987091483a53..9fe114b92c7f 100644 --- a/generators/docker-compose/generator.mjs +++ b/generators/docker-compose/generator.mjs @@ -21,7 +21,7 @@ import pathjs from 'path'; import chalk from 'chalk'; import jsyaml from 'js-yaml'; import normalize from 'normalize-path'; -import _ from 'lodash'; +import * as _ from 'lodash-es'; import BaseWorkspacesGenerator from '../base-workspaces/index.mjs'; diff --git a/generators/docker/generator.mjs b/generators/docker/generator.mjs index de580d9dd9d0..5ad7da2b6532 100644 --- a/generators/docker/generator.mjs +++ b/generators/docker/generator.mjs @@ -17,7 +17,7 @@ * limitations under the License. */ /* eslint-disable camelcase */ -import _ from 'lodash'; +import * as _ from 'lodash-es'; import BaseApplicationGenerator from '../base-application/index.mjs'; import { createDockerComposeFile, createDockerExtendedServices } from '../docker/support/index.mjs'; import { GENERATOR_BOOTSTRAP_APPLICATION_SERVER, GENERATOR_DOCKER } from '../generator-list.mjs'; diff --git a/generators/docker/utils.mjs b/generators/docker/utils.mjs index 48e4a8a889a9..95dad580f936 100644 --- a/generators/docker/utils.mjs +++ b/generators/docker/utils.mjs @@ -17,7 +17,7 @@ * limitations under the License. */ import { DockerfileParser } from 'dockerfile-ast'; -import _ from 'lodash'; +import * as _ from 'lodash-es'; const { camelCase } = _; diff --git a/generators/entity/generator.mjs b/generators/entity/generator.mjs index fe4edc9cb4a4..7326a9dc359c 100644 --- a/generators/entity/generator.mjs +++ b/generators/entity/generator.mjs @@ -20,7 +20,7 @@ import fs from 'fs'; import path from 'path'; import chalk from 'chalk'; -import _ from 'lodash'; +import * as _ from 'lodash-es'; import BaseApplicationGenerator from '../base-application/index.mjs'; import prompts from './prompts.mjs'; diff --git a/generators/entity/prompts.mjs b/generators/entity/prompts.mjs index 16a1f848c1f2..3a7c367e7ddb 100644 --- a/generators/entity/prompts.mjs +++ b/generators/entity/prompts.mjs @@ -18,7 +18,7 @@ */ import fs from 'fs'; import chalk from 'chalk'; -import _ from 'lodash'; +import * as _ from 'lodash-es'; import { reservedKeywords, databaseTypes, diff --git a/generators/heroku/generator.mjs b/generators/heroku/generator.mjs index fb6a20a5ed8b..3e472fc72f0f 100644 --- a/generators/heroku/generator.mjs +++ b/generators/heroku/generator.mjs @@ -21,7 +21,7 @@ import crypto from 'crypto'; import fs from 'fs'; import ChildProcess from 'child_process'; import util from 'util'; -import _ from 'lodash'; +import * as _ from 'lodash-es'; import chalk from 'chalk'; import { glob } from 'glob'; import runAsync from 'run-async'; diff --git a/generators/java/support/util.mts b/generators/java/support/util.mts index 1d445ca1cfee..d6b33f751017 100644 --- a/generators/java/support/util.mts +++ b/generators/java/support/util.mts @@ -1,4 +1,4 @@ -import _ from 'lodash'; +import * as _ from 'lodash-es'; import { getMicroserviceAppName } from '../../base/support/index.mjs'; const { upperFirst } = _; diff --git a/generators/jdl/generator.mts b/generators/jdl/generator.mts index 0c514c3c4886..ab0c53644e3e 100644 --- a/generators/jdl/generator.mts +++ b/generators/jdl/generator.mts @@ -18,7 +18,7 @@ */ import { extname } from 'path'; import { QueuedAdapter } from '@yeoman/adapter'; -import _ from 'lodash'; +import * as _ from 'lodash-es'; import { create as createMemFs, type Store as MemFs } from 'mem-fs'; import { create as createMemFsEditor, type MemFsEditor } from 'mem-fs-editor'; diff --git a/generators/kubernetes/kubernetes-base.mjs b/generators/kubernetes/kubernetes-base.mjs index 074b3004fafc..962800fa68ff 100644 --- a/generators/kubernetes/kubernetes-base.mjs +++ b/generators/kubernetes/kubernetes-base.mjs @@ -17,7 +17,7 @@ * limitations under the License. */ import crypto from 'crypto'; -import _ from 'lodash'; +import * as _ from 'lodash-es'; import { defaultKubernetesConfig } from './kubernetes-constants.mjs'; import { loadFromYoRc } from '../base-workspaces/internal/docker-base.mjs'; diff --git a/generators/languages/generator.mjs b/generators/languages/generator.mjs index 70982ef6b7d9..2159afc91e69 100644 --- a/generators/languages/generator.mjs +++ b/generators/languages/generator.mjs @@ -18,7 +18,7 @@ */ /* eslint-disable consistent-return */ import chalk from 'chalk'; -import _ from 'lodash'; +import * as _ from 'lodash-es'; import BaseApplicationGenerator from '../base-application/index.mjs'; import { askForLanguages, askI18n } from './prompts.mjs'; diff --git a/generators/languages/translation-data.mjs b/generators/languages/translation-data.mjs index e9699687b35f..f40c316481ee 100644 --- a/generators/languages/translation-data.mjs +++ b/generators/languages/translation-data.mjs @@ -17,7 +17,7 @@ * limitations under the License. */ import { inspect } from 'node:util'; -import _ from 'lodash'; +import * as _ from 'lodash-es'; import { passthrough } from '@yeoman/transform'; import { Minimatch } from 'minimatch'; import { clearFileState } from 'mem-fs-editor/state'; diff --git a/generators/liquibase/generator.mts b/generators/liquibase/generator.mts index 08fd46056b5c..5ed35f1dc6b9 100644 --- a/generators/liquibase/generator.mts +++ b/generators/liquibase/generator.mts @@ -17,7 +17,7 @@ * limitations under the License. */ import fs from 'fs'; -import _ from 'lodash'; +import * as _ from 'lodash-es'; import BaseEntityChangesGenerator from '../base-entity-changes/index.mjs'; import { GENERATOR_LIQUIBASE, GENERATOR_BOOTSTRAP_APPLICATION_SERVER } from '../generator-list.mjs'; diff --git a/generators/liquibase/support/prepare-field.mjs b/generators/liquibase/support/prepare-field.mjs index fc8f606f14a8..217d0792d86c 100644 --- a/generators/liquibase/support/prepare-field.mjs +++ b/generators/liquibase/support/prepare-field.mjs @@ -17,7 +17,7 @@ * limitations under the License. */ -import _ from 'lodash'; +import * as _ from 'lodash-es'; import { databaseTypes, fieldTypes } from '../../../jdl/jhipster/index.mjs'; diff --git a/generators/liquibase/support/relationship.mts b/generators/liquibase/support/relationship.mts index 8b54b432efc9..276c51984e34 100644 --- a/generators/liquibase/support/relationship.mts +++ b/generators/liquibase/support/relationship.mts @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import _ from 'lodash'; +import * as _ from 'lodash-es'; import { getFKConstraintName } from '../../server/support/index.mjs'; function relationshipBaseDataEquals(relationshipA, relationshipB) { diff --git a/generators/maven/internal/xml-store.mts b/generators/maven/internal/xml-store.mts index 77c0014f33cf..82a478de649a 100644 --- a/generators/maven/internal/xml-store.mts +++ b/generators/maven/internal/xml-store.mts @@ -19,7 +19,7 @@ import assert from 'assert'; import { XMLParser, XMLBuilder, XmlBuilderOptions, X2jOptions } from 'fast-xml-parser'; -import _ from 'lodash'; +import * as _ from 'lodash-es'; const { merge } = _; diff --git a/generators/maven/support/pom-store.mts b/generators/maven/support/pom-store.mts index 344cddba04d1..cf6688dc33f3 100644 --- a/generators/maven/support/pom-store.mts +++ b/generators/maven/support/pom-store.mts @@ -17,7 +17,7 @@ * limitations under the License. */ -import _ from 'lodash'; +import * as _ from 'lodash-es'; import sortKeys from 'sort-keys'; import CoreGenerator from '../../base-core/index.mjs'; diff --git a/generators/project-name/generator.mjs b/generators/project-name/generator.mjs index 6faa483c8335..511686321f04 100644 --- a/generators/project-name/generator.mjs +++ b/generators/project-name/generator.mjs @@ -17,7 +17,7 @@ * limitations under the License. */ /* eslint-disable consistent-return */ -import _ from 'lodash'; +import * as _ from 'lodash-es'; import { getDefaultAppName } from './support/index.mjs'; import BaseApplicationGenerator from '../base-application/index.mjs'; diff --git a/generators/react/generator.mjs b/generators/react/generator.mjs index d74b10831a32..43032bef3df9 100644 --- a/generators/react/generator.mjs +++ b/generators/react/generator.mjs @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import _ from 'lodash'; +import * as _ from 'lodash-es'; import { isFilePending } from 'mem-fs-editor/state'; import chalk from 'chalk'; diff --git a/generators/react/needle-api/needle-client-react.mts b/generators/react/needle-api/needle-client-react.mts index e79556f40f77..bcbf847aca8d 100644 --- a/generators/react/needle-api/needle-client-react.mts +++ b/generators/react/needle-api/needle-client-react.mts @@ -17,7 +17,7 @@ * limitations under the License. */ import chalk from 'chalk'; -import _ from 'lodash'; +import * as _ from 'lodash-es'; import needleClientBase from '../../client/needle-api/needle-client.mjs'; import { stripMargin } from '../../base/support/index.mjs'; diff --git a/generators/server/entity-files.mjs b/generators/server/entity-files.mjs index 64f5d7f9d2de..fb3b63e3893c 100644 --- a/generators/server/entity-files.mjs +++ b/generators/server/entity-files.mjs @@ -17,7 +17,7 @@ * limitations under the License. */ import fs from 'fs'; -import _ from 'lodash'; +import * as _ from 'lodash-es'; import chalk from 'chalk'; import { cleanupOldFiles } from './entity-cleanup.mjs'; import { moveToJavaPackageSrcDir, javaMainPackageTemplatesBlock, javaTestPackageTemplatesBlock } from './support/index.mjs'; diff --git a/generators/server/jdl/application-definition.mts b/generators/server/jdl/application-definition.mts index bf42d158474e..6c159590be23 100644 --- a/generators/server/jdl/application-definition.mts +++ b/generators/server/jdl/application-definition.mts @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import _ from 'lodash'; +import * as _ from 'lodash-es'; import { JDLApplicationConfig, JHipsterOptionDefinition } from '../../../jdl/types/types.mjs'; import databaseMigrationOption from '../options/database-migration.mjs'; import messageBrokerOption from '../options/message-broker.mjs'; diff --git a/generators/server/prompts.mjs b/generators/server/prompts.mjs index 0b8345ba650f..04ad88fb9fbe 100644 --- a/generators/server/prompts.mjs +++ b/generators/server/prompts.mjs @@ -18,7 +18,7 @@ */ import chalk from 'chalk'; -import _ from 'lodash'; +import * as _ from 'lodash-es'; import { applicationOptions, diff --git a/generators/server/support/java-formatting.mjs b/generators/server/support/java-formatting.mjs index 2e97f3a40a3a..f1c84a1d7e5b 100644 --- a/generators/server/support/java-formatting.mjs +++ b/generators/server/support/java-formatting.mjs @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import _ from 'lodash'; +import * as _ from 'lodash-es'; /** * @private diff --git a/generators/server/support/prepare-field.mjs b/generators/server/support/prepare-field.mjs index 9ecb1cae8a54..2ddc4988da48 100644 --- a/generators/server/support/prepare-field.mjs +++ b/generators/server/support/prepare-field.mjs @@ -17,7 +17,7 @@ * limitations under the License. */ import assert from 'assert'; -import _ from 'lodash'; +import * as _ from 'lodash-es'; import { databaseTypes, entityOptions, fieldTypes, reservedKeywords } from '../../../jdl/jhipster/index.mjs'; import { getUXConstraintName } from './database.mjs'; diff --git a/generators/upgrade/upgrade.spec.mts b/generators/upgrade/upgrade.spec.mts index 0ef4e07b32c9..1498ba75f5a4 100644 --- a/generators/upgrade/upgrade.spec.mts +++ b/generators/upgrade/upgrade.spec.mts @@ -1,7 +1,7 @@ import path, { dirname, resolve } from 'path'; import { fileURLToPath } from 'url'; import fse from 'fs-extra'; -import _ from 'lodash'; +import * as _ from 'lodash-es'; import { expect } from 'esmocha'; import { execaCommandSync } from 'execa'; diff --git a/generators/vue/generator.mjs b/generators/vue/generator.mjs index ce79a62075db..87dd4a3f4bc1 100644 --- a/generators/vue/generator.mjs +++ b/generators/vue/generator.mjs @@ -18,7 +18,7 @@ */ import { relative } from 'path'; import chalk from 'chalk'; -import _ from 'lodash'; +import * as _ from 'lodash-es'; import { isFilePending } from 'mem-fs-editor/state'; import BaseApplicationGenerator from '../base-application/index.mjs'; diff --git a/jdl/converters/jdl-to-json/jdl-to-json-field-converter.ts b/jdl/converters/jdl-to-json/jdl-to-json-field-converter.ts index bbbcb5ffb3c5..6715f68d7f4b 100644 --- a/jdl/converters/jdl-to-json/jdl-to-json-field-converter.ts +++ b/jdl/converters/jdl-to-json/jdl-to-json-field-converter.ts @@ -17,7 +17,7 @@ * limitations under the License. */ -import _ from 'lodash'; +import * as _ from 'lodash-es'; import { validations } from '../../jhipster/index.mjs'; import formatComment from '../../utils/format-utils.js'; import { camelCase } from '../../utils/string-utils.js'; diff --git a/jdl/converters/jdl-to-json/jdl-to-json-relationship-converter.ts b/jdl/converters/jdl-to-json/jdl-to-json-relationship-converter.ts index 0b2699d4e105..c500c16afc61 100644 --- a/jdl/converters/jdl-to-json/jdl-to-json-relationship-converter.ts +++ b/jdl/converters/jdl-to-json/jdl-to-json-relationship-converter.ts @@ -17,7 +17,7 @@ * limitations under the License. */ -import _ from 'lodash'; +import * as _ from 'lodash-es'; import { relationshipOptions, validations } from '../../jhipster/index.mjs'; import { camelCase, lowerFirst } from '../../utils/string-utils.js'; import JDLRelationship from '../../models/jdl-relationship.js'; 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 c4e647d8ed4e..0fdb3bb43abd 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 @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import _ from 'lodash'; +import * as _ from 'lodash-es'; import JDLObject from '../../models/jdl-object.js'; import JDLUnaryOption from '../../models/jdl-unary-option.js'; import JDLBinaryOption from '../../models/jdl-binary-option.js'; diff --git a/jdl/jdl-importer.ts b/jdl/jdl-importer.ts index ccac1021abdf..de0e144975e3 100644 --- a/jdl/jdl-importer.ts +++ b/jdl/jdl-importer.ts @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import _ from 'lodash'; +import * as _ from 'lodash-es'; import * as JDLReader from './readers/jdl-reader.js'; import ParsedJDLToJDLObjectConverter from './converters/parsed-jdl-to-jdl-object/parsed-jdl-to-jdl-object-converter.js'; import { readJSONFile } from './readers/json-file-reader.js'; diff --git a/jdl/jhipster/entity-table-name-creator.ts b/jdl/jhipster/entity-table-name-creator.ts index c4f84267c3e1..61ecfeedce6d 100644 --- a/jdl/jhipster/entity-table-name-creator.ts +++ b/jdl/jhipster/entity-table-name-creator.ts @@ -17,7 +17,7 @@ * limitations under the License. */ -import _ from 'lodash'; +import * as _ from 'lodash-es'; /** * Returns an entity table name based on the passed entity name. diff --git a/jdl/jhipster/field-types.ts b/jdl/jhipster/field-types.ts index 51934a8aacab..5f3f70125e18 100644 --- a/jdl/jhipster/field-types.ts +++ b/jdl/jhipster/field-types.ts @@ -17,7 +17,7 @@ * limitations under the License. */ -import _ from 'lodash'; +import * as _ from 'lodash-es'; import validations from './validations.js'; import JDLEnum from '../models/jdl-enum.js'; import databaseTypes from './database-types.js'; diff --git a/jdl/jhipster/relationship-types.ts b/jdl/jhipster/relationship-types.ts index 6ade3856bcb0..664784ea36d5 100644 --- a/jdl/jhipster/relationship-types.ts +++ b/jdl/jhipster/relationship-types.ts @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import _ from 'lodash'; +import * as _ from 'lodash-es'; import { JDLRelationshipType, RelationshipType, relationshipTypes } from '../basic-types/relationships.js'; const { camelCase, upperFirst } = _; diff --git a/jdl/models/jdl-deployment.ts b/jdl/models/jdl-deployment.ts index 3679da1bcb1f..ddd46220f8c0 100644 --- a/jdl/models/jdl-deployment.ts +++ b/jdl/models/jdl-deployment.ts @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import _ from 'lodash'; +import * as _ from 'lodash-es'; import { deploymentOptions, applicationOptions, serviceDiscoveryTypes } from '../jhipster/index.mjs'; import { merge } from '../utils/object-utils.js'; import { join } from '../utils/set-utils.js'; diff --git a/jdl/parsing/api.ts b/jdl/parsing/api.ts index e3582a17300c..c0b40824e32c 100644 --- a/jdl/parsing/api.ts +++ b/jdl/parsing/api.ts @@ -17,7 +17,7 @@ * limitations under the License. */ -import _ from 'lodash'; +import * as _ from 'lodash-es'; import { EOF } from 'chevrotain'; import JDLAstBuilderVisitor from './jdl-ast-builder-visitor.js'; import { JDLLexer, tokens } from './lexer/lexer.js'; diff --git a/jdl/parsing/lexer/token-creator.ts b/jdl/parsing/lexer/token-creator.ts index a538e61b0130..7588c7f113e9 100644 --- a/jdl/parsing/lexer/token-creator.ts +++ b/jdl/parsing/lexer/token-creator.ts @@ -17,7 +17,7 @@ * limitations under the License. */ -import _ from 'lodash'; +import * as _ from 'lodash-es'; import { createToken, ITokenConfig } from 'chevrotain'; import { NAME, KEYWORD, namePattern } from './shared-tokens.js'; diff --git a/jdl/parsing/self-checks/parsing-system-checker.ts b/jdl/parsing/self-checks/parsing-system-checker.ts index 000ce01267ec..3484aea8a915 100644 --- a/jdl/parsing/self-checks/parsing-system-checker.ts +++ b/jdl/parsing/self-checks/parsing-system-checker.ts @@ -17,7 +17,7 @@ * limitations under the License. */ -import _ from 'lodash'; +import * as _ from 'lodash-es'; import { Lexer } from 'chevrotain'; import TokenCollectorVisitor from './token-collector-visitor.js'; diff --git a/jdl/parsing/validator.ts b/jdl/parsing/validator.ts index 906c3742ef3c..1c8e8738ea01 100644 --- a/jdl/parsing/validator.ts +++ b/jdl/parsing/validator.ts @@ -18,7 +18,7 @@ */ /* eslint-disable no-useless-escape */ -import _ from 'lodash'; +import * as _ from 'lodash-es'; import { tokenMatcher as matchesToken } from 'chevrotain'; import JDLParser from './jdl-parser.js'; diff --git a/package-lock.json b/package-lock.json index a760cfc62172..f4df72b116e7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -42,7 +42,6 @@ "java-lint": "0.1.0", "js-yaml": "4.1.0", "latest-version": "7.0.0", - "lodash": "4.17.21", "lodash-es": "4.17.21", "mem-fs": "3.0.0", "mem-fs-editor": "10.0.2", diff --git a/package.json b/package.json index 376477628f92..3729f816704c 100644 --- a/package.json +++ b/package.json @@ -136,7 +136,6 @@ "java-lint": "0.1.0", "js-yaml": "4.1.0", "latest-version": "7.0.0", - "lodash": "4.17.21", "lodash-es": "4.17.21", "mem-fs": "3.0.0", "mem-fs-editor": "10.0.2", diff --git a/testing/helpers.mts b/testing/helpers.mts index b3f942a8e145..1ea4784c5d93 100644 --- a/testing/helpers.mts +++ b/testing/helpers.mts @@ -1,7 +1,7 @@ /* eslint-disable max-classes-per-file */ import type { BaseEnvironmentOptions, GetGeneratorConstructor, BaseGenerator as YeomanGenerator } from '@yeoman/types'; import { YeomanTest, RunContext, RunContextSettings, RunResult, result } from 'yeoman-test'; -import _ from 'lodash'; +import * as _ from 'lodash-es'; import { basename, join } from 'path'; import EnvironmentBuilder from '../cli/environment-builder.mjs';