Skip to content

Commit 12c2d7b

Browse files
authored
refactor: replace yarn with pnpm (#201)
1 parent 9780c3a commit 12c2d7b

File tree

22 files changed

+8789
-18534
lines changed

22 files changed

+8789
-18534
lines changed

.github/workflows/pull-request.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,15 @@ jobs:
1717

1818
steps:
1919
- uses: actions/checkout@v2
20+
- name: Install pnpm
21+
uses: pnpm/action-setup@v2
22+
with:
23+
version: 6
2024
- name: Use Node.js ${{ matrix.node-version }}
2125
uses: actions/setup-node@v2
2226
with:
2327
node-version: ${{ matrix.node-version }}
24-
cache: 'yarn'
25-
- run: yarn
26-
- run: yarn build
28+
cache: 'pnpm'
29+
- run: pnpm i
30+
- run: pnpm build
2731
# - run: yarn test

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ build
66
lib
77
types
88
*.local
9-
pnpm-lock.yaml
109
package-lock.json
10+
yarn.lock
1111
yarn-error.log
1212
.history
1313
.vscode
@@ -16,4 +16,3 @@ packages/devui-vue/devui/vue-devui.ts
1616
packages/devui-vue/devui/theme/theme.scss
1717
packages/devui-vue/docs/.vitepress/config/sidebar.ts
1818
packages/devui-vue/docs/.vitepress/config/enSidebar.ts
19-
yarn.lock

lerna.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

package.json

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,31 @@
22
"name": "root",
33
"private": true,
44
"scripts": {
5-
"dev": "lerna exec --scope vue-devui yarn dev",
6-
"build": "lerna exec --scope vue-devui yarn build",
7-
"build:lib": "lerna exec --scope vue-devui yarn build:lib",
8-
"build:cli": "lerna exec --scope @devui/cli yarn build",
5+
"dev": "pnpm dev --filter vue-devui",
6+
"build": "pnpm build --filter vue-devui",
7+
"build:lib": "pnpm build:lib --filter vue-devui",
8+
"build:cli": "pnpm build --filter @devui/cli",
99
"prepare": "husky install",
1010
"precommit": "lint-staged",
1111
"lint:fix": "eslint --fix \"{packages}/**/*.{vue,js,ts,jsx,tsx}\"",
1212
"stylelint": "stylelint --fix \"{packages}/**/*.{scss,css}\"",
13-
"test": "lerna exec --scope vue-devui yarn test"
13+
"test": "pnpm test --filter vue-devui"
1414
},
1515
"devDependencies": {
16+
"@commitlint/cli": "^11.0.0",
1617
"@ls-lint/ls-lint": "^1.10.0",
1718
"all-contributors-cli": "^6.20.0",
1819
"esbuild-register": "^2.6.0",
1920
"eslint": "^7.28.0",
2021
"eslint-plugin-import": "^2.24.2",
2122
"eslint-plugin-vue": "^7.11.1",
2223
"husky": "^7.0.4",
23-
"lerna": "^4.0.0",
2424
"lint-staged": "^11.0.0",
2525
"stylelint": "^13.13.1",
2626
"stylelint-config-recommended-scss": "^4.3.0",
2727
"stylelint-config-standard": "^22.0.0",
2828
"stylelint-scss": "^3.20.1"
2929
},
30-
"workspaces": [
31-
"packages/*"
32-
],
3330
"lint-staged": {
3431
".{js,ts,jsx,tsx,vue}": "eslint --fix",
3532
".{scss,css}": "stylelint --fix"

packages/devui-vue/.yarnrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/devui-vue/devui/cascader/hooks/use-cascader-item.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* 处理cascader-item中需要的参数
33
*/
4-
import { cloneDeep } from 'lodash-es'
4+
import { cloneDeep } from 'lodash'
55
import { ref, reactive, Ref } from 'vue'
66
import { CascaderProps, UseCascaderItemCallback, CascaderItem } from '../src/cascader-types'
77

packages/devui-vue/devui/cascader/src/cascader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// 公共库
2-
import { cloneDeep } from 'lodash-es'
2+
import { cloneDeep } from 'lodash'
33
import { defineComponent, ref, Ref, reactive, watch, toRef } from 'vue'
44

55
// 组件

packages/devui-vue/devui/color-picker/src/components/color-history/color-history.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Icon } from '../../../../icon'
44
import './color-history.scss'
55
import { fromHexa } from '../../utils/color-utils'
66
import { provideColorOptions, ColorPickerColor } from '../../utils/color-utils-types'
7-
import { debounce } from 'lodash-es'
7+
import { debounce } from 'lodash'
88

99
const STORAGE_KEY = 'STORAGE_COLOR_PICKER_HISTORY_KEY'
1010
const MAX_HISOTRY_COUNT = 8

packages/devui-vue/devui/form/src/directive/d-validate-rules.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import AsyncValidator, { RuleItem } from 'async-validator';
22
import { VNode, DirectiveBinding } from 'vue';
3-
import { debounce } from 'lodash-es';
3+
import { debounce } from 'lodash';
44
import { EventBus, isObject, hasKey } from '../util';
55
import './style.scss';
66

packages/devui-vue/devui/form/src/form-control/form-control.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { defineComponent, inject, ref, computed, reactive, onMounted, Teleport } from 'vue';
2-
import { uniqueId } from 'lodash-es';
2+
import { uniqueId } from 'lodash';
33
import { IForm, formControlProps, formInjectionKey } from '../form-types';
44
import { ShowPopoverErrorMessageEventData } from '../directive/d-validate-rules'
55
import clickoutsideDirective from '../../../shared/devui-directive/clickoutside'

packages/devui-vue/devui/nav-sprite/src/nav-sprite.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { defineComponent } from '@vue/runtime-core';
1+
import { defineComponent } from 'vue';
22
import { navSpriteProps } from './nav-sprite-types';
33

44
export default defineComponent({

packages/devui-vue/devui/quadrant-diagram/src/components/axis/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { defineComponent, toRefs, onMounted, ExtractPropTypes, reactive, ref, wa
22
import { IViewConfigs, IAxisConfigs } from '../../../type'
33
import { AXIS_TITLE_SPACE } from '../../../config'
44
import { quadrantDiagramAxisProps, QuadrantDiagramAxisProps } from './types'
5-
import { debounce } from 'lodash-es'
5+
import { debounce } from 'lodash'
66

77
import './index.scss'
88

packages/devui-vue/devui/search/src/hooks/use-search-keydown.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44
import { SetupContext, Ref, } from 'vue'
55
import { KeydownReturnTypes } from '../search-types'
6-
import { debounce } from 'lodash-es'
6+
import { debounce } from 'lodash'
77
const KEYS_MAP = {
88
enter: 'Enter'
99
} as const

packages/devui-vue/devui/toast/src/toast.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { computed, defineComponent, nextTick, onUnmounted, ref, watch } from 'vu
44
import { Message, ToastProps, toastProps } from './toast-types'
55
import ToastIconClose from './toast-icon-close'
66
import ToastImage from './toast-image'
7-
import { cloneDeep, isEqual, merge, omit, throttle } from 'lodash-es'
7+
import { cloneDeep, isEqual, merge, omit, throttle } from 'lodash'
88
import { useToastEvent } from './hooks/use-toast-event'
99
import { useToastHelper } from './hooks/use-toast-helper'
1010
import { useToastConstant } from './hooks/use-toast-constant'

packages/devui-vue/devui/tree/src/composables/use-draggable.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { reactive, ref, watch } from 'vue'
22
import type { Ref } from 'vue'
33
import { TreeItem, IDropType, Nullable } from '../tree-types'
4-
import { cloneDeep } from 'lodash-es'
4+
import { cloneDeep } from 'lodash'
55

66
const ACTIVE_NODE = 'devui-tree-node__content--value-wrapper'
77
interface DragState {

packages/devui-vue/docs/.vitepress/devui-theme/components/BackToTop.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
</template>
3232

3333
<script lang="ts">
34-
import { debounce } from 'lodash-es'
34+
import { debounce } from 'lodash'
3535
import { defineComponent, onMounted, computed, ref } from 'vue'
3636
export default defineComponent({
3737
name: 'BackToTop',

packages/devui-vue/docs/vite.config.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ export default defineConfig({
1414
svgLoader(),
1515
],
1616
optimizeDeps:{
17-
exclude: ['vue','@vue/runtime-core','lodash','lodash-es','mitt','async-validator'],
17+
exclude: ['lodash-es','mitt','async-validator'],
1818
include: ['lodash']
1919
},
20+
server: {
21+
fs: {
22+
strict: false
23+
}
24+
}
2025
})

packages/devui-vue/package.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@
2222
"devui-cli": "./devui-cli/index.js"
2323
},
2424
"scripts": {
25-
"dev": "yarn generate:theme && vitepress dev docs",
26-
"build": "yarn generate:theme && node --max_old_space_size=8192 ./node_modules/.bin/vitepress build docs && cp public/* docs/.vitepress/dist/assets",
25+
"dev": "pnpm generate:theme && vitepress dev docs",
26+
"build": "pnpm generate:theme && vitepress build docs && cp public/* docs/.vitepress/dist/assets",
2727
"serve": "vitepress serve docs",
2828
"app:dev": "vite",
2929
"app:build": "vite build",
30-
"build:lib": "yarn predev && yarn build:components && yarn copy",
30+
"build:lib": "pnpm predev && pnpm build:components && pnpm copy",
3131
"test": "jest --config jest.config.js",
3232
"build:components": "node ./devui-cli/index.js build",
3333
"generate:theme": "node ./devui-cli/index.js generate:theme",
@@ -42,6 +42,8 @@
4242
"@devui-design/icons": "^1.3.0",
4343
"@types/lodash-es": "^4.17.4",
4444
"async-validator": "^4.0.2",
45+
"fs-extra": "^10.0.0",
46+
"lodash": "^4.17.21",
4547
"lodash-es": "^4.17.20",
4648
"mitt": "^3.0.0",
4749
"vue": "^3.1.1",
@@ -54,6 +56,8 @@
5456
"@babel/traverse": "^7.15.4",
5557
"@commitlint/cli": "^11.0.0",
5658
"@commitlint/config-conventional": "^11.0.0",
59+
"@docsearch/css": "^3.0.0-alpha.50",
60+
"@docsearch/js": "^3.0.0-alpha.50",
5761
"@types/chalk": "^2.2.0",
5862
"@types/commander": "^2.12.2",
5963
"@types/jest": "^26.0.23",
@@ -82,7 +86,6 @@
8286
"vite-svg-loader": "^2.2.0",
8387
"vitepress": "0.20.1",
8488
"vitepress-theme-demoblock": "1.3.2",
85-
"vue-tsc": "^0.2.2",
86-
"yarn": "^1.22.11"
89+
"vue-tsc": "^0.2.2"
8790
}
8891
}

0 commit comments

Comments
 (0)