Skip to content

Commit

Permalink
Merge pull request #15774 from element-plus/dev
Browse files Browse the repository at this point in the history
D2M
  • Loading branch information
iamkun committed Feb 3, 2024
2 parents 3d9db5d + c46fe7f commit ea1afa1
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 8 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.en-US.md
@@ -1,4 +1,13 @@
## Changelog

### 2.5.5

_2024-02-03_

#### Bug fixes

- Fix lodash import error (#15773 by @tolking)


### 2.5.4

Expand Down
5 changes: 3 additions & 2 deletions internal/build/src/tasks/full-bundle.ts
Expand Up @@ -8,7 +8,7 @@ import vueJsx from '@vitejs/plugin-vue-jsx'
import esbuild, { minify as minifyPlugin } from 'rollup-plugin-esbuild'
import { parallel } from 'gulp'
import glob from 'fast-glob'
import { camelCase, upperFirst } from 'lodash'
import { camelCase, upperFirst } from 'lodash-unified'
import {
PKG_BRAND_NAME,
PKG_CAMELCASE_LOCAL_NAME,
Expand All @@ -24,6 +24,7 @@ import {
writeBundles,
} from '../utils'
import { target } from '../build-info'
import type { TaskFunction } from 'gulp'
import type { Plugin } from 'rollup'

const banner = `/*! ${PKG_BRAND_NAME} v${version} */\n`
Expand Down Expand Up @@ -154,7 +155,7 @@ async function buildFullLocale(minify: boolean) {
export const buildFull = (minify: boolean) => async () =>
Promise.all([buildFullEntry(minify), buildFullLocale(minify)])

export const buildFullBundle = parallel(
export const buildFullBundle: TaskFunction = parallel(
withTaskName('buildFullMinified', buildFull(true)),
withTaskName('buildFull', buildFull(false))
)
15 changes: 15 additions & 0 deletions internal/eslint-config/index.js
Expand Up @@ -262,6 +262,21 @@ module.exports = defineConfig({
'import/no-named-as-default': 'off',
'import/no-named-as-default-member': 'off',
'import/named': 'off',
'no-restricted-imports': [
'error',
{
paths: [
{ name: 'lodash', message: 'Use lodash-unified instead.' },
{ name: 'lodash-es', message: 'Use lodash-unified instead.' },
],
patterns: [
{
group: ['lodash/*', 'lodash-es/*'],
message: 'Use lodash-unified instead.',
},
],
},
],

// eslint-plugin-eslint-comments
'eslint-comments/disable-enable-pair': ['error', { allowWholeFile: true }],
Expand Down
2 changes: 1 addition & 1 deletion internal/metadata/src/contributor.ts
Expand Up @@ -4,7 +4,7 @@ import glob from 'fast-glob'
import { Octokit } from 'octokit'
import consola from 'consola'
import chalk from 'chalk'
import { chunk, mapValues, uniqBy } from 'lodash-es'
import { chunk, mapValues, uniqBy } from 'lodash-unified'
import {
ensureDir,
errorAndExit,
Expand Down
Expand Up @@ -15,8 +15,9 @@ import makeScroll from '@element-plus/test-utils/make-scroll'
import tick from '@element-plus/test-utils/tick'
import InfiniteScroll, { DEFAULT_DELAY, SCOPE } from '../src'

vi.mock('lodash-unified', () => {
vi.mock('lodash-unified', async () => {
return {
...((await vi.importActual('lodash-unified')) as Record<string, any>),
throttle: vi.fn((fn) => {
fn.cancel = vi.fn()
fn.flush = vi.fn()
Expand Down
2 changes: 1 addition & 1 deletion packages/components/tour/src/step.vue
Expand Up @@ -66,7 +66,7 @@

<script lang="ts" setup>
import { computed, inject, watch } from 'vue'
import { omit } from 'lodash-es'
import { omit } from 'lodash-unified'
import { ElButton } from '@element-plus/components/button'
import { ElIcon } from '@element-plus/components/icon'
import { CloseComponents } from '@element-plus/utils'
Expand Down
2 changes: 1 addition & 1 deletion packages/test-utils/define-getter.ts
@@ -1,4 +1,4 @@
import { isFunction, isUndefined } from 'lodash'
import { isFunction, isUndefined } from 'lodash-unified'

/**
*
Expand Down
2 changes: 1 addition & 1 deletion packages/test-utils/make-mount.ts
@@ -1,5 +1,5 @@
import { mount } from '@vue/test-utils'
import { merge } from 'lodash'
import { merge } from 'lodash-unified'

const makeMount = <C, O, E>(element: C, defaultOptions: O) => {
return (props: (E | O) | (E & O) = {} as E) =>
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/__tests__/arrays.test.ts
@@ -1,5 +1,5 @@
import { describe, expect, it } from 'vitest'
import { castArray as lodashCastArray } from 'lodash-es'
import { castArray as lodashCastArray } from 'lodash-unified'
import { castArray, ensureArray, unique } from '..'

describe('arrays', () => {
Expand Down

0 comments on commit ea1afa1

Please sign in to comment.