Skip to content

Commit

Permalink
feat: move to common lodash package; (#1477)
Browse files Browse the repository at this point in the history
* feat: move to common lodash package;

* feat: add sideeffects;

* fix: code;

* fix: require named;

* fix: rollback scrollbar (old vendor inside);

* fix: rollback code;

* fix: rollback code;

* fix: imports;

* fix: imports;

* Update beige-kangaroos-try.md

Change minor -> patch
  • Loading branch information
denisx authored Dec 11, 2024
1 parent be81fb2 commit 88afc0d
Show file tree
Hide file tree
Showing 14 changed files with 34 additions and 60 deletions.
7 changes: 7 additions & 0 deletions .changeset/beige-kangaroos-try.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@alfalab/core-components-collapse': patch
'@alfalab/core-components-input-autocomplete': patch
'@alfalab/core-components-tabs': patch
---

- Замена использование lodash на коммон пакет
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
2 changes: 1 addition & 1 deletion .storybook/pages/components-overview/index.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
4 changes: 2 additions & 2 deletions bin/generate-docs-urls.js
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
12 changes: 2 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
5 changes: 4 additions & 1 deletion packages/collapse/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
2 changes: 1 addition & 1 deletion packages/collapse/src/Component.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
4 changes: 2 additions & 2 deletions packages/input-autocomplete/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
2 changes: 1 addition & 1 deletion packages/screenshot-utils/createStorybookUrl.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import kebab from 'lodash.kebabcase';
import kebab from 'lodash/kebabCase';

import findComponentPath from '../../tools/storybook/findComponentPath';

Expand Down
2 changes: 1 addition & 1 deletion packages/screenshot-utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
4 changes: 2 additions & 2 deletions packages/tabs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/tabs/src/components/scroll-controls/Component.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
44 changes: 8 additions & 36 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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==
Expand Down Expand Up @@ -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=

[email protected], 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"
Expand Down

0 comments on commit 88afc0d

Please sign in to comment.