Skip to content

Commit 7b273e8

Browse files
committed
continue lodash-es migration
1 parent f402ef8 commit 7b273e8

File tree

49 files changed

+53
-138
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+53
-138
lines changed

cli/jhipster-command.mjs

+1-3
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,9 @@
1919

2020
import chalk from 'chalk';
2121
import { Command, Option } from 'commander';
22-
import lodash from 'lodash';
22+
import { kebabCase } from 'lodash-es';
2323
import { convertConfigToOption } from '../lib/internal/index.js';
2424

25-
const { kebabCase } = lodash;
26-
2725
export default class JHipsterCommand extends Command {
2826
createCommand(name) {
2927
return new JHipsterCommand(name);

generators/angular/generator.spec.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { basename, dirname, join } from 'path';
22
import { fileURLToPath } from 'url';
33
import { before, it, describe, after, expect } from 'esmocha';
4-
import lodash from 'lodash';
4+
import { snakeCase } from 'lodash-es';
55

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

13-
const { snakeCase } = lodash;
14-
1513
const __filename = fileURLToPath(import.meta.url);
1614
const __dirname = dirname(__filename);
1715

generators/app/generator.spec.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,12 @@
1919
import { basename, dirname, join } from 'path';
2020
import { fileURLToPath } from 'url';
2121
import { before, it, describe, expect } from 'esmocha';
22-
import lodash from 'lodash';
22+
import { snakeCase } from 'lodash-es';
2323

2424
import { getCommandHelpOutput, shouldSupportFeatures, testBlueprintSupport } from '../../test/support/tests.js';
2525
import { defaultHelpers as helpers, runResult } from '../../testing/index.js';
2626
import Generator from './index.js';
2727

28-
const { snakeCase } = lodash;
29-
3028
const __filename = fileURLToPath(import.meta.url);
3129
const __dirname = dirname(__filename);
3230

generators/base-application/generator.spec.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,14 @@
2020
import { basename, dirname } from 'path';
2121
import { fileURLToPath } from 'url';
2222
import { before, it, describe, expect, esmocha } from 'esmocha';
23-
import lodash from 'lodash';
23+
import { snakeCase } from 'lodash-es';
2424

2525
import EnvironmentBuilder from '../../cli/environment-builder.mjs';
2626
import Generator from './index.js';
2727
import type { BaseApplication } from '../base-application/types.js';
2828
import { defaultHelpers as helpers } from '../../testing/index.js';
2929
import { shouldSupportFeatures } from '../../test/support/tests.js';
3030

31-
const { snakeCase } = lodash;
32-
3331
const __filename = fileURLToPath(import.meta.url);
3432
const __dirname = dirname(__filename);
3533

generators/base/generator.spec.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,13 @@
1919
import { basename, dirname } from 'path';
2020
import { fileURLToPath } from 'url';
2121
import { before, it, describe, expect, esmocha } from 'esmocha';
22-
import lodash from 'lodash';
22+
import { snakeCase } from 'lodash-es';
2323

2424
import EnvironmentBuilder from '../../cli/environment-builder.mjs';
2525
import BaseGenerator from './index.js';
2626
import { defaultHelpers as helpers } from '../../testing/index.js';
2727
import { getCommandHelpOutput, shouldSupportFeatures } from '../../test/support/tests.js';
2828

29-
const { snakeCase } = lodash;
30-
3129
const __filename = fileURLToPath(import.meta.url);
3230
const __dirname = dirname(__filename);
3331

generators/base/support/needles.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* limitations under the License.
1818
*/
1919
import assert from 'assert';
20-
import { escapeRegExp } from 'lodash-es';
20+
import { escapeRegExp, kebabCase } from 'lodash-es';
2121
import CoreGenerator from '../../base-core/index.js';
2222
import { CascatedEditFileCallback, EditFileCallback } from '../api.js';
2323
import { joinCallbacks } from './write-files.js';

generators/bootstrap-application-base/generator.spec.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,13 @@
1919
import { basename, dirname, join } from 'path';
2020
import { fileURLToPath } from 'url';
2121
import { before, it, describe, expect, beforeEach } from 'esmocha';
22-
import lodash from 'lodash';
22+
import { snakeCase } from 'lodash-es';
2323

2424
import Generator from './index.js';
2525
import { defaultHelpers as helpers, runResult } from '../../testing/index.js';
2626
import { shouldSupportFeatures } from '../../test/support/tests.js';
2727
import { parseChangelog } from '../base/support/timestamp.ts';
2828

29-
const { snakeCase } = lodash;
30-
3129
const __filename = fileURLToPath(import.meta.url);
3230
const __dirname = dirname(__filename);
3331

generators/bootstrap-application-client/generator.spec.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,12 @@
1919
import { basename, dirname, join } from 'path';
2020
import { fileURLToPath } from 'url';
2121
import { before, it, describe, expect } from 'esmocha';
22-
import lodash from 'lodash';
22+
import { snakeCase } from 'lodash-es';
2323

2424
import Generator from './index.js';
2525
import { defaultHelpers as helpers } from '../../testing/index.js';
2626
import { shouldSupportFeatures } from '../../test/support/tests.js';
2727

28-
const { snakeCase } = lodash;
29-
3028
const __filename = fileURLToPath(import.meta.url);
3129
const __dirname = dirname(__filename);
3230

generators/bootstrap-application-server/generator.spec.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,12 @@
1919
import { basename, dirname, join } from 'path';
2020
import { fileURLToPath } from 'url';
2121
import { before, it, describe, expect } from 'esmocha';
22-
import lodash from 'lodash';
22+
import { snakeCase } from 'lodash-es';
2323

2424
import Generator from './index.js';
2525
import { defaultHelpers as helpers } from '../../testing/index.js';
2626
import { shouldSupportFeatures } from '../../test/support/tests.js';
2727

28-
const { snakeCase } = lodash;
29-
3028
const __filename = fileURLToPath(import.meta.url);
3129
const __dirname = dirname(__filename);
3230

generators/bootstrap-application/generator.spec.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import { basename, dirname, join } from 'path';
2020
import { fileURLToPath } from 'url';
2121
import { before, it, describe, expect } from 'esmocha';
22-
import lodash from 'lodash';
22+
import { snakeCase } from 'lodash-es';
2323

2424
import Generator from './index.js';
2525
import { defaultHelpers as helpers, result as runResult } from '../../testing/index.js';
@@ -30,8 +30,6 @@ const {
3030
CommonDBTypes: { UUID },
3131
} = fieldTypes;
3232

33-
const { snakeCase } = lodash;
34-
3533
const __filename = fileURLToPath(import.meta.url);
3634
const __dirname = dirname(__filename);
3735

generators/bootstrap/generator.spec.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,11 @@
1919
import { basename, dirname } from 'path';
2020
import { fileURLToPath } from 'url';
2121
import { it, describe, expect } from 'esmocha';
22-
import lodash from 'lodash';
22+
import { snakeCase } from 'lodash-es';
2323

2424
import Generator from './index.js';
2525
import { shouldSupportFeatures } from '../../test/support/tests.js';
2626

27-
const { snakeCase } = lodash;
28-
2927
const __filename = fileURLToPath(import.meta.url);
3028
const __dirname = dirname(__filename);
3129

generators/ci-cd/generator.spec.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,11 @@
1919
import { basename, dirname } from 'path';
2020
import { fileURLToPath } from 'url';
2121
import { it, describe, expect } from 'esmocha';
22-
import lodash from 'lodash';
22+
import { snakeCase } from 'lodash-es';
2323

2424
import { shouldSupportFeatures, testBlueprintSupport } from '../../test/support/tests.js';
2525
import Generator from './index.js';
2626

27-
const { snakeCase } = lodash;
28-
2927
const __filename = fileURLToPath(import.meta.url);
3028
const __dirname = dirname(__filename);
3129

generators/client/generator.spec.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,14 @@
1919
import { basename, dirname, join } from 'path';
2020
import { fileURLToPath } from 'url';
2121
import assert from 'assert';
22-
import lodash from 'lodash';
22+
import { snakeCase } from 'lodash-es';
2323
import { before, it, describe, expect } from 'esmocha';
2424
import { shouldSupportFeatures, testBlueprintSupport, checkEnforcements } from '../../test/support/index.js';
2525
import Generator from './index.js';
2626
import { defaultHelpers as helpers, result } from '../../testing/index.js';
2727
import { testFrameworkTypes } from '../../jdl/jhipster/index.js';
2828
import { GENERATOR_CLIENT } from '../generator-list.js';
2929

30-
const { snakeCase } = lodash;
3130
const { CYPRESS } = testFrameworkTypes;
3231

3332
const __filename = fileURLToPath(import.meta.url);

generators/common/generator.spec.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,13 @@
1919
import { basename, dirname, join } from 'path';
2020
import { fileURLToPath } from 'url';
2121
import { before, it, describe, expect } from 'esmocha';
22-
import lodash from 'lodash';
22+
import { snakeCase } from 'lodash-es';
2323

2424
import { defaultHelpers as helpers, basicHelpers, runResult } from '../../testing/index.js';
2525
import { shouldSupportFeatures, testBlueprintSupport, checkEnforcements } from '../../test/support/index.js';
2626
import Generator from './index.js';
2727
import { GENERATOR_COMMON } from '../generator-list.js';
2828

29-
const { snakeCase } = lodash;
30-
3129
const __filename = fileURLToPath(import.meta.url);
3230
const __dirname = dirname(__filename);
3331

generators/cucumber/generator.spec.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
import { basename, dirname } from 'path';
22
import { fileURLToPath } from 'url';
33
import { before, it, describe, expect } from 'esmocha';
4-
import lodash from 'lodash';
4+
import { snakeCase } from 'lodash-es';
55

66
import { shouldSupportFeatures, testBlueprintSupport } from '../../test/support/tests.js';
77
import Generator from './index.js';
88
import { defaultHelpers as helpers, result } from '../../testing/index.js';
99

1010
import { GENERATOR_CUCUMBER } from '../generator-list.js';
1111

12-
const { snakeCase } = lodash;
13-
1412
const __filename = fileURLToPath(import.meta.url);
1513
const __dirname = dirname(__filename);
1614

generators/cypress/generator.spec.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import path, { basename, dirname } from 'path';
2020
import { fileURLToPath } from 'url';
2121
import { before, it, describe, after, expect } from 'esmocha';
22-
import lodash from 'lodash';
22+
import { snakeCase } from 'lodash-es';
2323
import { clientFrameworkTypes, testFrameworkTypes } from '../../jdl/jhipster/index.js';
2424
import { fromMatrix, extendMatrix, AuthenticationTypeMatrix, defaultHelpers as helpers } from '../../testing/index.js';
2525
import { shouldSupportFeatures, testBlueprintSupport, checkEnforcements } from '../../test/support/index.js';
@@ -28,7 +28,6 @@ import { GENERATOR_CYPRESS } from '../generator-list.js';
2828

2929
const { CYPRESS } = testFrameworkTypes;
3030
const { ANGULAR, REACT, VUE } = clientFrameworkTypes;
31-
const { snakeCase } = lodash;
3231

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

generators/docker-compose/generator.spec.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,11 @@
1919
import { basename, dirname } from 'path';
2020
import { fileURLToPath } from 'url';
2121
import { it, describe, expect } from 'esmocha';
22-
import lodash from 'lodash';
22+
import { snakeCase } from 'lodash-es';
2323

2424
import Generator from './index.js';
2525
import { shouldSupportFeatures } from '../../test/support/tests.js';
2626

27-
const { snakeCase } = lodash;
28-
2927
const __filename = fileURLToPath(import.meta.url);
3028
const __dirname = dirname(__filename);
3129

generators/docker/generator.spec.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import { basename, dirname, join } from 'path';
2020
import { fileURLToPath } from 'url';
2121
import { before, it, describe, expect } from 'esmocha';
22-
import lodash from 'lodash';
22+
import { snakeCase } from 'lodash-es';
2323

2424
import Generator from './index.js';
2525
import {
@@ -37,8 +37,6 @@ import { databaseTypes, searchEngineTypes, serviceDiscoveryTypes, cacheTypes } f
3737
import { MESSAGE_BROKER_KAFKA, MESSAGE_BROKER_NO, MESSAGE_BROKER_PULSAR } from '../server/options/message-broker.js';
3838
import { shouldSupportFeatures } from '../../test/support/tests.js';
3939

40-
const { snakeCase } = lodash;
41-
4240
const { CASSANDRA, COUCHBASE, MONGODB, NEO4J, MARIADB, MSSQL, MYSQL, ORACLE, POSTGRESQL } = databaseTypes;
4341
const { NO: NO_SEARCH_ENGINE, ELASTICSEARCH } = searchEngineTypes;
4442
const { NO: NO_SERVICE_DISCOVERY, EUREKA, CONSUL } = serviceDiscoveryTypes;

generators/entities/generator.spec.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,13 @@
1919
import { basename, dirname } from 'path';
2020
import { fileURLToPath } from 'url';
2121
import { before, it, describe, expect } from 'esmocha';
22-
import lodash from 'lodash';
22+
import { snakeCase } from 'lodash-es';
2323

2424
import { SERVER_MAIN_RES_DIR, SERVER_MAIN_SRC_DIR, CLIENT_MAIN_SRC_DIR } from '../generator-constants.js';
2525
import { shouldSupportFeatures, testBlueprintSupport } from '../../test/support/tests.js';
2626
import Generator from './generator.js';
2727
import { skipPrettierHelpers as helpers, result as runResult } from '../../testing/index.js';
2828

29-
const { snakeCase } = lodash;
3029
const __filename = fileURLToPath(import.meta.url);
3130
const __dirname = dirname(__filename);
3231
const generator = basename(__dirname);

generators/entity/generator.spec.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,11 @@
1919
import { basename, dirname } from 'path';
2020
import { fileURLToPath } from 'url';
2121
import { it, describe, expect } from 'esmocha';
22-
import lodash from 'lodash';
22+
import { snakeCase } from 'lodash-es';
2323

2424
import { shouldSupportFeatures, testBlueprintSupport } from '../../test/support/tests.js';
2525
import Generator from './index.js';
2626

27-
const { snakeCase } = lodash;
28-
2927
const __filename = fileURLToPath(import.meta.url);
3028
const __dirname = dirname(__filename);
3129

generators/export-jdl/generator.spec.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,11 @@
1919
import { basename, dirname } from 'path';
2020
import { fileURLToPath } from 'url';
2121
import { it, describe, expect } from 'esmocha';
22-
import lodash from 'lodash';
22+
import { snakeCase } from 'lodash-es';
2323

2424
import Generator from './index.js';
2525
import { shouldSupportFeatures } from '../../test/support/tests.js';
2626

27-
const { snakeCase } = lodash;
28-
2927
const __filename = fileURLToPath(import.meta.url);
3028
const __dirname = dirname(__filename);
3129

generators/gatling/generator.spec.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
import { basename, dirname } from 'path';
22
import { fileURLToPath } from 'url';
33
import { before, it, describe, expect } from 'esmocha';
4-
import lodash from 'lodash';
4+
import { snakeCase } from 'lodash-es';
55

66
import { shouldSupportFeatures, testBlueprintSupport } from '../../test/support/tests.js';
77
import Generator from './index.js';
88
import { defaultHelpers as helpers, result } from '../../testing/index.js';
99

1010
import { GENERATOR_GATLING } from '../generator-list.js';
1111

12-
const { snakeCase } = lodash;
13-
1412
const __filename = fileURLToPath(import.meta.url);
1513
const __dirname = dirname(__filename);
1614

generators/generate-blueprint/generator.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* limitations under the License.
1818
*/
1919
import chalk from 'chalk';
20-
import lodash from 'lodash';
20+
import { camelCase, upperFirst, snakeCase } from 'lodash-es';
2121

2222
import BaseGenerator from '../base/index.js';
2323
import { PRIORITY_NAMES_LIST as BASE_PRIORITY_NAMES_LIST } from '../base/priorities.js';
@@ -49,7 +49,6 @@ import { SKIP_COMMIT_HOOK } from '../init/constants.js';
4949
import command from './command.js';
5050
import { BLUEPRINT_API_VERSION, NODE_VERSION } from '../generator-constants.js';
5151

52-
const { camelCase, upperFirst, snakeCase } = lodash;
5352
const { GENERATOR_PROJECT_NAME, GENERATOR_INIT, GENERATOR_GENERATE_BLUEPRINT } = GENERATOR_LIST;
5453

5554
export default class extends BaseGenerator {

generators/generate-blueprint/generator.spec.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,12 @@
1919
import { basename, dirname, join } from 'path';
2020
import { fileURLToPath } from 'url';
2121
import { before, it, describe, expect } from 'esmocha';
22-
import lodash from 'lodash';
22+
import { snakeCase } from 'lodash-es';
2323

2424
import { defaultHelpers as helpers } from '../../testing/index.js';
2525
import { shouldSupportFeatures, testBlueprintSupport } from '../../test/support/tests.js';
2626
import Generator from './index.js';
2727

28-
const { snakeCase } = lodash;
29-
3028
const __filename = fileURLToPath(import.meta.url);
3129
const __dirname = dirname(__filename);
3230

0 commit comments

Comments
 (0)