Skip to content

Commit

Permalink
refactor: replace yarn with pnpm (#201)
Browse files Browse the repository at this point in the history
  • Loading branch information
kagol authored Feb 21, 2022
1 parent 9780c3a commit 12c2d7b
Show file tree
Hide file tree
Showing 22 changed files with 8,789 additions and 18,534 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,15 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 6
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- run: yarn
- run: yarn build
cache: 'pnpm'
- run: pnpm i
- run: pnpm build
# - run: yarn test
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ build
lib
types
*.local
pnpm-lock.yaml
package-lock.json
yarn.lock
yarn-error.log
.history
.vscode
Expand All @@ -16,4 +16,3 @@ packages/devui-vue/devui/vue-devui.ts
packages/devui-vue/devui/theme/theme.scss
packages/devui-vue/docs/.vitepress/config/sidebar.ts
packages/devui-vue/docs/.vitepress/config/enSidebar.ts
yarn.lock
8 changes: 0 additions & 8 deletions lerna.json

This file was deleted.

15 changes: 6 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,31 @@
"name": "root",
"private": true,
"scripts": {
"dev": "lerna exec --scope vue-devui yarn dev",
"build": "lerna exec --scope vue-devui yarn build",
"build:lib": "lerna exec --scope vue-devui yarn build:lib",
"build:cli": "lerna exec --scope @devui/cli yarn build",
"dev": "pnpm dev --filter vue-devui",
"build": "pnpm build --filter vue-devui",
"build:lib": "pnpm build:lib --filter vue-devui",
"build:cli": "pnpm build --filter @devui/cli",
"prepare": "husky install",
"precommit": "lint-staged",
"lint:fix": "eslint --fix \"{packages}/**/*.{vue,js,ts,jsx,tsx}\"",
"stylelint": "stylelint --fix \"{packages}/**/*.{scss,css}\"",
"test": "lerna exec --scope vue-devui yarn test"
"test": "pnpm test --filter vue-devui"
},
"devDependencies": {
"@commitlint/cli": "^11.0.0",
"@ls-lint/ls-lint": "^1.10.0",
"all-contributors-cli": "^6.20.0",
"esbuild-register": "^2.6.0",
"eslint": "^7.28.0",
"eslint-plugin-import": "^2.24.2",
"eslint-plugin-vue": "^7.11.1",
"husky": "^7.0.4",
"lerna": "^4.0.0",
"lint-staged": "^11.0.0",
"stylelint": "^13.13.1",
"stylelint-config-recommended-scss": "^4.3.0",
"stylelint-config-standard": "^22.0.0",
"stylelint-scss": "^3.20.1"
},
"workspaces": [
"packages/*"
],
"lint-staged": {
".{js,ts,jsx,tsx,vue}": "eslint --fix",
".{scss,css}": "stylelint --fix"
Expand Down
1 change: 0 additions & 1 deletion packages/devui-vue/.yarnrc

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* 处理cascader-item中需要的参数
*/
import { cloneDeep } from 'lodash-es'
import { cloneDeep } from 'lodash'
import { ref, reactive, Ref } from 'vue'
import { CascaderProps, UseCascaderItemCallback, CascaderItem } from '../src/cascader-types'

Expand Down
2 changes: 1 addition & 1 deletion packages/devui-vue/devui/cascader/src/cascader.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// 公共库
import { cloneDeep } from 'lodash-es'
import { cloneDeep } from 'lodash'
import { defineComponent, ref, Ref, reactive, watch, toRef } from 'vue'

// 组件
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Icon } from '../../../../icon'
import './color-history.scss'
import { fromHexa } from '../../utils/color-utils'
import { provideColorOptions, ColorPickerColor } from '../../utils/color-utils-types'
import { debounce } from 'lodash-es'
import { debounce } from 'lodash'

const STORAGE_KEY = 'STORAGE_COLOR_PICKER_HISTORY_KEY'
const MAX_HISOTRY_COUNT = 8
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import AsyncValidator, { RuleItem } from 'async-validator';
import { VNode, DirectiveBinding } from 'vue';
import { debounce } from 'lodash-es';
import { debounce } from 'lodash';
import { EventBus, isObject, hasKey } from '../util';
import './style.scss';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineComponent, inject, ref, computed, reactive, onMounted, Teleport } from 'vue';
import { uniqueId } from 'lodash-es';
import { uniqueId } from 'lodash';
import { IForm, formControlProps, formInjectionKey } from '../form-types';
import { ShowPopoverErrorMessageEventData } from '../directive/d-validate-rules'
import clickoutsideDirective from '../../../shared/devui-directive/clickoutside'
Expand Down
2 changes: 1 addition & 1 deletion packages/devui-vue/devui/nav-sprite/src/nav-sprite.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineComponent } from '@vue/runtime-core';
import { defineComponent } from 'vue';
import { navSpriteProps } from './nav-sprite-types';

export default defineComponent({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { defineComponent, toRefs, onMounted, ExtractPropTypes, reactive, ref, wa
import { IViewConfigs, IAxisConfigs } from '../../../type'
import { AXIS_TITLE_SPACE } from '../../../config'
import { quadrantDiagramAxisProps, QuadrantDiagramAxisProps } from './types'
import { debounce } from 'lodash-es'
import { debounce } from 'lodash'

import './index.scss'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import { SetupContext, Ref, } from 'vue'
import { KeydownReturnTypes } from '../search-types'
import { debounce } from 'lodash-es'
import { debounce } from 'lodash'
const KEYS_MAP = {
enter: 'Enter'
} as const
Expand Down
2 changes: 1 addition & 1 deletion packages/devui-vue/devui/toast/src/toast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { computed, defineComponent, nextTick, onUnmounted, ref, watch } from 'vu
import { Message, ToastProps, toastProps } from './toast-types'
import ToastIconClose from './toast-icon-close'
import ToastImage from './toast-image'
import { cloneDeep, isEqual, merge, omit, throttle } from 'lodash-es'
import { cloneDeep, isEqual, merge, omit, throttle } from 'lodash'
import { useToastEvent } from './hooks/use-toast-event'
import { useToastHelper } from './hooks/use-toast-helper'
import { useToastConstant } from './hooks/use-toast-constant'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { reactive, ref, watch } from 'vue'
import type { Ref } from 'vue'
import { TreeItem, IDropType, Nullable } from '../tree-types'
import { cloneDeep } from 'lodash-es'
import { cloneDeep } from 'lodash'

const ACTIVE_NODE = 'devui-tree-node__content--value-wrapper'
interface DragState {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</template>

<script lang="ts">
import { debounce } from 'lodash-es'
import { debounce } from 'lodash'
import { defineComponent, onMounted, computed, ref } from 'vue'
export default defineComponent({
name: 'BackToTop',
Expand Down
7 changes: 6 additions & 1 deletion packages/devui-vue/docs/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ export default defineConfig({
svgLoader(),
],
optimizeDeps:{
exclude: ['vue','@vue/runtime-core','lodash','lodash-es','mitt','async-validator'],
exclude: ['lodash-es','mitt','async-validator'],
include: ['lodash']
},
server: {
fs: {
strict: false
}
}
})
13 changes: 8 additions & 5 deletions packages/devui-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
"devui-cli": "./devui-cli/index.js"
},
"scripts": {
"dev": "yarn generate:theme && vitepress dev docs",
"build": "yarn generate:theme && node --max_old_space_size=8192 ./node_modules/.bin/vitepress build docs && cp public/* docs/.vitepress/dist/assets",
"dev": "pnpm generate:theme && vitepress dev docs",
"build": "pnpm generate:theme && vitepress build docs && cp public/* docs/.vitepress/dist/assets",
"serve": "vitepress serve docs",
"app:dev": "vite",
"app:build": "vite build",
"build:lib": "yarn predev && yarn build:components && yarn copy",
"build:lib": "pnpm predev && pnpm build:components && pnpm copy",
"test": "jest --config jest.config.js",
"build:components": "node ./devui-cli/index.js build",
"generate:theme": "node ./devui-cli/index.js generate:theme",
Expand All @@ -42,6 +42,8 @@
"@devui-design/icons": "^1.3.0",
"@types/lodash-es": "^4.17.4",
"async-validator": "^4.0.2",
"fs-extra": "^10.0.0",
"lodash": "^4.17.21",
"lodash-es": "^4.17.20",
"mitt": "^3.0.0",
"vue": "^3.1.1",
Expand All @@ -54,6 +56,8 @@
"@babel/traverse": "^7.15.4",
"@commitlint/cli": "^11.0.0",
"@commitlint/config-conventional": "^11.0.0",
"@docsearch/css": "^3.0.0-alpha.50",
"@docsearch/js": "^3.0.0-alpha.50",
"@types/chalk": "^2.2.0",
"@types/commander": "^2.12.2",
"@types/jest": "^26.0.23",
Expand Down Expand Up @@ -82,7 +86,6 @@
"vite-svg-loader": "^2.2.0",
"vitepress": "0.20.1",
"vitepress-theme-demoblock": "1.3.2",
"vue-tsc": "^0.2.2",
"yarn": "^1.22.11"
"vue-tsc": "^0.2.2"
}
}
Loading

0 comments on commit 12c2d7b

Please sign in to comment.