chore: move vant to packages folder (#9384)

This commit is contained in:
neverland 2021-09-03 14:32:16 +08:00 committed by GitHub
parent 5a75326b65
commit c21324b256
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1022 changed files with 150 additions and 164 deletions

View File

@ -18,7 +18,7 @@ It's welcomed to pull request, And there are some tips about that:
- When in doubt, keep your pull requests small. To give a PR the best chance of getting accepted, don't bundle more than one feature or bug fix per pull request. It's always best to create two smaller PRs than one big one.
- When adding new features or modifying existing, please attempt to include tests to confirm the new behaviour.
- When adding new features or modifying existing, please attempt to include tests to confirm the new behavior.
- Rebase before creating a PR to keep commit history clear.
@ -29,7 +29,7 @@ It's welcomed to pull request, And there are some tips about that:
```bash
git clone git@github.com:youzan/vant.git
cd vant && yarn
cd packages/vant && yarn
npm run dev

View File

@ -17,13 +17,15 @@ jobs:
- name: Install dependencies
uses: bahmutov/npm-install@v1
with:
working-directory: packages/vant
- name: Build Site
run: npx --no-install vant-cli build-site
run: npm run build:site
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@4.1.1
with:
branch: gh-pages
folder: site
folder: packages/vant/site
target-folder: v3

View File

@ -13,6 +13,8 @@ jobs:
- name: Install dependencies
uses: bahmutov/npm-install@v1
with:
working-directory: packages/vant
- name: Run linter
run: npm run lint
@ -27,6 +29,8 @@ jobs:
- name: Install dependencies
uses: bahmutov/npm-install@v1
with:
working-directory: packages/vant
- name: Run test cases
run: npm test
@ -46,6 +50,8 @@ jobs:
- name: Install dependencies
uses: bahmutov/npm-install@v1
with:
working-directory: packages/vant
- name: Build
run: npm run build

2
.gitignore vendored
View File

@ -9,7 +9,7 @@ node_modules
package-lock.json
# test
test/coverage
**/test/coverage
# dist file
es

View File

@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx --no-install vant-cli commit-lint $1
cd packages/vant && npx --no-install vant-cli commit-lint ../../$1

View File

@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx --no-install lint-staged
cd packages/vant && npx --no-install lint-staged

View File

@ -1,80 +1,11 @@
{
"name": "vant",
"version": "3.2.2",
"description": "Mobile UI Components built on Vue",
"main": "lib/index.js",
"module": "es/index.js",
"style": "lib/index.css",
"typings": "lib/index.d.ts",
"files": [
"es",
"lib",
"vetur"
],
"publishConfig": {
"registry": "https://registry.npmjs.org/"
},
"private": true,
"scripts": {
"dev": "vant-cli dev",
"lint": "vant-cli lint",
"test": "vant-cli test",
"build": "vant-cli build",
"prepare": "husky install",
"release": "vant-cli release --tag next",
"test:watch": "vant-cli test --watch",
"release:site": "vant-cli build-site && gh-pages -d site --add --dest v3",
"test:coverage": "open test/coverage/index.html"
},
"npm": {
"tag": "next"
},
"lint-staged": {
"*.md": "prettier --write",
"*.{ts,tsx,js,vue,less}": "prettier --write",
"*.{ts,tsx,js,vue}": "eslint --fix",
"*.{vue,css,less}": "stylelint --fix"
},
"repository": {
"type": "git",
"url": "git@github.com:youzan/vant.git"
},
"keywords": [
"ui",
"vue",
"vue3",
"mobile",
"frontend",
"component",
"components"
],
"author": "youzanfe",
"license": "MIT",
"dependencies": {
"@vant/icons": "^1.7.0",
"@vant/lazyload": "^1.2.0",
"@vant/popperjs": "^1.1.0",
"@vant/use": "^1.3.0"
},
"peerDependencies": {
"vue": "^3.0.0"
},
"devDependencies": {
"@vant/cli": "^4.0.0-beta.1",
"@vant/area-data": "^1.1.1",
"@vue/compiler-sfc": "^3.2.6",
"vue": "^3.2.6"
},
"sideEffects": [
"es/**/style/*",
"lib/**/style/*",
"*.css",
"*.less"
],
"vetur": {
"tags": "vetur/tags.json",
"attributes": "vetur/attributes.json"
},
"web-types": "vetur/web-types.json",
"unpkg": "lib/vant.min.js",
"jsdelivr": "lib/vant.min.js"
"dev": "cd packages/vant && yarn dev",
"lint": "cd packages/vant && yarn lint",
"test": "cd packages/vant && yarn test",
"build": "cd packages/vant && yarn build",
"build:site": "cd packages/vant && build:site"
}
}

View File

@ -10,7 +10,7 @@ Vant use [Less](http://lesscss.org/) as css preprocessoryou can override the
### Less variables
There are some [basic variables](<(https://github.com/youzan/vant/blob/dev/src/style/var.less)>) below, for component less variables, please refer to the documentation of each component, or view the `var.less` file in the component source directory.
There are some [basic variables](<(https://github.com/youzan/vant/blob/dev/packages/vant/src/style/var.less)>) below, for component less variables, please refer to the documentation of each component, or view the `var.less` file in the component source directory.
```less
// Color Palette

View File

@ -16,7 +16,7 @@ Vant 提供了一套默认主题CSS 命名采用 BEM 的风格,方便使用
Vant 使用了 [Less](http://lesscss.org/) 对样式进行预处理,并内置了一些样式变量,通过替换样式变量即可定制你自己需要的主题。
下面是所有的[基础样式变量](https://github.com/youzan/vant/blob/dev/src/style/var.less),组件的样式变量请参考各个组件的文档,或查看组件源码目录下的 `var.less` 文件。
下面是所有的[基础样式变量](https://github.com/youzan/vant/blob/dev/packages/vant/src/style/var.less),组件的样式变量请参考各个组件的文档,或查看组件源码目录下的 `var.less` 文件。
```less
// Color Palette

View File

@ -54,16 +54,12 @@ export default {
### 类型定义
```ts
function useParent<T>(
key: string | symbol
): {
function useParent<T>(key: string | symbol): {
parent?: T;
index?: Ref<number>;
};
function useChildren(
key: string | symbol
): {
function useChildren(key: string | symbol): {
children: ComponentPublicInstance[];
linkChildren: (value: any) => void;
};

View File

@ -1,5 +1,5 @@
module.exports = {
testPathIgnorePatterns: ['/node_modules/', '/packages/'],
testPathIgnorePatterns: ['/node_modules/'],
collectCoverageFrom: [
'src/**/*.{js,jsx,ts,tsx,vue}',
'!**/demo/**',

View File

@ -0,0 +1,80 @@
{
"name": "vant",
"version": "3.2.2",
"description": "Mobile UI Components built on Vue",
"main": "lib/index.js",
"module": "es/index.js",
"style": "lib/index.css",
"typings": "lib/index.d.ts",
"files": [
"es",
"lib",
"vetur"
],
"publishConfig": {
"registry": "https://registry.npmjs.org/"
},
"scripts": {
"dev": "vant-cli dev",
"lint": "vant-cli lint",
"test": "vant-cli test",
"build": "vant-cli build",
"build:site": "vant-cli build-site",
"release": "vant-cli release --tag next",
"release:site": "yarn build:site && gh-pages -d site --add --dest v3",
"test:watch": "vant-cli test --watch",
"test:coverage": "open test/coverage/index.html"
},
"lint-staged": {
"*.md": "prettier --write",
"*.{ts,tsx,js,vue,less}": "prettier --write",
"*.{ts,tsx,js,vue}": "eslint --fix",
"*.{vue,css,less}": "stylelint --fix"
},
"npm": {
"tag": "next"
},
"repository": {
"type": "git",
"url": "git@github.com:youzan/vant.git"
},
"keywords": [
"ui",
"vue",
"vue3",
"mobile",
"frontend",
"component",
"components"
],
"author": "youzanfe",
"license": "MIT",
"dependencies": {
"@vant/icons": "^1.7.0",
"@vant/lazyload": "^1.2.0",
"@vant/popperjs": "^1.1.0",
"@vant/use": "^1.3.0"
},
"peerDependencies": {
"vue": "^3.0.0"
},
"devDependencies": {
"@vant/cli": "^4.0.0-beta.1",
"@vant/area-data": "^1.1.1",
"@vue/compiler-sfc": "^3.2.6",
"vue": "^3.2.6"
},
"sideEffects": [
"es/**/style/*",
"lib/**/style/*",
"*.css",
"*.less"
],
"vetur": {
"tags": "vetur/tags.json",
"attributes": "vetur/attributes.json"
},
"web-types": "vetur/web-types.json",
"unpkg": "lib/vant.min.js",
"jsdelivr": "lib/vant.min.js"
}

View File

@ -79,15 +79,8 @@ export default defineComponent({
};
const renderOption = (item: ActionSheetAction, index: number) => {
const {
name,
color,
subname,
loading,
callback,
disabled,
className,
} = item;
const { name, color, subname, loading, callback, disabled, className } =
item;
const Content = loading ? (
<Loading class={bem('loading-icon')} />

Some files were not shown because too many files have changed in this diff Show More