diff --git a/.changeset/beige-kangaroos-try.md b/.changeset/beige-kangaroos-try.md new file mode 100644 index 0000000000..a643b92ec9 --- /dev/null +++ b/.changeset/beige-kangaroos-try.md @@ -0,0 +1,7 @@ +--- +'@alfalab/core-components-collapse': patch +'@alfalab/core-components-input-autocomplete': patch +'@alfalab/core-components-tabs': patch +--- + +- Замена использование lodash на коммон пакет diff --git a/.storybook/pages/components-overview/components/card/index.tsx b/.storybook/pages/components-overview/components/card/index.tsx index 5b352e0a6a..b7d8a956f6 100644 --- a/.storybook/pages/components-overview/components/card/index.tsx +++ b/.storybook/pages/components-overview/components/card/index.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import kebab from 'lodash.kebabcase'; import cn from 'classnames'; +import kebab from 'lodash/kebabCase'; import { Typography } from '@alfalab/core-components-typography'; diff --git a/.storybook/pages/components-overview/index.tsx b/.storybook/pages/components-overview/index.tsx index 7652931676..ab128ec892 100644 --- a/.storybook/pages/components-overview/index.tsx +++ b/.storybook/pages/components-overview/index.tsx @@ -1,5 +1,5 @@ import React, { useEffect, useState } from 'react'; -import _throttle from 'lodash.throttle'; +import _throttle from 'lodash/throttle'; import { Gap } from '@alfalab/core-components-gap'; import { Input, InputProps } from '@alfalab/core-components-input'; diff --git a/bin/generate-docs-urls.js b/bin/generate-docs-urls.js index fa8e29bed4..428a6c3403 100644 --- a/bin/generate-docs-urls.js +++ b/bin/generate-docs-urls.js @@ -1,8 +1,8 @@ const path = require('path'); const fs = require('fs'); const { promisify } = require('util'); -const camelCase = require('lodash.camelcase'); -const upperfirst = require('lodash.upperfirst'); +const { camelCase } = require('lodash/camelcase'); +const { upperfirst } = require('lodash/upperfirst'); const findComponentPath = require('../tools/storybook/findComponentPath'); const readDir = promisify(fs.readdir); diff --git a/package.json b/package.json index a2a4cbace4..c175768ae3 100644 --- a/package.json +++ b/package.json @@ -80,9 +80,7 @@ "hls.js": "^1.5.13", "intersection-observer": "^0.12.0", "libphonenumber-js": "^1.10.30", - "lodash.debounce": "^4.0.8", - "lodash.memoize": "^4.1.2", - "lodash.throttle": "^4.1.1", + "lodash": "^4.17.21", "mdast-util-gfm-strikethrough": "^0.2.3", "micromark-extension-gfm-strikethrough": "^0.6.5", "nouislider": "^15.6.0", @@ -129,10 +127,7 @@ "@types/element-closest": "^3.0.0", "@types/jest": "^26.0.15", "@types/jest-image-snapshot": "^6.1.0", - "@types/lodash.camelcase": "^4.3.6", - "@types/lodash.debounce": "^4.0.6", - "@types/lodash.kebabcase": "^4.1.6", - "@types/lodash.upperfirst": "^4.3.6", + "@types/lodash": "^4.17.13", "@types/node": "^13.5.0", "@types/react": "^18.0.15", "@types/react-dom": "^18.0.6", @@ -180,9 +175,6 @@ "lerna": "^6.1.0", "levenary": "^1.1.1", "lint-staged": "^12.5.0", - "lodash.camelcase": "^4.3.0", - "lodash.kebabcase": "^4.1.1", - "lodash.upperfirst": "^4.3.1", "mini-css-extract-plugin": "^2.7.5", "playwright": "^1.33.0", "postcss-cli": "^7.1.0", diff --git a/packages/collapse/package.json b/packages/collapse/package.json index 9a7a45f255..4bd6dcc09f 100644 --- a/packages/collapse/package.json +++ b/packages/collapse/package.json @@ -18,9 +18,12 @@ "@alfalab/icons-glyph": "^2.139.0", "@juggle/resize-observer": "^3.3.1", "classnames": "^2.5.1", - "lodash.debounce": "^4.0.8", + "lodash": "^4.17.21", "tslib": "^2.4.0" }, + "devDependencies": { + "@types/lodash": "^4.17.13" + }, "themesVersion": "13.6.0", "varsVersion": "9.16.0" } diff --git a/packages/collapse/src/Component.tsx b/packages/collapse/src/Component.tsx index 58aaa12930..9278b70953 100644 --- a/packages/collapse/src/Component.tsx +++ b/packages/collapse/src/Component.tsx @@ -1,7 +1,7 @@ import React, { forwardRef, useCallback, useEffect, useRef, useState } from 'react'; import { ResizeObserver as ResizeObserverPolyfill } from '@juggle/resize-observer'; import cn from 'classnames'; -import debounce from 'lodash.debounce'; +import debounce from 'lodash/debounce'; import { Link } from '@alfalab/core-components-link'; import { ChevronDownSIcon } from '@alfalab/icons-glyph/ChevronDownSIcon'; diff --git a/packages/input-autocomplete/package.json b/packages/input-autocomplete/package.json index 0b4ff8deca..d62b6d20d0 100644 --- a/packages/input-autocomplete/package.json +++ b/packages/input-autocomplete/package.json @@ -23,12 +23,12 @@ "@alfalab/core-components-mq": "^4.4.0", "@alfalab/hooks": "^1.13.0", "classnames": "^2.5.1", - "lodash.throttle": "^4.1.1", + "lodash": "^4.17.21", "react-merge-refs": "^1.1.0", "tslib": "^2.4.0" }, "devDependencies": { - "@types/lodash.throttle": "^4.1.7" + "@types/lodash": "^4.17.13" }, "themesVersion": "13.6.0", "varsVersion": "9.16.0" diff --git a/packages/input-autocomplete/src/mobile/Component.mobile.tsx b/packages/input-autocomplete/src/mobile/Component.mobile.tsx index 290d2a2ec0..f2ab632956 100644 --- a/packages/input-autocomplete/src/mobile/Component.mobile.tsx +++ b/packages/input-autocomplete/src/mobile/Component.mobile.tsx @@ -1,7 +1,7 @@ import React, { Ref, useMemo, useRef, useState } from 'react'; import mergeRefs from 'react-merge-refs'; import cn from 'classnames'; -import throttle from 'lodash.throttle'; +import throttle from 'lodash/throttle'; import { SelectMobile, diff --git a/packages/screenshot-utils/createStorybookUrl.ts b/packages/screenshot-utils/createStorybookUrl.ts index 0e51fbc4a9..b5cffe72a6 100644 --- a/packages/screenshot-utils/createStorybookUrl.ts +++ b/packages/screenshot-utils/createStorybookUrl.ts @@ -1,4 +1,4 @@ -import kebab from 'lodash.kebabcase'; +import kebab from 'lodash/kebabCase'; import findComponentPath from '../../tools/storybook/findComponentPath'; diff --git a/packages/screenshot-utils/helpers.ts b/packages/screenshot-utils/helpers.ts index f4b2e5252a..eb3b4859c9 100644 --- a/packages/screenshot-utils/helpers.ts +++ b/packages/screenshot-utils/helpers.ts @@ -14,7 +14,7 @@ import { } from 'playwright'; import axios from 'axios'; import { MatchImageSnapshotOptions } from 'jest-image-snapshot'; -import kebab from 'lodash.kebabcase'; +import kebab from 'lodash/kebabCase'; import { ScreenshotOpts, EvaluateFn } from './setupScreenshotTesting'; type CustomSnapshotIdentifierParams = { diff --git a/packages/tabs/package.json b/packages/tabs/package.json index 23b4b9efaa..447405ef11 100644 --- a/packages/tabs/package.json +++ b/packages/tabs/package.json @@ -11,7 +11,7 @@ "directory": "dist" }, "devDependencies": { - "@types/lodash.debounce": "^4.0.6" + "@types/lodash": "^4.17.13" }, "dependencies": { "@alfalab/core-components-keyboard-focusable": "^4.1.0", @@ -26,7 +26,7 @@ "@alfalab/icons-glyph": "^2.139.0", "classnames": "^2.5.1", "compute-scroll-into-view": "^3.1.0", - "lodash.debounce": "^4.0.8", + "lodash": "^4.17.21", "@juggle/resize-observer": "^3.3.1", "tslib": "^2.4.0" }, diff --git a/packages/tabs/src/components/scroll-controls/Component.tsx b/packages/tabs/src/components/scroll-controls/Component.tsx index dc8639a64c..b760f44545 100644 --- a/packages/tabs/src/components/scroll-controls/Component.tsx +++ b/packages/tabs/src/components/scroll-controls/Component.tsx @@ -1,6 +1,6 @@ import React, { forwardRef, RefObject, useEffect, useState } from 'react'; import cn from 'classnames'; -import _debounce from 'lodash.debounce'; +import _debounce from 'lodash/debounce'; import { IconButton } from '@alfalab/core-components-icon-button'; import { ChevronLeftCompactSIcon } from '@alfalab/icons-glyph/ChevronLeftCompactSIcon'; diff --git a/yarn.lock b/yarn.lock index 8fe29eaef2..09c83b62e4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5481,42 +5481,19 @@ resolved "https://registry.yarnpkg.com/@types/lockfile/-/lockfile-1.0.2.tgz#3f77e84171a2b7e3198bd5717c7547a54393baf8" integrity sha512-jD5VbvhfMhaYN4M3qPJuhMVUg3Dfc4tvPvLEAXn6GXbs/ajDFtCQahX37GIE65ipTI3I+hEvNaXS3MYAn9Ce3Q== -"@types/lodash.camelcase@^4.3.6": - version "4.3.6" - resolved "https://registry.npmjs.org/@types/lodash.camelcase/-/lodash.camelcase-4.3.6.tgz" - integrity sha512-hd/TEuPd76Jtf1xEq85CHbCqR+iqvs5IOKyrYbiaOg69BRQgPN9XkvLj8Jl8rBp/dfJ2wQ1AVcP8mZmybq7kIg== - dependencies: - "@types/lodash" "*" - -"@types/lodash.debounce@^4.0.6": - version "4.0.6" - resolved "https://registry.npmjs.org/@types/lodash.debounce/-/lodash.debounce-4.0.6.tgz" - integrity sha512-4WTmnnhCfDvvuLMaF3KV4Qfki93KebocUF45msxhYyjMttZDQYzHkO639ohhk8+oco2cluAFL3t5+Jn4mleylQ== - dependencies: - "@types/lodash" "*" - -"@types/lodash.kebabcase@^4.1.6": - version "4.1.6" - resolved "https://registry.npmjs.org/@types/lodash.kebabcase/-/lodash.kebabcase-4.1.6.tgz" - integrity sha512-+RAD9pCAa8kuVyCYTeDNiwBXwD/0u0p+hos3NSqD+tXTjJextbfF3farfYB+ssAKgEssoewXEtBsfwBpsI7gsA== - dependencies: - "@types/lodash" "*" - "@types/lodash.throttle@^4.1.7": - version "4.1.7" - resolved "https://registry.yarnpkg.com/@types/lodash.throttle/-/lodash.throttle-4.1.7.tgz#4ef379eb4f778068022310ef166625f420b6ba58" - integrity sha512-znwGDpjCHQ4FpLLx19w4OXDqq8+OvREa05H89obtSyXyOFKL3dDjCslsmfBz0T2FU8dmf5Wx1QvogbINiGIu9g== + version "4.1.9" + resolved "https://registry.yarnpkg.com/@types/lodash.throttle/-/lodash.throttle-4.1.9.tgz#f17a6ae084f7c0117bd7df145b379537bc9615c5" + integrity sha512-PCPVfpfueguWZQB7pJQK890F2scYKoDUL3iM522AptHWn7d5NQmeS/LTEHIcLr5PaTzl3dK2Z0xSUHHTHwaL5g== dependencies: "@types/lodash" "*" -"@types/lodash.upperfirst@^4.3.6": - version "4.3.6" - resolved "https://registry.npmjs.org/@types/lodash.upperfirst/-/lodash.upperfirst-4.3.6.tgz" - integrity sha512-op4ctKkT1eD/Nt8MCPlN7O2IQrYWIcH1rOPHM86SKzbliLG50eVXM6+qzkdxtBV7DZb3W/1Up2+k43WK9F0Bgg== - dependencies: - "@types/lodash" "*" +"@types/lodash@*", "@types/lodash@^4.17.13": + version "4.17.13" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.17.13.tgz#786e2d67cfd95e32862143abe7463a7f90c300eb" + integrity sha512-lfx+dftrEZcdBPczf9d0Qv0x+j/rfNCMuC6OcfXmO8gkfeNAY88PgKUbvG56whcN23gc27yenwF6oJZXGFpYxg== -"@types/lodash@*", "@types/lodash@^4.14.167": +"@types/lodash@^4.14.167": version "4.14.182" resolved "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.182.tgz" integrity sha512-/THyiqyQAP9AfARo4pF+aCGcyiQ94tX/Is2I7HofNRqoYLgN1PBoOWu2/zTA5zMxzP5EFutMtWtGAFRKUe961Q== @@ -14536,11 +14513,6 @@ lodash.uniq@^4.5.0: resolved "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz" integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= -lodash.upperfirst@^4.3.1: - version "4.3.1" - resolved "https://registry.npmjs.org/lodash.upperfirst/-/lodash.upperfirst-4.3.1.tgz" - integrity sha1-E2Xt9DFIBIHvDRxolXpe2Z1J984= - lodash@4.17.21, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.7.0: version "4.17.21" resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz"