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

feat: remove lodash-es #648

Merged
merged 12 commits into from
Sep 14, 2023
2 changes: 1 addition & 1 deletion docs/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<div>
<ULandingHero v-bind="page.hero" :ui="{ base: 'relative z-[1]', container: 'max-w-3xl' }" class="mb-[calc(var(--header-height)*2)]">
<template #title>
<span v-html="page.hero?.title" />

Check warning on line 5 in docs/pages/index.vue

View workflow job for this annotation

GitHub Actions / ci (ubuntu-latest, 18)

'v-html' directive can lead to XSS attack
</template>

<template #description>
<span v-html="page.hero?.description" />

Check warning on line 9 in docs/pages/index.vue

View workflow job for this annotation

GitHub Actions / ci (ubuntu-latest, 18)

'v-html' directive can lead to XSS attack
</template>

<template #links>
Expand Down Expand Up @@ -42,11 +42,11 @@

<ULandingSection v-for="(section, index) of page.sections" :key="index" v-bind="section">
<template v-if="section.title" #title>
<span v-html="section?.title" />

Check warning on line 45 in docs/pages/index.vue

View workflow job for this annotation

GitHub Actions / ci (ubuntu-latest, 18)

'v-html' directive can lead to XSS attack
</template>

<template v-if="section.description" #description>
<span v-html="section.description" />

Check warning on line 49 in docs/pages/index.vue

View workflow job for this annotation

GitHub Actions / ci (ubuntu-latest, 18)

'v-html' directive can lead to XSS attack
</template>

<template #demo>
Expand Down Expand Up @@ -126,7 +126,7 @@
}"
>
<template #title>
<span v-html="page.cta.title" />

Check warning on line 129 in docs/pages/index.vue

View workflow job for this annotation

GitHub Actions / ci (ubuntu-latest, 18)

'v-html' directive can lead to XSS attack
</template>

<template #links>
Expand Down Expand Up @@ -179,7 +179,7 @@
</template>

<script setup lang="ts">
import { pick } from 'lodash-es'
import { pick } from '../../src/runtime/utils/lodash'
import { breakpointsTailwind, useBreakpoints } from '@vueuse/core'

const { data: page } = await useAsyncData('index', () => queryContent('/').findOne())
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
"@vueuse/integrations": "^10.4.1",
"@vueuse/math": "^10.4.1",
"defu": "^6.1.2",
"scule": "^1.0.0",
"fuse.js": "^6.6.2",
"lodash-es": "^4.17.21",
"tailwind-merge": "^1.14.0",
"tailwindcss": "^3.3.3"
},
Expand All @@ -70,4 +70,4 @@
"[email protected]": "patches/[email protected]"
}
}
}
}
7 changes: 4 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/colors.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { omit, kebabCase, camelCase, upperFirst } from 'lodash-es'
import { omit, kebabCase, camelCase, upperFirst } from './runtime/utils/lodash'

const colorsToExclude = [
'inherit',
Expand Down Expand Up @@ -192,7 +192,7 @@
const colorsAsRegex = (colors: string[]): string => colors.join('|')

export const excludeColors = (colors: object): string[] => {
return Object.entries(omit(colors, colorsToExclude))

Check failure on line 195 in src/colors.ts

View workflow job for this annotation

GitHub Actions / ci (ubuntu-latest, 18)

Argument of type 'string[]' is not assignable to parameter of type 'never[]'.
.filter(([, value]) => typeof value === 'object')
.map(([key]) => kebabCase(key))
}
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/components/data/Table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
<script lang="ts">
import { ref, computed, defineComponent, toRaw } from 'vue'
import type { PropType } from 'vue'
import { omit, capitalize, orderBy, get } from 'lodash-es'
import { omit, capitalize, orderBy, get } from '../../utils/lodash'
import { defu } from 'defu'
import { twMerge } from 'tailwind-merge'
import { defuTwMerge } from '../../utils'
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/components/elements/Accordion.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
import { ref, computed, defineComponent } from 'vue'
import type { PropType } from 'vue'
import { Disclosure as HDisclosure, DisclosureButton as HDisclosureButton, DisclosurePanel as HDisclosurePanel } from '@headlessui/vue'
import { omit } from 'lodash-es'
import { omit } from '../../utils/lodash'
import { twMerge } from 'tailwind-merge'
import UIcon from '../elements/Icon.vue'
import UButton from '../elements/Button.vue'
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/components/elements/Alert.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import { useAppConfig } from '#imports'
// TODO: Remove
// @ts-expect-error
import appConfig from '#build/app.config'
import { omit } from 'lodash-es'
import { omit } from '../../utils/lodash'

// const appConfig = useAppConfig()

Expand Down
3 changes: 1 addition & 2 deletions src/runtime/components/elements/Avatar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ import { useAppConfig } from '#imports'
// TODO: Remove
// @ts-expect-error
import appConfig from '#build/app.config'
import { omit } from 'lodash-es'

import { omit } from '../../utils/lodash'
// const appConfig = useAppConfig()

export default defineComponent({
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/components/elements/AvatarGroup.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { h, cloneVNode, computed, defineComponent } from 'vue'
import type { PropType } from 'vue'
import { omit } from 'lodash-es'
import { omit } from '../../utils/lodash'
import { twMerge, twJoin } from 'tailwind-merge'
import { defuTwMerge, getSlotsChildren } from '../../utils'
import Avatar from './Avatar.vue'
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/components/elements/Badge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<script lang="ts">
import { computed, defineComponent } from 'vue'
import type { PropType } from 'vue'
import { omit } from 'lodash-es'
import { omit } from '../../utils/lodash'
import { twMerge, twJoin } from 'tailwind-merge'
import { defuTwMerge } from '../../utils'
import { useAppConfig } from '#imports'
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/components/elements/Button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<script lang="ts">
import { computed, defineComponent } from 'vue'
import type { PropType } from 'vue'
import { omit } from 'lodash-es'
import { omit } from '../../utils/lodash'
import { twMerge, twJoin } from 'tailwind-merge'
import UIcon from '../elements/Icon.vue'
import ULink from '../elements/Link.vue'
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/components/elements/ButtonGroup.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { h, cloneVNode, computed, defineComponent } from 'vue'
import type { PropType } from 'vue'
import { omit } from 'lodash-es'
import { omit } from '../../utils/lodash'
import { twMerge, twJoin } from 'tailwind-merge'
import { defuTwMerge, getSlotsChildren } from '../../utils'
import { useAppConfig } from '#imports'
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/components/elements/Dropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import { defineComponent, ref, computed, onMounted } from 'vue'
import type { PropType } from 'vue'
import { Menu as HMenu, MenuButton as HMenuButton, MenuItems as HMenuItems, MenuItem as HMenuItem } from '@headlessui/vue'
import { defu } from 'defu'
import { omit } from 'lodash-es'
import { omit } from '../../utils/lodash'
import { twMerge } from 'tailwind-merge'
import UIcon from '../elements/Icon.vue'
import UAvatar from '../elements/Avatar.vue'
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/components/elements/Kbd.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<script lang="ts">
import { defineComponent, computed } from 'vue'
import type { PropType } from 'vue'
import { omit } from 'lodash-es'
import { omit } from '../../utils/lodash'
import { twMerge, twJoin } from 'tailwind-merge'
import { defuTwMerge } from '../../utils'
import { useAppConfig } from '#imports'
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/components/elements/Link.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</template>

<script lang="ts">
import { isEqual } from 'lodash-es'
import { isEqual } from '../../utils/lodash'
import { defineComponent } from 'vue'
import { NuxtLink } from '#components'

Expand Down
2 changes: 1 addition & 1 deletion src/runtime/components/forms/Checkbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<script lang="ts">
import { computed, defineComponent } from 'vue'
import type { PropType } from 'vue'
import { omit } from 'lodash-es'
import { omit } from '../../utils/lodash'
import { twMerge, twJoin } from 'tailwind-merge'
import { defuTwMerge } from '../../utils'
import { useFormGroup } from '../../composables/useFormGroup'
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/components/forms/FormGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<script lang="ts">
import { computed, defineComponent, provide, inject } from 'vue'
import type { PropType } from 'vue'
import { omit } from 'lodash-es'
import { omit } from '../../utils/lodash'
import { twMerge } from 'tailwind-merge'
import type { FormError } from '../../types/form'
import { defuTwMerge } from '../../utils'
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/components/forms/Input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<script lang="ts">
import { ref, computed, onMounted, defineComponent } from 'vue'
import type { PropType } from 'vue'
import { omit } from 'lodash-es'
import { omit } from '../../utils/lodash'
import { twMerge, twJoin } from 'tailwind-merge'
import UIcon from '../elements/Icon.vue'
import { defuTwMerge } from '../../utils'
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/components/forms/Radio.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<script lang="ts">
import { computed, defineComponent } from 'vue'
import type { PropType } from 'vue'
import { omit } from 'lodash-es'
import { omit } from '../../utils/lodash'
import { twMerge, twJoin } from 'tailwind-merge'
import { defuTwMerge } from '../../utils'
import { useFormGroup } from '../../composables/useFormGroup'
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/components/forms/Range.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<script lang="ts">
import { computed, defineComponent } from 'vue'
import type { PropType } from 'vue'
import { omit } from 'lodash-es'
import { omit } from '../../utils/lodash'
import { twMerge, twJoin } from 'tailwind-merge'
import { defuTwMerge } from '../../utils'
import { useFormGroup } from '../../composables/useFormGroup'
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/components/forms/Select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<script lang="ts">
import { computed, defineComponent } from 'vue'
import type { PropType, ComputedRef } from 'vue'
import { get, omit } from 'lodash-es'
import { get, omit } from '../../utils/lodash'
import { twMerge, twJoin } from 'tailwind-merge'
import UIcon from '../elements/Icon.vue'
import { defuTwMerge } from '../../utils'
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/components/forms/SelectMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ import {
} from '@headlessui/vue'
import { computedAsync, useDebounceFn } from '@vueuse/core'
import { defu } from 'defu'
import { omit } from 'lodash-es'
import { omit } from '../../utils/lodash'
import { twMerge, twJoin } from 'tailwind-merge'
import UIcon from '../elements/Icon.vue'
import UAvatar from '../elements/Avatar.vue'
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/components/forms/Textarea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<script lang="ts">
import { ref, computed, watch, onMounted, nextTick, defineComponent } from 'vue'
import type { PropType } from 'vue'
import { omit } from 'lodash-es'
import { omit } from '../../utils/lodash'
import { twMerge, twJoin } from 'tailwind-merge'
import { defuTwMerge } from '../../utils'
import { useFormGroup } from '../../composables/useFormGroup'
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/components/forms/Toggle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import { computed, defineComponent } from 'vue'
import type { PropType } from 'vue'
import { Switch as HSwitch } from '@headlessui/vue'
import { omit } from 'lodash-es'
import { omit } from '../../utils/lodash'
import { twMerge, twJoin } from 'tailwind-merge'
import UIcon from '../elements/Icon.vue'
import { defuTwMerge } from '../../utils'
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/components/layout/Card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<script lang="ts">
import { computed, defineComponent } from 'vue'
import type { PropType } from 'vue'
import { omit } from 'lodash-es'
import { omit } from '../../utils/lodash'
import { twMerge, twJoin } from 'tailwind-merge'
import { defuTwMerge } from '../../utils'
import { useAppConfig } from '#imports'
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/components/layout/Container.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<script lang="ts">
import { computed, defineComponent } from 'vue'
import type { PropType } from 'vue'
import { omit } from 'lodash-es'
import { omit } from '../../utils/lodash'
import { twMerge, twJoin } from 'tailwind-merge'
import { defuTwMerge } from '../../utils'
import { useAppConfig } from '#imports'
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/components/layout/Skeleton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<script lang="ts">
import { computed, defineComponent } from 'vue'
import type { PropType } from 'vue'
import { omit } from 'lodash-es'
import { omit } from '../../utils/lodash'
import { twMerge, twJoin } from 'tailwind-merge'
import { defuTwMerge } from '../../utils'
import { useAppConfig } from '#imports'
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/navigation/CommandPalette.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ import type { ComputedRef, PropType, ComponentPublicInstance } from 'vue'
import { useDebounceFn } from '@vueuse/core'
import { useFuse } from '@vueuse/integrations/useFuse'
import { twMerge, twJoin } from 'tailwind-merge'
import { groupBy, map, omit } from 'lodash-es'
import { groupBy, map, omit } from '../../utils/lodash'
import { defu } from 'defu'
import type { UseFuseOptions } from '@vueuse/integrations/useFuse'
import type { Group, Command } from '../../types/command-palette'
Expand Down Expand Up @@ -239,7 +239,7 @@ export default defineComponent({
})

return {
...props.groups.find(group => group.key === key),
...props.groups.find(group => Number(group.key) === key),
commands: commands.slice(0, options.value.resultLimit)
} as Group
}),
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/components/navigation/Pagination.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<script lang="ts">
import { computed, defineComponent } from 'vue'
import type { PropType } from 'vue'
import { omit } from 'lodash-es'
import { omit } from '../../utils/lodash'
import { twMerge } from 'tailwind-merge'
import UButton from '../elements/Button.vue'
import { defuTwMerge } from '../../utils'
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/components/navigation/Tabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import { ref, computed, watch, onMounted, defineComponent } from 'vue'
import type { PropType } from 'vue'
import { TabGroup as HTabGroup, TabList as HTabList, Tab as HTab, TabPanels as HTabPanels, TabPanel as HTabPanel } from '@headlessui/vue'
import { useResizeObserver } from '@vueuse/core'
import { omit } from 'lodash-es'
import { omit } from '../../utils/lodash'
import { twMerge } from 'tailwind-merge'
import { defuTwMerge } from '../../utils'
import type { TabItem } from '../../types/tabs'
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/components/navigation/VerticalNavigation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<script lang="ts">
import { computed, defineComponent } from 'vue'
import type { PropType } from 'vue'
import { omit } from 'lodash-es'
import { omit } from '../../utils/lodash'
import { twMerge } from 'tailwind-merge'
import UIcon from '../elements/Icon.vue'
import UAvatar from '../elements/Avatar.vue'
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/components/overlays/ContextMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import type { PropType, Ref } from 'vue'
import { defu } from 'defu'
import { onClickOutside } from '@vueuse/core'
import type { VirtualElement } from '@popperjs/core'
import { omit } from 'lodash-es'
import { omit } from '../../utils/lodash'
import { twMerge, twJoin } from 'tailwind-merge'
import { usePopper } from '../../composables/usePopper'
import { defuTwMerge } from '../../utils'
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/components/overlays/Modal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<script lang="ts">
import { computed, defineComponent } from 'vue'
import type { PropType } from 'vue'
import { omit } from 'lodash-es'
import { omit } from '../../utils/lodash'
import { twMerge } from 'tailwind-merge'
import { Dialog as HDialog, DialogPanel as HDialogPanel, TransitionRoot, TransitionChild } from '@headlessui/vue'
import { defuTwMerge } from '../../utils'
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/components/overlays/Notification.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<script lang="ts">
import { ref, computed, onMounted, onUnmounted, watchEffect, defineComponent } from 'vue'
import type { PropType } from 'vue'
import { omit } from 'lodash-es'
import { omit } from '../../utils/lodash'
import { twMerge, twJoin } from 'tailwind-merge'
import UIcon from '../elements/Icon.vue'
import UAvatar from '../elements/Avatar.vue'
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/components/overlays/Notifications.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<script lang="ts">
import { computed, defineComponent } from 'vue'
import type { PropType } from 'vue'
import { omit } from 'lodash-es'
import { omit } from '../../utils/lodash'
import { twMerge, twJoin } from 'tailwind-merge'
import UNotification from './Notification.vue'
import { useToast } from '../../composables/useToast'
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/components/overlays/Popover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import { computed, ref, onMounted, defineComponent } from 'vue'
import type { PropType } from 'vue'
import { defu } from 'defu'
import { omit } from 'lodash-es'
import { omit } from '../../utils/lodash'
import { twMerge } from 'tailwind-merge'
import { Popover as HPopover, PopoverButton as HPopoverButton, PopoverPanel as HPopoverPanel } from '@headlessui/vue'
import { usePopper } from '../../composables/usePopper'
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/components/overlays/Slideover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import { computed, defineComponent } from 'vue'
import type { WritableComputedRef, PropType } from 'vue'
import { Dialog as HDialog, DialogPanel as HDialogPanel, TransitionRoot, TransitionChild } from '@headlessui/vue'
import { omit } from 'lodash-es'
import { omit } from '../../utils/lodash'
import { twMerge } from 'tailwind-merge'
import { defuTwMerge } from '../../utils'
import { useAppConfig } from '#imports'
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/components/overlays/Tooltip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import { computed, ref, defineComponent } from 'vue'
import type { PropType } from 'vue'
import { defu } from 'defu'
import { omit } from 'lodash-es'
import { omit } from '../../utils/lodash'
import { twMerge } from 'tailwind-merge'
import UKbd from '../elements/Kbd.vue'
import { usePopper } from '../../composables/usePopper'
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/composables/usePopper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ref, onMounted, watchEffect } from 'vue'
import type { Ref } from 'vue'
import { popperGenerator, defaultModifiers, VirtualElement } from '@popperjs/core/lib/popper-lite'
import type { Instance } from '@popperjs/core'
import { omitBy, isUndefined } from 'lodash-es'
import { omitBy, isUndefined } from '../utils/lodash'
import flip from '@popperjs/core/lib/modifiers/flip'
import offset from '@popperjs/core/lib/modifiers/offset'
import preventOverflow from '@popperjs/core/lib/modifiers/preventOverflow'
Expand Down
Loading
Loading