Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove lodash #3419

Merged
merged 1 commit into from Nov 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions @commitlint/cli/package.json
Expand Up @@ -39,9 +39,12 @@
"devDependencies": {
"@commitlint/test": "^17.2.0",
"@commitlint/utils": "^17.0.0",
"@types/lodash.isfunction": "^3.0.7",
"@types/lodash.merge": "^4.6.7",
"@types/node": "^14.0.0",
"@types/yargs": "^17.0.0",
"fs-extra": "^10.0.0"
"fs-extra": "^10.0.0",
"lodash.merge": "^4.6.2"
},
"dependencies": {
"@commitlint/format": "^17.0.0",
Expand All @@ -50,7 +53,7 @@
"@commitlint/read": "^17.2.0",
"@commitlint/types": "^17.0.0",
"execa": "^5.0.0",
"lodash": "^4.17.19",
"lodash.isfunction": "^3.0.9",
"resolve-from": "5.0.0",
"resolve-global": "1.0.0",
"yargs": "^17.0.0"
Expand Down
2 changes: 1 addition & 1 deletion @commitlint/cli/src/cli.test.ts
@@ -1,7 +1,7 @@
import {fix, git} from '@commitlint/test';
import execa from 'execa';
import fs from 'fs-extra';
import merge from 'lodash/merge';
import merge from 'lodash.merge';
import path from 'path';

const bin = require.resolve('../cli.js');
Expand Down
2 changes: 1 addition & 1 deletion @commitlint/cli/src/cli.ts
Expand Up @@ -2,7 +2,7 @@ import execa, {ExecaError} from 'execa';
import load from '@commitlint/load';
import lint from '@commitlint/lint';
import read from '@commitlint/read';
import isFunction from 'lodash/isFunction';
import isFunction from 'lodash.isfunction';
import resolveFrom from 'resolve-from';
import resolveGlobal from 'resolve-global';
import yargs, {Arguments} from 'yargs';
Expand Down
2 changes: 1 addition & 1 deletion @commitlint/config-patternplate/index.js
@@ -1,6 +1,6 @@
const path = require('path');
const globby = require('globby');
const merge = require('lodash/merge');
const merge = require('lodash.merge');

function pathToId(root, filePath) {
const relativePath = path.relative(root, filePath);
Expand Down
5 changes: 3 additions & 2 deletions @commitlint/config-patternplate/package.json
Expand Up @@ -32,10 +32,11 @@
"dependencies": {
"@commitlint/config-angular": "^17.2.0",
"globby": "^11.0.0",
"lodash": "^4.17.19"
"lodash.merge": "^4.6.2"
},
"devDependencies": {
"@commitlint/utils": "^17.0.0"
"@commitlint/utils": "^17.0.0",
"@types/lodash.merge": "^4.6.7"
},
"gitHead": "d829bf6260304ca8d6811f329fcdd1b6c50e9749"
}
7 changes: 5 additions & 2 deletions @commitlint/cz-commitlint/package.json
Expand Up @@ -41,7 +41,7 @@
"@commitlint/load": "^17.2.0",
"@commitlint/types": "^17.0.0",
"chalk": "^4.1.0",
"lodash": "^4.17.21",
"lodash.isplainobject": "^4.0.6",
"word-wrap": "^1.2.3"
},
"peerDependencies": {
Expand All @@ -50,6 +50,9 @@
},
"devDependencies": {
"@types/inquirer": "^8.0.0",
"commitizen": "^4.2.4"
"@types/lodash.isfunction": "^3.0.7",
"@types/lodash.isplainobject": "^4.0.7",
"commitizen": "^4.2.4",
"lodash.isfunction": "^3.0.9"
}
}
2 changes: 1 addition & 1 deletion @commitlint/cz-commitlint/src/Process.test.ts
@@ -1,6 +1,6 @@
import {QualifiedRules, UserPromptConfig} from '@commitlint/types';
import {Answers, DistinctQuestion} from 'inquirer';
import isFunction from 'lodash/isFunction';
import isFunction from 'lodash.isfunction';
import process from './Process';

const mockShowTitle = jest.fn();
Expand Down
2 changes: 1 addition & 1 deletion @commitlint/cz-commitlint/src/store/prompts.ts
@@ -1,5 +1,5 @@
import {PromptConfig, UserPromptConfig} from '@commitlint/types';
import isPlainObject from 'lodash/isPlainObject';
import isPlainObject from 'lodash.isplainobject';
import defaultPromptConfigs from './defaultPromptConfigs';

const storeKey = Symbol('promptConfig');
Expand Down
12 changes: 10 additions & 2 deletions @commitlint/ensure/package.json
Expand Up @@ -36,12 +36,20 @@
"license": "MIT",
"devDependencies": {
"@commitlint/utils": "^17.0.0",
"@types/lodash": "^4.14.161",
"@types/lodash.camelcase": "^4.3.7",
"@types/lodash.kebabcase": "^4.1.7",
"@types/lodash.snakecase": "^4.1.7",
"@types/lodash.startcase": "^4.4.7",
"@types/lodash.upperfirst": "^4.3.7",
"globby": "^11.0.0"
},
"dependencies": {
"@commitlint/types": "^17.0.0",
"lodash": "^4.17.19"
"lodash.camelcase": "^4.3.0",
"lodash.kebabcase": "^4.1.1",
"lodash.snakecase": "^4.1.1",
"lodash.startcase": "^4.4.0",
"lodash.upperfirst": "^4.3.1"
},
"gitHead": "d829bf6260304ca8d6811f329fcdd1b6c50e9749"
}
2 changes: 1 addition & 1 deletion @commitlint/ensure/src/index.test.ts
@@ -1,6 +1,6 @@
import path from 'path';
import globby from 'globby';
import camelCase from 'lodash/camelCase';
import camelCase from 'lodash.camelcase';
import * as ensure from '.';

test('exports all checkers', async () => {
Expand Down
10 changes: 5 additions & 5 deletions @commitlint/ensure/src/to-case.ts
@@ -1,9 +1,9 @@
import {TargetCaseType} from '@commitlint/types';
import camelCase from 'lodash/camelCase';
import kebabCase from 'lodash/kebabCase';
import snakeCase from 'lodash/snakeCase';
import upperFirst from 'lodash/upperFirst';
import startCase from 'lodash/startCase';
import camelCase from 'lodash.camelcase';
import kebabCase from 'lodash.kebabcase';
import snakeCase from 'lodash.snakecase';
import upperFirst from 'lodash.upperfirst';
import startCase from 'lodash.startcase';

export default function toCase(input: string, target: TargetCaseType): string {
switch (target) {
Expand Down
8 changes: 6 additions & 2 deletions @commitlint/load/package.json
Expand Up @@ -37,7 +37,9 @@
"devDependencies": {
"@commitlint/test": "^17.2.0",
"@commitlint/utils": "^17.0.0",
"@types/lodash": "4.14.185",
"@types/lodash.isplainobject": "^4.0.7",
"@types/lodash.merge": "^4.6.7",
"@types/lodash.uniq": "^4.5.7",
"conventional-changelog-atom": "^2.0.8",
"execa": "^5.0.0"
},
Expand All @@ -50,7 +52,9 @@
"chalk": "^4.1.0",
"cosmiconfig": "^7.0.0",
"cosmiconfig-typescript-loader": "^4.0.0",
"lodash": "^4.17.19",
"lodash.isplainobject": "^4.0.6",
"lodash.merge": "^4.6.2",
"lodash.uniq": "^4.5.0",
"resolve-from": "^5.0.0",
"ts-node": "^10.8.1",
"typescript": "^4.6.4"
Expand Down
6 changes: 3 additions & 3 deletions @commitlint/load/src/load.ts
Expand Up @@ -8,9 +8,9 @@ import {
PluginRecords,
UserConfig,
} from '@commitlint/types';
import isPlainObject from 'lodash/isPlainObject';
import merge from 'lodash/merge';
import uniq from 'lodash/uniq';
import isPlainObject from 'lodash.isplainobject';
import merge from 'lodash.merge';
import uniq from 'lodash.uniq';
import Path from 'path';
import resolveFrom from 'resolve-from';
import {loadConfig} from './utils/load-config';
Expand Down
3 changes: 1 addition & 2 deletions @commitlint/prompt/package.json
Expand Up @@ -49,8 +49,7 @@
"@commitlint/load": "^17.2.0",
"@commitlint/types": "^17.0.0",
"chalk": "^4.1.0",
"inquirer": "^6.5.2",
"lodash": "^4.17.19"
"inquirer": "^6.5.2"
},
"gitHead": "70f7f4688b51774e7ac5e40e896cdaa3f132b2bc"
}
4 changes: 2 additions & 2 deletions @commitlint/resolve-extends/package.json
Expand Up @@ -36,13 +36,13 @@
"license": "MIT",
"devDependencies": {
"@commitlint/utils": "^17.0.0",
"@types/lodash": "^4.14.161"
"@types/lodash.mergewith": "^4.6.7"
},
"dependencies": {
"@commitlint/config-validator": "^17.1.0",
"@commitlint/types": "^17.0.0",
"import-fresh": "^3.0.0",
"lodash": "^4.17.19",
"lodash.mergewith": "^4.6.2",
"resolve-from": "^5.0.0",
"resolve-global": "^1.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion @commitlint/resolve-extends/src/index.ts
Expand Up @@ -2,7 +2,7 @@ import path from 'path';

import 'resolve-global';
import resolveFrom from 'resolve-from';
import mergeWith from 'lodash/mergeWith';
import mergeWith from 'lodash.mergewith';
import {validateConfig} from '@commitlint/config-validator';
import {UserConfig} from '@commitlint/types';

Expand Down
3 changes: 0 additions & 3 deletions package.json
Expand Up @@ -102,8 +102,5 @@
"lint-staged": "13.0.3",
"prettier": "^2.0.5",
"typescript": "^4.6.4"
},
"resolutions": {
"**/lodash": "^4.17.19"
}
}
125 changes: 120 additions & 5 deletions yarn.lock
Expand Up @@ -2286,10 +2286,80 @@
resolved "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee"
integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==

"@types/lodash@4.14.185", "@types/lodash@^4.14.161":
version "4.14.185"
resolved "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.185.tgz#c9843f5a40703a8f5edfd53358a58ae729816908"
integrity sha512-evMDG1bC4rgQg4ku9tKpuMh5iBNEwNa3tf9zRHdP1qlv+1WUg44xat4IxCE14gIpZRGUUWAx2VhItCZc25NfMA==
"@types/lodash.camelcase@^4.3.7":
version "4.3.7"
resolved "https://registry.npmjs.org/@types/lodash.camelcase/-/lodash.camelcase-4.3.7.tgz#b0a06a216542335c0326c0d2fbad3f121b1f29a7"
integrity sha512-Nfi6jpo9vuEOSIJP+mpbTezKyEt75DQlbwjiDvs/JctWkbnHDoyQo5lWqdvgNiJmVUjcmkfvlrvSEgJYvurOKg==
dependencies:
"@types/lodash" "*"

"@types/lodash.isfunction@^3.0.7":
version "3.0.7"
resolved "https://registry.npmjs.org/@types/lodash.isfunction/-/lodash.isfunction-3.0.7.tgz#a4be875f62bea0d3e52ffb72d5276314ff4ed99b"
integrity sha512-kpYexfS7OvD8Gb74F2ogdHVbeWpYsiP8cadpIBBbJivG0i7kQ0xEn3V78jhFiJN6HfZhggWhbP659+HYMnFFHw==
dependencies:
"@types/lodash" "*"

"@types/lodash.isplainobject@^4.0.7":
version "4.0.7"
resolved "https://registry.npmjs.org/@types/lodash.isplainobject/-/lodash.isplainobject-4.0.7.tgz#698e3231341b1aa0a16681e7aa8b10ee6d9a7d8c"
integrity sha512-fdHtdjpy7fXydEaRHx1dPa+2AVmLbmk2Gv7f0w/90BKCH0DkWo8pIrzygnB3rvgo6oKNb3cO9VaPpj9GLCr5Ug==
dependencies:
"@types/lodash" "*"

"@types/lodash.kebabcase@^4.1.7":
version "4.1.7"
resolved "https://registry.npmjs.org/@types/lodash.kebabcase/-/lodash.kebabcase-4.1.7.tgz#eb2d1162c669ecbc77f9912a31e952563848deff"
integrity sha512-qzrcpK5uiADZ9OyZaegalM0b9Y3WetoBQ04RAtP3xZFGC5ul1UxmbjZ3j6suCh0BDkvgQmoMh8t5e9cVrdJYMw==
dependencies:
"@types/lodash" "*"

"@types/lodash.merge@^4.6.7":
version "4.6.7"
resolved "https://registry.npmjs.org/@types/lodash.merge/-/lodash.merge-4.6.7.tgz#0af6555dd8bc6568ef73e5e0d820a027362946b1"
integrity sha512-OwxUJ9E50gw3LnAefSHJPHaBLGEKmQBQ7CZe/xflHkyy/wH2zVyEIAKReHvVrrn7zKdF58p16We9kMfh7v0RRQ==
dependencies:
"@types/lodash" "*"

"@types/lodash.mergewith@^4.6.7":
version "4.6.7"
resolved "https://registry.npmjs.org/@types/lodash.mergewith/-/lodash.mergewith-4.6.7.tgz#eaa65aa5872abdd282f271eae447b115b2757212"
integrity sha512-3m+lkO5CLRRYU0fhGRp7zbsGi6+BZj0uTVSwvcKU+nSlhjA9/QRNfuSGnD2mX6hQA7ZbmcCkzk5h4ZYGOtk14A==
dependencies:
"@types/lodash" "*"

"@types/lodash.snakecase@^4.1.7":
version "4.1.7"
resolved "https://registry.npmjs.org/@types/lodash.snakecase/-/lodash.snakecase-4.1.7.tgz#2a1ca7cbc08b63e7c3708f6291222e69b0d3216d"
integrity sha512-nv9M+JJokFyfZ9QmaWVXZu2DfT40K0GictZaA8SwXczp3oCzMkjp7PtvUBQyvdoG9SnlCpoRXZDIVwQRzJbd9A==
dependencies:
"@types/lodash" "*"

"@types/lodash.startcase@^4.4.7":
version "4.4.7"
resolved "https://registry.npmjs.org/@types/lodash.startcase/-/lodash.startcase-4.4.7.tgz#69857f17be0aa5ce74da4fa386e32e22c012258a"
integrity sha512-6v8FVOcfxdomO1Vammc1Zsah7/4aif/Lx16oQQ0WZmKVGF/Yf5c5m68LqI/ELOhKaKUr8KfnDdKrytdrThoRQw==
dependencies:
"@types/lodash" "*"

"@types/lodash.uniq@^4.5.7":
version "4.5.7"
resolved "https://registry.npmjs.org/@types/lodash.uniq/-/lodash.uniq-4.5.7.tgz#0773960ec0148b29e6a54821a65b878a0ebb5c1a"
integrity sha512-qg7DeAbdZMi6DGvCxThlJycykLLhETrJrQZ6F2KaZ+o0sNK1qRHz46lgNA+nHHjwrmA2a91DyiZTp3ey3m1rEw==
dependencies:
"@types/lodash" "*"

"@types/lodash.upperfirst@^4.3.7":
version "4.3.7"
resolved "https://registry.npmjs.org/@types/lodash.upperfirst/-/lodash.upperfirst-4.3.7.tgz#4c19bb87fbeedc13f182c9042f5b61e323d32993"
integrity sha512-CrBjoB4lO6h7tXNMBUl1eh/w0KdMosiEOXOoD5DMECsA/kDWo/WQfOt1KyGKVvgwK3I6cKAY6z8LymKiMazLFg==
dependencies:
"@types/lodash" "*"

"@types/lodash@*":
version "4.14.188"
resolved "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.188.tgz#e4990c4c81f7c9b00c5ff8eae389c10f27980da5"
integrity sha512-zmEmF5OIM3rb7SbLCFYoQhO4dGt2FRM9AMkxvA3LaADOF1n8in/zGJlWji9fmafLoNyz+FoL6FE0SLtGIArD7w==

"@types/minimatch@^3.0.3":
version "3.0.5"
Expand Down Expand Up @@ -6014,11 +6084,31 @@ locate-path@^6.0.0:
dependencies:
p-locate "^5.0.0"

lodash.camelcase@^4.3.0:
version "4.3.0"
resolved "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6"
integrity sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==

lodash.isfunction@^3.0.9:
version "3.0.9"
resolved "https://registry.npmjs.org/lodash.isfunction/-/lodash.isfunction-3.0.9.tgz#06de25df4db327ac931981d1bdb067e5af68d051"
integrity sha512-AirXNj15uRIMMPihnkInB4i3NHeb4iBtNg9WRWuK2o31S+ePwwNmDPaTL3o7dTJ+VXNZim7rFs4rxN4YU1oUJw==

lodash.ismatch@^4.4.0:
version "4.4.0"
resolved "https://registry.npmjs.org/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz#756cb5150ca3ba6f11085a78849645f188f85f37"
integrity sha512-fPMfXjGQEV9Xsq/8MTSgUf255gawYRbjwMyDbcvDhXgV7enSZA0hynz6vMPnpAb5iONEzBHBPsT+0zes5Z301g==

lodash.isplainobject@^4.0.6:
version "4.0.6"
resolved "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz#7c526a52d89b45c45cc690b88163be0497f550cb"
integrity sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==

lodash.kebabcase@^4.1.1:
version "4.1.1"
resolved "https://registry.npmjs.org/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz#8489b1cb0d29ff88195cceca448ff6d6cc295c36"
integrity sha512-N8XRTIMMqqDgSy4VLKPnJ/+hpGZN+PHQiJnSenYqPaVV/NCqEogTnAdZLQiGKhxX+JCs8waWq2t1XHWKOmlY8g==

lodash.map@^4.5.1:
version "4.6.0"
resolved "https://registry.npmjs.org/lodash.map/-/lodash.map-4.6.0.tgz#771ec7839e3473d9c4cde28b19394c3562f4f6d3"
Expand All @@ -6029,7 +6119,32 @@ lodash.merge@^4.6.2:
resolved "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a"
integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==

lodash@4.17.21, lodash@^4.17.12, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.21:
lodash.mergewith@^4.6.2:
version "4.6.2"
resolved "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.2.tgz#617121f89ac55f59047c7aec1ccd6654c6590f55"
integrity sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ==

lodash.snakecase@^4.1.1:
version "4.1.1"
resolved "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz#39d714a35357147837aefd64b5dcbb16becd8f8d"
integrity sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==

lodash.startcase@^4.4.0:
version "4.4.0"
resolved "https://registry.npmjs.org/lodash.startcase/-/lodash.startcase-4.4.0.tgz#9436e34ed26093ed7ffae1936144350915d9add8"
integrity sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==

lodash.uniq@^4.5.0:
version "4.5.0"
resolved "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"
integrity sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==

lodash.upperfirst@^4.3.1:
version "4.3.1"
resolved "https://registry.npmjs.org/lodash.upperfirst/-/lodash.upperfirst-4.3.1.tgz#1365edf431480481ef0d1c68957a5ed99d49f7ce"
integrity sha512-sReKOYJIJf74dhJONhU4e0/shzi1trVbSWDOhKYE5XV2O+H7Sb2Dihwuc7xWxVl+DgFPyTqIN3zMfT9cq5iWDg==

lodash@4.17.21, lodash@^4.17.12, lodash@^4.17.15, lodash@^4.17.21:
version "4.17.21"
resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
Expand Down