Skip to content

Commit

Permalink
Upgrade lodash to latest (#6832)
Browse files Browse the repository at this point in the history
Upgrade lodash to latest
  • Loading branch information
ndelangen authored May 20, 2019
2 parents f65773f + 1bb3f22 commit 5994174
Show file tree
Hide file tree
Showing 14 changed files with 82 additions and 82 deletions.
24 changes: 24 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,30 @@ module.exports = {
'html/html-extensions': ['.html'],
},
rules: {
'no-restricted-imports': [
error,
{
paths: [
{
name: 'lodash.isequal',
message:
'Lodash modularised (and lodash < 4.17.11) have CVE vulnerabilities. Please use tree-shakeable imports like lodash/xxx instead',
},
{
name: 'lodash.mergewith',
message:
'Lodash modularised (and lodash < 4.17.11) have CVE vulnerabilities. Please use tree-shakeable imports like lodash/xxx instead',
},
{
name: 'lodash.pick',
message:
'Lodash modularised (and lodash < 4.17.11) have CVE vulnerabilities. Please use tree-shakeable imports like lodash/xxx instead',
},
],
// catch-all for any lodash modularised. The CVE is listed against the entire family for lodash < 4.17.11
patterns: ['lodash.*'],
},
],
'prettier/prettier': [warn],
'no-debugger': process.env.NODE_ENV === 'production' ? error : ignore,
'class-methods-use-this': ignore,
Expand Down
2 changes: 1 addition & 1 deletion addons/knobs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"escape-html": "^1.0.3",
"fast-deep-equal": "^2.0.1",
"global": "^4.3.2",
"lodash.debounce": "^4.0.8",
"lodash": "^4.17.11",
"prop-types": "^15.7.2",
"qs": "^6.6.0",
"react-color": "^2.17.0",
Expand Down
2 changes: 1 addition & 1 deletion addons/knobs/src/registerKnobs.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import addons from '@storybook/addons';
import { STORY_CHANGED, FORCE_RE_RENDER, REGISTER_SUBSCRIPTION } from '@storybook/core-events';
import debounce from 'lodash.debounce';
import debounce from 'lodash/debounce';

import KnobManager from './KnobManager';
import { CHANGE, CLICK, RESET, SET } from './shared';
Expand Down
8 changes: 2 additions & 6 deletions lib/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@
"core-js": "^3.0.1",
"fast-deep-equal": "^2.0.1",
"global": "^4.3.2",
"lodash.isequal": "^4.5.0",
"lodash.mergewith": "^4.6.1",
"lodash.pick": "^4.4.0",
"lodash": "^4.17.11",
"memoizerific": "^1.11.3",
"prop-types": "^15.6.2",
"react": "^16.7.0",
Expand All @@ -41,9 +39,7 @@
"util-deprecate": "^1.0.2"
},
"devDependencies": {
"@types/lodash.isequal": "^4.5.3",
"@types/lodash.mergewith": "^4.6.4",
"@types/lodash.pick": "^4.4.4",
"@types/lodash": "^4.14.129",
"@types/semver": "^6.0.0"
},
"publishConfig": {
Expand Down
4 changes: 2 additions & 2 deletions lib/api/src/lib/merge.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import mergeWith from 'lodash.mergewith';
import isEqual from 'lodash.isequal';
import mergeWith from 'lodash/mergeWith';
import isEqual from 'lodash/isEqual';

import { logger } from '@storybook/client-logger';

Expand Down
2 changes: 1 addition & 1 deletion lib/api/src/modules/layout.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { document } from 'global';
import pick from 'lodash.pick';
import pick from 'lodash/pick';

import deprecate from 'util-deprecate';
import deepEqual from 'fast-deep-equal';
Expand Down
2 changes: 1 addition & 1 deletion lib/cli/test/test_latest_cra.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ rm -rfd cra-fixtures
mkdir cra-fixtures
cd cra-fixtures

npx create-react-app react-scripts-latest-fixture
npx create-react-app react-scripts-latest-fixture --use-npm

cd ..
./run_tests.sh -f cra-fixtures $@
4 changes: 1 addition & 3 deletions lib/client-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@
"eventemitter3": "^3.1.0",
"global": "^4.3.2",
"is-plain-object": "^3.0.0",
"lodash.debounce": "^4.0.8",
"lodash.isequal": "^4.5.0",
"lodash.mergewith": "^4.6.1",
"lodash": "^4.17.11",
"memoizerific": "^1.11.3",
"qs": "^6.6.0"
},
Expand Down
4 changes: 2 additions & 2 deletions lib/client-api/src/client_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import addons from '@storybook/addons';
import Events from '@storybook/core-events';
import { toId } from '@storybook/router/utils';

import mergeWith from 'lodash.mergewith';
import isEqual from 'lodash.isequal';
import mergeWith from 'lodash/mergeWith';
import isEqual from 'lodash/isEqual';

import subscriptionsStore from './subscriptions_store';

Expand Down
2 changes: 1 addition & 1 deletion lib/client-api/src/story_store.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { history, document } from 'global';
import qs from 'qs';
import EventEmitter from 'eventemitter3';
import memoize from 'memoizerific';
import debounce from 'lodash.debounce';
import debounce from 'lodash/debounce';
import { stripIndents } from 'common-tags';

import Events from '@storybook/core-events';
Expand Down
5 changes: 1 addition & 4 deletions lib/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@
"fast-deep-equal": "^2.0.1",
"fuse.js": "^3.4.4",
"global": "^4.3.2",
"lodash.debounce": "^4.0.8",
"lodash.isequal": "^4.5.0",
"lodash.mergewith": "^4.6.1",
"lodash.pick": "^4.4.0",
"lodash": "^4.17.11",
"markdown-to-jsx": "^6.9.3",
"memoizerific": "^1.11.3",
"polished": "^3.3.1",
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/src/components/layout/persist.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import store from 'store2';
import debounce from 'lodash.debounce';
import debounce from 'lodash/debounce';
import memoize from 'memoizerific';

export const get = () => {
Expand Down
4 changes: 2 additions & 2 deletions lib/ui/src/libs/merge.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import mergeWith from 'lodash.mergewith';
import isEqual from 'lodash.isequal';
import mergeWith from 'lodash/mergeWith';
import isEqual from 'lodash/isEqual';

import { logger } from '@storybook/client-logger';

Expand Down
99 changes: 42 additions & 57 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3504,27 +3504,6 @@
resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee"
integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4=

"@types/lodash.isequal@^4.5.3":
version "4.5.5"
resolved "https://registry.yarnpkg.com/@types/lodash.isequal/-/lodash.isequal-4.5.5.tgz#4fed1b1b00bef79e305de0352d797e9bb816c8ff"
integrity sha512-4IKbinG7MGP131wRfceK6W4E/Qt3qssEFLF30LnJbjYiSfHGGRU/Io8YxXrZX109ir+iDETC8hw8QsDijukUVg==
dependencies:
"@types/lodash" "*"

"@types/lodash.mergewith@^4.6.4":
version "4.6.6"
resolved "https://registry.yarnpkg.com/@types/lodash.mergewith/-/lodash.mergewith-4.6.6.tgz#c4698f5b214a433ff35cb2c75ee6ec7f99d79f10"
integrity sha512-RY/8IaVENjG19rxTZu9Nukqh0W2UrYgmBj5sdns4hWRZaV8PqR7wIKHFKzvOTjo4zVRV7sVI+yFhAJql12Kfqg==
dependencies:
"@types/lodash" "*"

"@types/lodash.pick@^4.4.4":
version "4.4.6"
resolved "https://registry.yarnpkg.com/@types/lodash.pick/-/lodash.pick-4.4.6.tgz#ae4e8f109e982786313bb6aac4b1a73aefa6e9be"
integrity sha512-u8bzA16qQ+8dY280z3aK7PoWb3fzX5ATJ0rJB6F+uqchOX2VYF02Aqa+8aYiHiHgPzQiITqCgeimlyKFy4OA6g==
dependencies:
"@types/lodash" "*"

"@types/lodash.zipobject@^4.1.4":
version "4.1.6"
resolved "https://registry.yarnpkg.com/@types/lodash.zipobject/-/lodash.zipobject-4.1.6.tgz#75e140f44ac7d7682a18d3aae8ee4594fad094d7"
Expand Down Expand Up @@ -3620,9 +3599,9 @@
"@types/react" "*"

"@types/react-native@^0.57.57":
version "0.57.57"
resolved "https://registry.yarnpkg.com/@types/react-native/-/react-native-0.57.57.tgz#4b59068acf6e542ac8e1e02e8a639b47e3e02c02"
integrity sha512-OZyBlMyMeU3gXAmc1nnJhlWGihWUOiVR5Tj0y4TAA0rkKKHJwuNPPba6aaFmEaNcoZ9ejc3G30H+dneDOqICdg==
version "0.57.58"
resolved "https://registry.yarnpkg.com/@types/react-native/-/react-native-0.57.58.tgz#630258e10497772dbbfdf813205d38b76b54fa2a"
integrity sha512-SshKU18ajdpQQ5RZrHyUTI3e++pMo4fcrWnnbGFjzgp5ykYhbfUQ005Q93a/UV9ObsAmRppHVuq11d3b4tiDug==
dependencies:
"@types/prop-types" "*"
"@types/react" "*"
Expand Down Expand Up @@ -7613,7 +7592,7 @@ browserslist@^3.2.6:
caniuse-lite "^1.0.30000844"
electron-to-chromium "^1.3.47"

browserslist@^4.0.0, browserslist@^4.1.1, browserslist@^4.3.4, browserslist@^4.3.5, browserslist@^4.4.1, browserslist@^4.4.2, browserslist@^4.5.2, browserslist@^4.5.4:
browserslist@^4.0.0, browserslist@^4.1.1, browserslist@^4.3.4, browserslist@^4.3.5, browserslist@^4.4.1, browserslist@^4.4.2, browserslist@^4.5.2, browserslist@^4.5.4, browserslist@^4.6.0:
version "4.6.0"
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.6.0.tgz#5274028c26f4d933d5b1323307c1d1da5084c9ff"
integrity sha512-Jk0YFwXBuMOOol8n6FhgkDzn3mY9PYLYGk29zybF05SbRTsMgPqmTNeQQhOghCxq5oFqAXE3u4sYddr4C0uRhg==
Expand Down Expand Up @@ -9147,26 +9126,25 @@ copy-webpack-plugin@^5.0.0:
webpack-log "^2.0.0"

core-js-compat@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.0.1.tgz#bff73ba31ca8687431b9c88f78d3362646fb76f0"
integrity sha512-2pC3e+Ht/1/gD7Sim/sqzvRplMiRnFQVlPpDVaHtY9l7zZP7knamr3VRD6NyGfHd84MrDC0tAM9ulNxYMW0T3g==
version "3.1.0"
resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.1.0.tgz#340492a001d81100812e0f6e874ee6e21639ae92"
integrity sha512-v8M7YAMacMOJ4T4Z9QSud3dFYASMDvK9d2RWBHRSJlO4nGboLQVtFdbDmgzxfM7XrvcvO56L0sHcqGjuk/4wTQ==
dependencies:
browserslist "^4.5.4"
core-js "3.0.1"
core-js-pure "3.0.1"
browserslist "^4.6.0"
core-js-pure "3.1.0"
semver "^6.0.0"

core-js-pure@3.0.1, core-js-pure@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.0.1.tgz#37358fb0d024e6b86d443d794f4e37e949098cbe"
integrity sha512-mSxeQ6IghKW3MoyF4cz19GJ1cMm7761ON+WObSyLfTu/Jn3x7w4NwNFnrZxgl4MTSvYYepVLNuRtlB4loMwJ5g==
core-js-pure@3.1.0, core-js-pure@^3.0.1:
version "3.1.0"
resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.1.0.tgz#5e12e66435df4f2cc7df84cc891350aaeb66d0f0"
integrity sha512-9NxJBUp8p35vrBbEhQl+FvKbYY68fELWld0asAXMnfWl9xRrN472mw/n+ZvmnG0fYh4U7agPcJZ7iqcJW5R9Rg==

[email protected]:
version "2.6.4"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.4.tgz#b8897c062c4d769dd30a0ac5c73976c47f92ea0d"
integrity sha512-05qQ5hXShcqGkPZpXEFLIpxayZscVD2kuMBZewxiIPPEagukO4mqgPA9CWhUvFBJfy3ODdK2p9xyHh7FTU9/7A==

[email protected], core-js@^3.0.0, core-js@^3.0.1:
[email protected]:
version "3.0.1"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.0.1.tgz#1343182634298f7f38622f95e73f54e48ddf4738"
integrity sha512-sco40rF+2KlE0ROMvydjkrVMMG1vYilP2ALoRXcYR4obqbYIuV3Bg+51GEDW+HF8n7NRA+iaA4qD0nD9lo9mew==
Expand All @@ -9177,9 +9155,14 @@ core-js@^1.0.0:
integrity sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY=

core-js@^2.2.2, core-js@^2.4.0, core-js@^2.4.1, core-js@^2.5.0, core-js@^2.5.7, core-js@^2.6.5:
version "2.6.5"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.5.tgz#44bc8d249e7fb2ff5d00e0341a7ffb94fbf67895"
integrity sha512-klh/kDpwX8hryYL14M9w/xei6vrv6sE8gTHDG7/T/+SEovB/G4ejwcfE/CBzO6Edsu+OETZMZ3wcX/EjUkrl5A==
version "2.6.6"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.6.tgz#00eb6d6bf815471cc16d8563edd7d38786dec50b"
integrity sha512-Mt/LaAym54NXnrjEMdo918cT2h70tqb/Yl7T3uPHQHRm5SxVoqlKmerUy4mL11k8saSBDWQ7ULIHxmeFyT3pfg==

core-js@^3.0.0, core-js@^3.0.1:
version "3.1.0"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.1.0.tgz#7118f0dad99054204b6821c1f82e67b42cc21628"
integrity sha512-EyF8cMvUWRDWRLmC3+i50D1DqK4aFZWb/6PDPP2QfX2r0zXkgR2V9wt7jX7TRM0Qdj/3f6+JQkqfCaGkSj92iQ==

core-object@^3.1.5:
version "3.1.5"
Expand Down Expand Up @@ -10405,7 +10388,7 @@ dom-serializer@0, dom-serializer@~0.1.1:
domelementtype "^1.3.0"
entities "^1.1.1"

dom-testing-library@^4.0.0:
dom-testing-library@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/dom-testing-library/-/dom-testing-library-4.1.0.tgz#273264e62e9e63f4e404f7349ddd7b9356aacd23"
integrity sha512-654GHd0oPC31S+ll1bJH9NUOBRzcHcrf23/XzJh41o6g67uGUpF9tn23qmbcwjNauoRqKQfAdHCDwr/Ez/Ot7A==
Expand Down Expand Up @@ -11146,11 +11129,12 @@ envinfo@^5.7.0:
integrity sha512-pwdo0/G3CIkQ0y6PCXq4RdkvId2elvtPCJMG0konqlrfkWQbf1DWeH9K2b/cvu2YgGvPPTOnonZxXM1gikFu1w==

enzyme-adapter-react-16@^1.9.1:
version "1.13.0"
resolved "https://registry.yarnpkg.com/enzyme-adapter-react-16/-/enzyme-adapter-react-16-1.13.0.tgz#530e4aed3c127d7a7c5c7f4f634ad9ba65f719f6"
integrity sha512-ZUVo9XATKrKavfe9v61EiYDu6V1NJCKtJyp1X2ILPgtuGQ58bItUR9uWwH6gzKJNww3sUiXM826jIiwPgO9iVQ==
version "1.13.1"
resolved "https://registry.yarnpkg.com/enzyme-adapter-react-16/-/enzyme-adapter-react-16-1.13.1.tgz#2e8ee300e38674b9914ae52b04af9493050355e2"
integrity sha512-DCKbkiVlfLTbn4SXO8mXDQx1SmmwON5oKXn2QfQSMCt8eTYGwUXy/OBGSuss6KKwY5w5QfK1sQFxhgFOkMCjrw==
dependencies:
enzyme-adapter-utils "^1.12.0"
has "^1.0.3"
object.assign "^4.1.0"
object.values "^1.1.0"
prop-types "^15.7.2"
Expand Down Expand Up @@ -16857,11 +16841,12 @@ jest-preset-angular@^6.0.1:
ts-jest "~23.1.3"

jest-preset-angular@^7.1.0:
version "7.1.0"
resolved "https://registry.yarnpkg.com/jest-preset-angular/-/jest-preset-angular-7.1.0.tgz#df023f8bd9bf4f20497701bcd813906fa26e04ce"
integrity sha512-MSenqcEbmkNYXh77zpsFbIJvMBsVD2kPTy5+2GLm/07e7cQe29GEQLNN4F52VZMGW70RCvGFAiAE4ljsK9hYSg==
version "7.1.1"
resolved "https://registry.yarnpkg.com/jest-preset-angular/-/jest-preset-angular-7.1.1.tgz#b51fc910e5abea91701fcd89532823ae5990450b"
integrity sha512-/uJUi9IHoCxtB6aH6I+llpHjyfGfP2q32lcBCUKKk16v1uYKXvj1Nfdlvfvu/eqjZVoKEDLP+Ejup4bbsc0gAA==
dependencies:
jest-environment-jsdom-thirteen "^1.0.0"
pretty-format "^24.0.0"
ts-jest "^24.0.0"

jest-raw-loader@^1.0.1:
Expand Down Expand Up @@ -23390,7 +23375,7 @@ pretty-format@^23.4.1, pretty-format@^23.6.0:
ansi-regex "^3.0.0"
ansi-styles "^3.2.0"

pretty-format@^24.7.0, pretty-format@^24.8.0:
pretty-format@^24.0.0, pretty-format@^24.7.0, pretty-format@^24.8.0:
version "24.8.0"
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-24.8.0.tgz#8dae7044f58db7cb8be245383b565a963e3c27f2"
integrity sha512-P952T7dkrDEplsR+TuY7q3VXDae5Sr7zmQb12JU/NDQa/3CH7/QW0yvqLcGN6jL+zQFKaoJcPc+yJxMTGmosqw==
Expand Down Expand Up @@ -24911,12 +24896,12 @@ react-test-renderer@^16.0.0-0, react-test-renderer@^16.5.0, react-test-renderer@
scheduler "^0.13.6"

react-testing-library@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/react-testing-library/-/react-testing-library-7.0.0.tgz#d3b535e44de94d7b0a83c56cd2e3cfed752dcec1"
integrity sha512-8SHqwG+uhN9VhAgNVkVa3f7VjTw/L5CIaoAxKmy+EZuDQ6O+VsfcpRAyUw3MDL1h8S/gGrEiazmHBVL/uXsftA==
version "7.0.1"
resolved "https://registry.yarnpkg.com/react-testing-library/-/react-testing-library-7.0.1.tgz#0cf113bb53a78599f018378f6854e91a52dbf205"
integrity sha512-doQkM3/xPcIm22x9jgTkGxU8xqXg4iWvM1WwbbQ7CI5/EMk3DhloYBwMyk+Ywtta3dIAIh9sC7llXoKovf3L+w==
dependencies:
"@babel/runtime" "^7.4.3"
dom-testing-library "^4.0.0"
dom-testing-library "^4.1.0"

react-textarea-autosize@^7.0.4, react-textarea-autosize@^7.1.0:
version "7.1.0"
Expand Down Expand Up @@ -29112,9 +29097,9 @@ uglify-js@^2.8.29:
uglify-to-browserify "~1.0.0"

uglify-js@^3.0.13, uglify-js@^3.1.4:
version "3.5.13"
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.5.13.tgz#d2d8857b598d77f8764ae3bfcf90bb1df134d2bd"
integrity sha512-Lho+IJlquX6sdJgyKSJx/M9y4XbDd3ekPjD8S6HYmT5yVSwDtlSuca2w5hV4g2dIsp0Y/4orbfWxKexodmFv7w==
version "3.5.14"
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.5.14.tgz#edf2a322c37fd7173a954fb35af199b52fb10946"
integrity sha512-dgyjIw8KFK6AyVl5vm2tEqPewv5TKGEiiVFLI1LbF+oHua/Njd8tZk3lIbF1AWU1rNdEg7scaceADb4zqCcWXg==
dependencies:
commander "~2.20.0"
source-map "~0.6.1"
Expand Down Expand Up @@ -30532,9 +30517,9 @@ [email protected]:
webpack-sources "^1.3.0"

webpack@^4.23.1, webpack@^4.28.0:
version "4.31.0"
resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.31.0.tgz#ae201d45f0571336e42d1c2b5c8ab56c4d3b0c63"
integrity sha512-n6RVO3X0LbbipoE62akME9K/JI7qYrwwufs20VvgNNpqUoH4860KkaxJTbGq5bgkVZF9FqyyTG/0WPLH3PVNJA==
version "4.32.0"
resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.32.0.tgz#d8726fe73bb362e0e48171990f362df5e747747b"
integrity sha512-ofFq9jjAn4HRzlmkcZZrjijbRZcqDw+mM9KrjKd0r6lS0qxyZ7jzICzhphGafXL62dGdjP7TgMK9mZeMLUgZgw==
dependencies:
"@webassemblyjs/ast" "1.8.5"
"@webassemblyjs/helper-module-context" "1.8.5"
Expand Down

0 comments on commit 5994174

Please sign in to comment.