Merge branch 'dev' into next
This commit is contained in:
@@ -10,7 +10,7 @@ Vant CLI is a tool for building vue component library. You can quickly build a f
|
||||
|
||||
- Provides rich commands covering the complete process from development to deploy
|
||||
- Based on conventional directory structure. Generate elegant document website and component examples automatically.
|
||||
- ESlint Stylelint built-in.
|
||||
- ESlint built-in.
|
||||
- Support Tree Shaking/Theme Customization/Import on Demand
|
||||
|
||||
### Quickstart
|
||||
@@ -50,16 +50,12 @@ Please add the followed config to `package.json` file.
|
||||
"nano-staged": {
|
||||
"*.md": "prettier --write",
|
||||
"*.{ts,tsx,js,vue,less,scss}": "prettier --write",
|
||||
"*.{ts,tsx,js,vue}": "eslint --fix",
|
||||
"*.{vue,css,less,scss}": "stylelint --fix"
|
||||
"*.{ts,tsx,js,vue}": "eslint --fix"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"root": true,
|
||||
"extends": ["@vant"]
|
||||
},
|
||||
"stylelint": {
|
||||
"extends": ["@vant/stylelint-config"]
|
||||
},
|
||||
"prettier": {
|
||||
"singleQuote": true
|
||||
},
|
||||
@@ -69,7 +65,7 @@ Please add the followed config to `package.json` file.
|
||||
|
||||
## More Details
|
||||
|
||||
- [cli](https://github.com/youzan/vant/tree/dev/packages/vant-cli/docs/commands.md)
|
||||
- [config](https://github.com/youzan/vant/tree/dev/packages/vant-cli/docs/config.md)
|
||||
- [directory structure](https://github.com/youzan/vant/tree/dev/packages/vant-cli/docs/directory.md)
|
||||
- [CHANGELOG](https://github.com/youzan/vant/tree/dev/packages/vant-cli/changelog.md)
|
||||
- [cli](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli/docs/commands.md)
|
||||
- [config](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli/docs/config.md)
|
||||
- [directory structure](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli/docs/directory.md)
|
||||
- [CHANGELOG](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli/changelog.md)
|
||||
|
||||
@@ -6,7 +6,7 @@ Vant CLI 是一个 Vue 组件库构建工具,通过 Vant CLI 可以快速搭
|
||||
|
||||
- 提供丰富的命令,涵盖从开发测试到构建发布的完整流程
|
||||
- 基于约定的目录结构,自动生成优雅的文档站点和组件示例
|
||||
- 内置 ESLint、Stylelint 校验规则,提交代码时自动执行校验
|
||||
- 内置 ESLint 校验规则,提交代码时自动执行校验
|
||||
- 构建后的组件库默认支持按需引入、主题定制、Tree Shaking
|
||||
|
||||
### 快速上手
|
||||
@@ -46,16 +46,12 @@ pnpm add @vant/cli -D
|
||||
"nano-staged": {
|
||||
"*.md": "prettier --write",
|
||||
"*.{ts,tsx,js,vue,less,scss}": "prettier --write",
|
||||
"*.{ts,tsx,js,vue}": "eslint --fix",
|
||||
"*.{vue,css,less,scss}": "stylelint --fix"
|
||||
"*.{ts,tsx,js,vue}": "eslint --fix"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"root": true,
|
||||
"extends": ["@vant"]
|
||||
},
|
||||
"stylelint": {
|
||||
"extends": ["@vant/stylelint-config"]
|
||||
},
|
||||
"prettier": {
|
||||
"singleQuote": true
|
||||
},
|
||||
@@ -65,7 +61,7 @@ pnpm add @vant/cli -D
|
||||
|
||||
## 详细文档
|
||||
|
||||
- [命令](https://github.com/youzan/vant/tree/dev/packages/vant-cli/docs/commands.zh-CN.md)
|
||||
- [配置指南](https://github.com/youzan/vant/tree/dev/packages/vant-cli/docs/config.zh-CN.md)
|
||||
- [目录结构](https://github.com/youzan/vant/tree/dev/packages/vant-cli/docs/directory.zh-CN.md)
|
||||
- [更新日志](https://github.com/youzan/vant/tree/dev/packages/vant-cli/changelog.md)
|
||||
- [命令](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli/docs/commands.zh-CN.md)
|
||||
- [配置指南](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli/docs/config.zh-CN.md)
|
||||
- [目录结构](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli/docs/directory.zh-CN.md)
|
||||
- [更新日志](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli/changelog.md)
|
||||
|
||||
@@ -2,8 +2,28 @@
|
||||
|
||||
## v5.0.0 (未发布)
|
||||
|
||||
- 升级 `vite` 3.0.0
|
||||
- 不再默认安装 `gh-pages` 依赖,请将 `package.json` 中的 `gh-pages -d site-dist` 替换为 `npx gh-pages -d site-dist`
|
||||
### 依赖升级
|
||||
|
||||
对以下依赖进行了大版本升级:
|
||||
|
||||
- vite v3
|
||||
- @vitejs/plugin-vue v3
|
||||
- @vitejs/plugin-vue-jsx v2
|
||||
|
||||
### 依赖精简
|
||||
|
||||
- 不再默认安装 `gh-pages` 依赖,请按照如下方式更新 `package.json`:
|
||||
|
||||
```diff
|
||||
- "release:site": "pnpm build:site && gh-pages -d site-dist",
|
||||
+ "release:site": "pnpm build:site && npx gh-pages -d site-dist",
|
||||
```
|
||||
|
||||
- 不再默认内置 `stylelint`,需要的话可以自行安装:
|
||||
|
||||
```bash
|
||||
yarn add stylelint@13 @vant/stylelint-config
|
||||
```
|
||||
|
||||
## v4.0.3
|
||||
|
||||
@@ -411,15 +431,15 @@ yarn add sass
|
||||
|
||||
`2020-03-29`
|
||||
|
||||
- 优化网站导航栏在大屏上的适配 ([#5928](https://github.com/youzan/vant/pull/5928))
|
||||
- 优化网站导航栏在大屏上的适配 ([#5928](https://github.com/vant-ui/vant/pull/5928))
|
||||
|
||||
### v2.3.0
|
||||
|
||||
`2020-03-25`
|
||||
|
||||
- build 命令支持编译 scoped 样式 ([#5910](https://github.com/youzan/vant/pull/5910))
|
||||
- build 命令支持生成 WebStorm 组件定义文件 ([#5899](https://github.com/youzan/vant/issues/5899))
|
||||
- clean 命令现在会移除而不是清空文件夹 ([#5895](https://github.com/youzan/vant/issues/5895))
|
||||
- build 命令支持编译 scoped 样式 ([#5910](https://github.com/vant-ui/vant/pull/5910))
|
||||
- build 命令支持生成 WebStorm 组件定义文件 ([#5899](https://github.com/vant-ui/vant/issues/5899))
|
||||
- clean 命令现在会移除而不是清空文件夹 ([#5895](https://github.com/vant-ui/vant/issues/5895))
|
||||
- 升级 @vant/markdown-vetur 2.0.0
|
||||
|
||||
### v2.2.8
|
||||
@@ -453,7 +473,7 @@ yarn add sass
|
||||
|
||||
`2020-02-14`
|
||||
|
||||
- 修复在 windows 上构建出的样式入口文件路径错误的问题 ([#5655](https://github.com/youzan/vant/pull/5655)
|
||||
- 修复在 windows 上构建出的样式入口文件路径错误的问题 ([#5655](https://github.com/vant-ui/vant/pull/5655)
|
||||
|
||||
### v2.2.3
|
||||
|
||||
@@ -465,14 +485,14 @@ yarn add sass
|
||||
|
||||
`2020-02-05`
|
||||
|
||||
- 修复在 windows 上获取 markdown 路径错误的问题 ([#5626](https://github.com/youzan/vant/pull/5626))
|
||||
- 修复在 windows 上获取 markdown 路径错误的问题 ([#5626](https://github.com/vant-ui/vant/pull/5626))
|
||||
|
||||
### v2.2.1
|
||||
|
||||
`2020-02-04`
|
||||
|
||||
- 升级 babel@7.8
|
||||
- 修复切换版本时跳转 undefined 的问题 ([#5620](https://github.com/youzan/vant/pull/5620))
|
||||
- 修复切换版本时跳转 undefined 的问题 ([#5620](https://github.com/vant-ui/vant/pull/5620))
|
||||
|
||||
### v2.2.0
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ Start local dev server for browsering components and demo.
|
||||
|
||||
Build Vue component library.
|
||||
|
||||
Files will be output to `es` and `lib` directory. More details [directory structure](https://github.com/youzan/vant/tree/dev/packages/vant-cli/docs/directory.md)
|
||||
Files will be output to `es` and `lib` directory. More details [directory structure](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli/docs/directory.md)
|
||||
|
||||
Please add the followed config to `package.json` when publish to npm.
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ npx vant-cli dev
|
||||
|
||||
构建组件库。
|
||||
|
||||
运行 build 命令会在 `es` 和 `lib` 目录下生成可用于生产环境的组件代码,详见 [目录结构](https://github.com/youzan/vant/tree/dev/packages/vant-cli/docs/directory.zh-CN.md)。
|
||||
运行 build 命令会在 `es` 和 `lib` 目录下生成可用于生产环境的组件代码,详见 [目录结构](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli/docs/directory.zh-CN.md)。
|
||||
|
||||
发布 npm 时,请将以下配置加入到 `package.json` 中,使 npm 包能被正确识别:
|
||||
|
||||
|
||||
@@ -32,10 +32,10 @@
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/youzan/vant.git",
|
||||
"url": "https://github.com/vant-ui/vant.git",
|
||||
"directory": "packages/vant-cli"
|
||||
},
|
||||
"bugs": "https://github.com/youzan/vant/issues",
|
||||
"bugs": "https://github.com/vant-ui/vant/issues",
|
||||
"author": "chenjiahan",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
@@ -55,7 +55,6 @@
|
||||
"@types/jest": "^27.0.3",
|
||||
"@vant/eslint-config": "^3.3.2",
|
||||
"@vant/markdown-vetur": "^2.3.0",
|
||||
"@vant/stylelint-config": "^1.4.2",
|
||||
"@vant/touch-emulator": "^1.3.2",
|
||||
"@vitejs/plugin-vue": "^3.0.1",
|
||||
"@vitejs/plugin-vue-jsx": "^2.0.0",
|
||||
@@ -85,7 +84,6 @@
|
||||
"postcss-load-config": "^3.1.0",
|
||||
"prettier": "^2.5.0",
|
||||
"release-it": "^15.1.1",
|
||||
"stylelint": "^13.0.0",
|
||||
"transliteration": "^2.2.0",
|
||||
"typescript": "^4.7.4",
|
||||
"vite": "^3.0.0",
|
||||
|
||||
@@ -16,7 +16,7 @@ program
|
||||
|
||||
program
|
||||
.command('lint')
|
||||
.description('Run eslint and stylelint')
|
||||
.description('Run ESLint')
|
||||
.action(async () => {
|
||||
const { lint } = await import('./commands/lint.js');
|
||||
return lint();
|
||||
|
||||
@@ -44,23 +44,10 @@ function eslint() {
|
||||
);
|
||||
}
|
||||
|
||||
function stylelint() {
|
||||
return runCommand(
|
||||
'stylelint',
|
||||
['src/**/*.css', 'src/**/*.vue', 'src/**/*.less', 'src/**/*.sass', '--fix'],
|
||||
{
|
||||
start: 'Running stylelint...',
|
||||
succeed: 'Stylelint Passed.',
|
||||
failed: 'Stylelint failed!',
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export async function lint() {
|
||||
const eslintPassed = await eslint();
|
||||
const stylelintPassed = await stylelint();
|
||||
|
||||
if (!eslintPassed || !stylelintPassed) {
|
||||
if (!eslintPassed) {
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@ export function getViteConfigForSiteProd(): InlineConfig {
|
||||
outDir,
|
||||
reportCompressedSize: false,
|
||||
emptyOutDir: true,
|
||||
// https://github.com/youzan/vant/issues/9703
|
||||
// https://github.com/vant-ui/vant/issues/9703
|
||||
cssTarget: ['chrome53'],
|
||||
rollupOptions: {
|
||||
input: {
|
||||
|
||||
Reference in New Issue
Block a user