From d6476d17f9b17317a7160271dacdb854f30237ae Mon Sep 17 00:00:00 2001 From: Younes Barrad Date: Thu, 14 Sep 2023 17:47:09 +0100 Subject: [PATCH] feat: remove `lodash-es` (#648) Co-authored-by: Daniel Roe --- package.json | 5 +- pnpm-lock.yaml | 18 +++-- src/colors.ts | 3 +- src/runtime/components/data/Table.vue | 20 +++++- src/runtime/components/elements/Accordion.vue | 2 +- src/runtime/components/elements/Alert.vue | 2 +- src/runtime/components/elements/Avatar.vue | 3 +- .../components/elements/AvatarGroup.ts | 2 +- src/runtime/components/elements/Badge.vue | 2 +- src/runtime/components/elements/Button.vue | 2 +- .../components/elements/ButtonGroup.ts | 2 +- src/runtime/components/elements/Dropdown.vue | 2 +- src/runtime/components/elements/Kbd.vue | 2 +- src/runtime/components/elements/Link.vue | 2 +- src/runtime/components/forms/Checkbox.vue | 2 +- src/runtime/components/forms/FormGroup.vue | 2 +- src/runtime/components/forms/Input.vue | 2 +- src/runtime/components/forms/Radio.vue | 2 +- src/runtime/components/forms/Range.vue | 2 +- src/runtime/components/forms/Select.vue | 2 +- src/runtime/components/forms/SelectMenu.vue | 2 +- src/runtime/components/forms/Textarea.vue | 2 +- src/runtime/components/forms/Toggle.vue | 2 +- src/runtime/components/layout/Card.vue | 2 +- src/runtime/components/layout/Container.vue | 2 +- src/runtime/components/layout/Skeleton.vue | 2 +- .../components/navigation/CommandPalette.vue | 48 +++++++++---- .../components/navigation/Pagination.vue | 2 +- src/runtime/components/navigation/Tabs.vue | 2 +- .../navigation/VerticalNavigation.vue | 2 +- .../components/overlays/ContextMenu.vue | 2 +- src/runtime/components/overlays/Modal.vue | 2 +- .../components/overlays/Notification.vue | 2 +- .../components/overlays/Notifications.vue | 2 +- src/runtime/components/overlays/Popover.vue | 2 +- src/runtime/components/overlays/Slideover.vue | 2 +- src/runtime/components/overlays/Tooltip.vue | 2 +- src/runtime/composables/usePopper.ts | 72 +++++++++++-------- src/runtime/utils/lodash.ts | 33 +++++++++ 39 files changed, 173 insertions(+), 91 deletions(-) create mode 100644 src/runtime/utils/lodash.ts diff --git a/package.json b/package.json index 36a7d47e15..2ce6a1af3e 100644 --- a/package.json +++ b/package.json @@ -45,8 +45,9 @@ "@vueuse/integrations": "^10.4.1", "@vueuse/math": "^10.4.1", "defu": "^6.1.2", + "ohash": "^1.1.3", + "scule": "^1.0.0", "fuse.js": "^6.6.2", - "lodash-es": "^4.17.21", "tailwind-merge": "^1.14.0", "tailwindcss": "^3.3.3" }, @@ -70,4 +71,4 @@ "nuxt-component-meta@0.5.3": "patches/nuxt-component-meta@0.5.3.patch" } } -} +} \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 487e9a2266..184e1fd392 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -61,9 +61,12 @@ importers: fuse.js: specifier: ^6.6.2 version: 6.6.2 - lodash-es: - specifier: ^4.17.21 - version: 4.17.21 + ohash: + specifier: ^1.1.3 + version: 1.1.3 + scule: + specifier: ^1.0.0 + version: 1.0.0 tailwind-merge: specifier: ^1.14.0 version: 1.14.0 @@ -2666,8 +2669,8 @@ packages: '@types/node': 20.5.7 dev: true - /@types/lodash-es@4.17.8: - resolution: {integrity: sha512-euY3XQcZmIzSy7YH5+Unb3b2X12Wtk54YWINBvvGQ5SmMvwb11JQskGsfkH/5HXK77Kr8GF0wkVDIxzAisWtog==} + /@types/lodash-es@4.17.9: + resolution: {integrity: sha512-ZTcmhiI3NNU7dEvWLZJkzG6ao49zOIjEgIE0RgV7wbPxU0f2xT3VSAHw2gmst8swH6V0YkLRGp4qPlX/6I90MQ==} dependencies: '@types/lodash': 4.14.197 dev: true @@ -7476,6 +7479,7 @@ packages: /lodash-es@4.17.21: resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} + dev: true /lodash._reinterpolate@3.0.0: resolution: {integrity: sha512-xYHt68QRoYGjeeM/XOE1uJtvXQAgvszfBhjV4yvsQH0u2i9I6cI6c6/eG4Hh3UAOVn0y/xAXwmTzEay49Q//HA==} @@ -8981,8 +8985,8 @@ packages: /nuxt-lodash@2.5.0(rollup@3.28.1): resolution: {integrity: sha512-nd7YrKzJH7kqMEwyAlwk0T8Fi/G1heAaWJENFm6SUIwYgR6AOigp/ryLya+JBEP+ZmGrJbIHq+mhWNdvKsLK7g==} dependencies: - '@nuxt/kit': 3.7.0(rollup@3.28.1) - '@types/lodash-es': 4.17.8 + '@nuxt/kit': 3.7.1(rollup@3.28.1) + '@types/lodash-es': 4.17.9 lodash-es: 4.17.21 transitivePeerDependencies: - rollup diff --git a/src/colors.ts b/src/colors.ts index 4724f549d0..133c0c2804 100644 --- a/src/colors.ts +++ b/src/colors.ts @@ -1,4 +1,5 @@ -import { omit, kebabCase, camelCase, upperFirst } from 'lodash-es' +import { omit } from './runtime/utils/lodash' +import { kebabCase, camelCase, upperFirst } from 'scule' const colorsToExclude = [ 'inherit', diff --git a/src/runtime/components/data/Table.vue b/src/runtime/components/data/Table.vue index e63143bb00..6d1b5b56ef 100644 --- a/src/runtime/components/data/Table.vue +++ b/src/runtime/components/data/Table.vue @@ -69,9 +69,10 @@