Merge branch 'dev' into next

This commit is contained in:
chenjiahan 2021-11-10 15:31:33 +08:00
commit e713e8eade
76 changed files with 9086 additions and 20526 deletions

View File

@ -26,8 +26,14 @@ It's welcomed to pull request, And there are some tips about that:
## Getting started
You will need [Node.js >= 14](https://nodejs.org) and [pnpm](https://pnpm.io).
```bash
git clone git@github.com:youzan/vant.git
yarn && yarn dev
# Install dependencies
pnpm i
# Start development
pnpm dev
```

View File

@ -1,11 +0,0 @@
请使用下面的链接创建 issue 以帮助我们更快的排查问题,不规范的 issue 会被关闭,感谢配合。
http://vant-contrib.gitee.io/vant-issue-generater
如果遇到了用法上的问题或想法,建议在 [Discussions 讨论区](https://github.com/youzan/vant/discussions) 发帖进行讨论。
---
Please use the link below to create a new issue, the non-standard issue will be closed.
https://youzan.github.io/vant-issue-generater

1
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@ -0,0 +1 @@
blank_issues_enabled: true

View File

@ -0,0 +1,56 @@
name: 我要反馈 Vant 的 Bug
description: 通过标准模板进行 Bug 反馈。
title: "[Bug Report] 在此填写标题"
labels: ["🐞 bug"]
body:
- type: markdown
attributes:
value: |
在提交 Bug 报告前,请注意:
- 确认你的问题无法通过官方文档得到解决。
- 确认你搜索过 [历史 issue](https://github.com/youzan/vant/issues),并且没有发现同样的问题。
- 如果不是反馈 Bug请到 [Discussions 讨论区](https://github.com/youzan/vant/discussions) 发帖。
- type: input
id: reproduce
attributes:
label: 重现链接
description: 请提供一个尽可能简单的 [codesandbox](https://codesandbox.io/s/m5v3f) 或 GitHub 仓库链接。不要填写无效的链接,这会导致你的 issue 被直接关闭。
validations:
required: true
- type: input
id: version
attributes:
label: Vant 版本
description: 你正在使用的 Vant 版本是多少?(请填写 node_modules/vant/package.json 里实际安装的版本)
placeholder: 比如 3.2.0
validations:
required: true
- type: textarea
id: description
attributes:
label: 描述一下你遇到的问题。
placeholder: 比如:弹窗无法展示、日历组件报错
validations:
required: true
- type: textarea
id: reproduce-steps
attributes:
label: 重现步骤
description: 请提供一个最简单的操作步骤,方便我们快速重现问题。
placeholder: |
比如:
1. 点击按钮
2. 弹窗无法展示
validations:
required: true
- type: input
id: browsers
attributes:
label: 设备/浏览器
description: 在哪些设备/浏览器上能重现这个问题?

View File

@ -0,0 +1,51 @@
name: 我要反馈 Vant Cli 的 Bug
description: 通过标准模板进行 Bug 反馈。
title: "[Bug Report] 在此填写标题"
labels: ["🐞 bug", "cli"]
body:
- type: markdown
attributes:
value: |
在提交 Bug 报告前,请注意:
- 确认你的问题无法通过官方文档得到解决。
- 确认你搜索过 [历史 issue](https://github.com/youzan/vant/issues),并且没有发现同样的问题。
- 如果不是反馈 Bug请到 [Discussions 讨论区](https://github.com/youzan/vant/discussions) 发帖。
- type: input
id: reproduce
attributes:
label: 重现链接
description: 请提供一个尽可能简单的 [codesandbox](https://codesandbox.io/s/m5v3f) 或 GitHub 仓库链接。不要填写无效的链接,这会导致你的 issue 被直接关闭。
validations:
required: true
- type: input
id: version
attributes:
label: Vant Cli 版本
description: 你正在使用的 Vant Cli 版本是多少?(请填写 node_modules/@vant/cli/package.json 里实际安装的版本)
placeholder: 比如 3.2.0
validations:
required: true
- type: textarea
id: description
attributes:
label: 描述一下你遇到的问题。
placeholder: 比如:组件构建失败
validations:
required: true
- type: textarea
id: reproduce-steps
attributes:
label: 重现步骤
description: 请提供一个最简单的操作步骤,方便我们快速重现问题。
placeholder: |
比如:
1. 克隆仓库
2. 运行 yarn build
3. 组件构建失败
validations:
required: true

View File

@ -0,0 +1,33 @@
name: 我想要一个 Vant 的新功能
description: 通过标准模板描述一下你的功能需求。
title: "[Feature Request] 在此填写标题"
labels: ["💡 feature"]
body:
- type: markdown
attributes:
value: |
在提交功能需求前,请注意:
- 确认这是一个通用功能,并且无法通过现有的 API 或 Slot 实现。
- 确认你搜索过 [历史 issue](https://github.com/youzan/vant/issues),并且没有发现同样的需求。
- 可以先到 [Discussions 讨论区](https://github.com/youzan/vant/discussions) 发帖,讨论一下需求是否合理。
- type: textarea
id: description
attributes:
label: 这个功能解决了什么问题?
description: 请尽可能详细地说明这个功能的使用场景。
validations:
required: true
- type: textarea
id: api
attributes:
label: 你期望的 API 是什么样子的?
description: 描述一下这个新功能的 API并提供一些代码示例。
placeholder: |
```xml
<van-button some-prop="xxx" />
```
validations:
required: true

View File

@ -0,0 +1,29 @@
name: 我想要一个 Vant Cli 的新功能
description: 通过标准模板描述一下你的功能需求。
title: "[Feature Request] 在此填写标题"
labels: ["💡 feature", "cli"]
body:
- type: markdown
attributes:
value: |
在提交功能需求前,请注意:
- 确认这是一个通用功能,并且无法通过现有的 API 实现。
- 确认你搜索过 [历史 issue](https://github.com/youzan/vant/issues),并且没有发现同样的需求。
- 可以先到 [Discussions 讨论区](https://github.com/youzan/vant/discussions) 发帖,讨论一下需求是否合理。
- type: textarea
id: description
attributes:
label: 这个功能解决了什么问题?
description: 请尽可能详细地说明这个功能的使用场景。
validations:
required: true
- type: textarea
id: api
attributes:
label: 你期望的 API 是什么样子的?
description: 描述一下这个新功能的 API并提供一些代码示例。
validations:
required: true

View File

@ -0,0 +1,40 @@
name: Bug Report
description: Use issue template to report a bug.
title: "[Bug Report] Title"
labels: ["🐞 bug"]
body:
- type: input
id: reproduce
attributes:
label: Reproduction Link
description: Please provide a simple [codesandbox](https://codesandbox.io/s/m5v3f) or GitHub repository link. Do not fill in invalid links, this will cause your issue to be closed directly.
validations:
required: true
- type: input
id: version
attributes:
label: Vant Version
description: Please fill in the version actually installed in node_modules/vant/package.json
placeholder: E.g. 3.2.0
validations:
required: true
- type: textarea
id: description
attributes:
label: Describe the Bug
validations:
required: true
- type: textarea
id: reproduce-steps
attributes:
label: Reproduce Steps
validations:
required: true
- type: input
id: browsers
attributes:
label: Device / Browser

View File

@ -0,0 +1,23 @@
name: Feature Request
description: Use issue template to request a new feature.
title: "[Feature Request] Title"
labels: ["💡 feature"]
body:
- type: textarea
id: description
attributes:
label: What problem does this feature solve?
validations:
required: true
- type: textarea
id: api
attributes:
label: What does the proposed API look like?
description: Describe the new API, provide some code examples.
placeholder: |
```xml
<van-button some-prop="xxx" />
```
validations:
required: true

View File

@ -1,14 +0,0 @@
name: Compressed Size
on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: preactjs/compressed-size-action@v2
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
pattern: './packages/vant/lib/{vant.min.js,index.css}'

View File

@ -15,8 +15,18 @@ jobs:
with:
ref: 'dev'
- name: Install pnpm
uses: pnpm/action-setup@v2.0.1
with:
version: 6.20.3
- uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'pnpm'
- name: Install dependencies
uses: bahmutov/npm-install@v1
run: pnpm install
- name: Build Site
run: npm run build:site

View File

@ -6,13 +6,20 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/checkout@v2
- name: Install pnpm
uses: pnpm/action-setup@v2.0.1
with:
node-version: '14.x'
version: 6.20.3
- uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'pnpm'
- name: Install dependencies
uses: bahmutov/npm-install@v1
run: pnpm install
- name: Run linter
run: npm run lint
@ -20,13 +27,20 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/checkout@v2
- name: Install pnpm
uses: pnpm/action-setup@v2.0.1
with:
node-version: '14.x'
version: 6.20.3
- uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'pnpm'
- name: Install dependencies
uses: bahmutov/npm-install@v1
run: pnpm install
- name: Run test cases
run: npm test
@ -39,13 +53,20 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/checkout@v2
- name: Install pnpm
uses: pnpm/action-setup@v2.0.1
with:
node-version: '14.x'
version: 6.20.3
- uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'pnpm'
- name: Install dependencies
uses: bahmutov/npm-install@v1
run: pnpm install
- name: Build
run: npm run build

1
.npmrc Normal file
View File

@ -0,0 +1 @@
registry=https://registry.npmmirror.com/

View File

@ -1,23 +1,27 @@
{
"private": true,
"workspaces": [
"packages/vant",
"packages/vant-cli",
"packages/vant-eslint-config",
"packages/vant-stylelint-config"
],
"scripts": {
"prepare": "husky install && cd packages/vant-cli && yarn build",
"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 && yarn build:site"
"prepare": "husky install",
"dev": "pnpm dev --dir ./packages/vant",
"lint": "pnpm lint --dir ./packages/vant",
"test": "pnpm test --dir ./packages/vant",
"build": "pnpm build --dir ./packages/vant",
"build:site": "pnpm build:site --dir ./packages/vant"
},
"lint-staged": {
"*.md": "prettier --write",
"*.{ts,tsx,js,vue,less}": "prettier --write",
"*.{ts,tsx,js,vue}": "eslint --fix",
"*.{vue,css,less}": "stylelint --fix"
},
"packageManager": "pnpm",
"devDependencies": {
"@vant/cli": "workspace:*",
"@vant/eslint-config": "workspace:*",
"eslint": "^8.2.0",
"husky": "^7.0.4",
"lint-staged": "^11.2.6",
"prettier": "^2.4.1",
"stylelint": "^13.13.1"
}
}

View File

@ -8,7 +8,9 @@
},
"scripts": {
"dev": "tsc --watch",
"release": "tsc & release-it"
"build": "tsc",
"release": "pnpm build & release-it",
"prepare": "pnpm build"
},
"repository": {
"type": "git",
@ -27,20 +29,17 @@
"author": "chenjiahan",
"license": "MIT",
"devDependencies": {
"@types/fs-extra": "^8.1.0",
"@types/yeoman-environment": "^2.3.3",
"@types/yeoman-generator": "^3.1.4",
"release-it": "^13.0.0",
"typescript": "^3.8.3"
"@types/fs-extra": "^9.0.13",
"@types/inquirer": "^8.1.3",
"release-it": "^14.11.6",
"typescript": "4.x"
},
"dependencies": {
"chalk": "^3.0.0",
"chalk": "^4.1.2",
"consola": "^2.11.3",
"fast-glob": "^3.2.4",
"fs-extra": "^8.1.0",
"inquirer": "^7.0.6",
"yeoman-environment": "^2.8.0",
"yeoman-generator": "^4.6.0"
"fs-extra": "^10.0.0",
"inquirer": "^8.0.0"
},
"release-it": {
"git": {

View File

@ -1,10 +1,10 @@
import fs from 'fs-extra';
import glob from 'fast-glob';
import chalk from 'chalk';
import consola from 'consola';
import { join } from 'path';
import { prompt } from 'inquirer';
import { sep, join } from 'path';
import { CWD, GENERATOR_DIR } from './constant';
import Yeoman from 'yeoman-environment';
import Generator from 'yeoman-generator';
const PROMPTS = [
{
@ -30,7 +30,9 @@ const PROMPTS = [
},
];
export class VanGenerator extends Generator {
export class VanGenerator {
outputDir = '';
inputs = {
name: '',
cssLang: '',
@ -39,18 +41,18 @@ export class VanGenerator extends Generator {
};
constructor(name: string) {
super([], {
env: Yeoman.createEnv([], {
cwd: join(CWD, name),
}),
resolved: GENERATOR_DIR,
});
this.inputs.name = name;
this.outputDir = join(CWD, name);
}
async run() {
await this.prompting();
this.writing();
this.end();
}
async prompting() {
return this.prompt<Record<string, string>>(PROMPTS).then((inputs) => {
return prompt<Record<string, string>>(PROMPTS).then((inputs) => {
const preprocessor = inputs.preprocessor.toLowerCase();
const cssLang = preprocessor === 'sass' ? 'scss' : preprocessor;
@ -61,36 +63,43 @@ export class VanGenerator extends Generator {
}
writing() {
consola.info(`Creating project in ${join(CWD, this.inputs.name)}\n`);
/**
@see {@link https://github.com/mrmlnc/fast-glob#how-to-write-patterns-on-windows}
*/
const templatePath = join(GENERATOR_DIR, this.inputs.vueVersion).replace(/\\/g, '/');
const templateFiles = glob.sync(join(templatePath, '**', '*').replace(/\\/g, '/'), {
dot: true,
});
const destinationRoot = this.destinationRoot();
console.log();
consola.info(`Creating project in ${chalk.green(this.outputDir)}\n`);
// see https://github.com/mrmlnc/fast-glob#how-to-write-patterns-on-windows
const templatePath = join(GENERATOR_DIR, this.inputs.vueVersion).replace(
/\\/g,
'/'
);
const templateFiles = glob.sync(
join(templatePath, '**', '*').replace(/\\/g, '/'),
{
dot: true,
}
);
templateFiles.forEach((filePath) => {
const outputPath = filePath
.replace('.tpl', '')
.replace(templatePath, destinationRoot);
this.fs.copyTpl(filePath, outputPath, this.inputs);
.replace(templatePath, this.outputDir);
this.copyTpl(filePath, outputPath, this.inputs);
});
}
install() {
console.log();
consola.info('Install dependencies...\n');
copyTpl(from: string, to: string, args: Record<string, any>) {
fs.copySync(from, to);
let content = fs.readFileSync(to, 'utf-8');
process.chdir(this.inputs.name);
this.installDependencies({
npm: false,
bower: false,
yarn: true,
skipMessage: true,
Object.keys(args).forEach((key) => {
const regexp = new RegExp(`<%= ${key} %>`, 'g');
content = content.replace(regexp, args[key]);
});
fs.writeFileSync(to, content);
const name = to.replace(this.outputDir + sep, '');
consola.success(`${chalk.green('create')} ${name}`);
}
end() {
@ -99,7 +108,9 @@ export class VanGenerator extends Generator {
console.log();
consola.success(`Successfully created ${chalk.yellow(name)}.`);
consola.success(
`Run ${chalk.yellow(`cd ${name} && yarn dev`)} to start development!`
`Run ${chalk.yellow(
`cd ${name} && git init && yarn && yarn dev`
)} to start development!`
);
}
}

View File

@ -1,7 +1,7 @@
#!/usr/bin/env node
import inquirer from 'inquirer';
import consola from 'consola';
import { prompt } from 'inquirer';
import { ensureDir } from 'fs-extra';
import { VanGenerator } from './generator';
@ -13,14 +13,13 @@ const PROMPTS = [
},
];
export default async function run() {
const { name } = await inquirer.prompt(PROMPTS);
async function run() {
const { name } = await prompt(PROMPTS);
try {
await ensureDir(name);
const generator = new VanGenerator(name);
generator.run();
await generator.run();
} catch (e) {
consola.error(e);
}

File diff suppressed because it is too large Load Diff

View File

@ -2,14 +2,16 @@
"name": "@vant/area-data",
"version": "1.1.3",
"description": "Vant 省市区数据",
"main": "lib/index.js",
"main": "./lib/index.js",
"typings": "./lib/index.d.ts",
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
},
"scripts": {
"build": "tsc",
"release": "yarn build && npm publish"
"release": "pnpm build && npm publish",
"prepare": "pnpm build"
},
"license": "MIT",
"repository": "https://github.com/youzan/vant"

View File

@ -2,7 +2,7 @@
"compilerOptions": {
"target": "ES2019",
"outDir": "./lib",
"module": "commonjs",
"module": "ES2015",
"strict": true,
"declaration": true,
"skipLibCheck": true,

View File

@ -1,26 +0,0 @@
/**
* @babel/preset-typescript 不支持编译 Vue 文件中的 ts 代码
* 通过手动添加 @babel/plugin-transform-typescript 的方式来解决这个问题
* see: https://github.com/babel/babel-loader/pull/738
*/
const { readFileSync } = require('fs');
const { declare } = require('@babel/helper-plugin-utils');
module.exports = declare(() => ({
overrides: [
{
test: (filePath) => {
if (/\.vue$/.test(filePath)) {
const template = readFileSync(filePath, { encoding: 'utf8' });
return (
template.includes('lang="ts"') || template.includes("lang='ts'")
);
}
return false;
},
plugins: [require('@babel/plugin-transform-typescript')],
},
],
}));

View File

@ -17,7 +17,6 @@ module.exports = function (api, options) {
},
],
require.resolve('@babel/preset-typescript'),
require('./babel-preset-vue-ts.cjs'),
],
plugins: [
[

View File

@ -180,6 +180,13 @@ module.exports = {
};
```
### build.packageManager
- Type: `'npm' | 'yarn' | 'pnpm'`
- Default: `undefined`
指定使用的包管理器。
### site.title
- Type: `string`

View File

@ -1,6 +1,6 @@
{
"name": "@vant/cli",
"version": "4.0.0-rc.2",
"version": "4.0.0-rc.3",
"type": "module",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
@ -17,7 +17,8 @@
"scripts": {
"dev": "tsc --watch",
"build": "tsc",
"release": "yarn build & release-it"
"release": "pnpm build & release-it",
"prepare": "pnpm build"
},
"files": [
"lib",
@ -37,7 +38,6 @@
"@types/less": "^3.0.3",
"@types/lodash-es": "^4.17.5",
"@types/markdown-it": "^12.2.3",
"@types/postcss-load-config": "^3.0.1",
"@vue/compiler-sfc": "^3.2.20",
"vue": "^3.2.20"
},
@ -58,12 +58,15 @@
"@vue/test-utils": "2.0.0-rc.14",
"autoprefixer": "^10.4.0",
"babel-jest": "^27.3.1",
"chalk": "^4.1.2",
"clean-css": "^5.2.2",
"commander": "^8.3.0",
"consola": "^2.15.3",
"conventional-changelog": "^3.1.24",
"eslint": "^8.1.0",
"execa": "^5.1.1",
"fast-glob": "^3.2.7",
"fs-extra": "^10.0.0",
"gh-pages": "^3.2.3",
"hash-sum": "^2.0.0",
"highlight.js": "^11.3.1",

View File

@ -35,7 +35,7 @@ function runCommand(
function eslint() {
return runCommand(
'eslint',
['./src', '--fix', '--ext', [SCRIPT_EXTS, '.md'].join(',')],
['./src', '--fix', '--ext', SCRIPT_EXTS.join(',')],
{
start: 'Running eslint...',
succeed: 'ESLint Passed.',

View File

@ -1,6 +1,7 @@
import execa from 'execa';
import { consola } from './logger.js';
import { execSync } from 'child_process';
import { getVantConfig } from './constant.js';
let hasYarnCache: boolean;
@ -17,11 +18,21 @@ export function hasYarn() {
return hasYarnCache;
}
function getPackageManager() {
const { build } = getVantConfig();
if (build?.packageManager) {
return build?.packageManager;
}
return hasYarn() ? 'yarn' : 'npm';
}
export async function installDependencies() {
consola.info('Install Dependencies\n');
try {
const manager = hasYarn() ? 'yarn' : 'npm';
const manager = getPackageManager();
await execa(manager, ['install', '--prod=false'], {
stdio: 'inherit',

View File

@ -2,7 +2,9 @@ import { build } from 'vite';
import { mergeCustomViteConfig } from '../common/index.js';
import { getViteConfigForPackage } from '../config/vite.package.js';
export async function compilePackage(minify: boolean) {
export async function compilePackage(
minify: boolean
): ReturnType<typeof build> {
const config = mergeCustomViteConfig(getViteConfigForPackage(minify));
return build(config);
}

View File

@ -5,4 +5,3 @@ declare module 'clean-css';
declare module 'release-it';
declare module 'conventional-changelog';
declare module '@vant/markdown-vetur';
declare module '@babel/helper-plugin-utils';

View File

@ -4,7 +4,6 @@ module.exports = {
'airbnb-base',
'plugin:@typescript-eslint/recommended',
'prettier',
'plugin:markdown/recommended',
],
parserOptions: {

View File

@ -10,16 +10,15 @@
"license": "MIT",
"repository": "https://github.com/youzan/vant/tree/dev/packages/vant-eslint-config",
"dependencies": {
"@typescript-eslint/eslint-plugin": "^4.32.0",
"@typescript-eslint/parser": "^4.33.0",
"@typescript-eslint/eslint-plugin": "^5.3.1",
"@typescript-eslint/parser": "5.3.1",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.24.0",
"eslint-plugin-markdown": "^2.2.1",
"eslint-plugin-vue": "^7.18.0"
},
"devDependencies": {
"eslint": "^7.32.0",
"typescript": "^4.4.3"
"eslint": "^8.0.0",
"typescript": "4.x"
}
}

View File

@ -17,7 +17,7 @@
"license": "MIT",
"repository": "https://github.com/youzan/vant/tree/dev/packages/vant-icons",
"devDependencies": {
"release-it": "^13.6.2"
"release-it": "^14.11.6"
},
"release-it": {
"git": {

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,3 @@
module.exports = {
presets: [['@vant/cli/preset', { loose: true }]],
presets: [['@vant/cli/preset.cjs', { loose: true }]],
};

View File

@ -16,7 +16,8 @@
"scripts": {
"dev": "rollup --config rollup.config.js --watch",
"build": "rollup --config rollup.config.js",
"release": "npm run build && release-it"
"release": "pnpm build && release-it",
"prepare": "pnpm build"
},
"license": "MIT",
"repository": "https://github.com/youzan/vant/tree/dev/packages/vant-lazyload",
@ -24,6 +25,9 @@
"@vant/use": "^1.3.2"
},
"devDependencies": {
"vue": "3.x",
"@vue/runtime-core": "3.x",
"@vant/cli": "workspace:*",
"@rollup/plugin-babel": "^5.2.1",
"@rollup/plugin-node-resolve": "^10.0.0",
"release-it": "^14.2.2",

File diff suppressed because it is too large Load Diff

View File

@ -14,7 +14,7 @@
"highlight.js": "^10.7.1",
"loader-utils": "^2.0.0",
"markdown-it": "^12.0.4",
"markdown-it-anchor": "^7.1.0",
"markdown-it-anchor": "^8.0.0",
"transliteration": "^2.2.0"
}
}

View File

@ -1,227 +0,0 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
ansi-regex@^5.0.0:
version "5.0.1"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304"
integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==
ansi-styles@^4.0.0:
version "4.3.0"
resolved "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937"
integrity sha1-7dgDYornHATIWuegkG7a00tkiTc=
dependencies:
color-convert "^2.0.1"
argparse@^1.0.7:
version "1.0.10"
resolved "https://registry.npm.taobao.org/argparse/download/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911"
integrity sha1-vNZ5HqWuCXJeF+WtmIE0zUCz2RE=
dependencies:
sprintf-js "~1.0.2"
argparse@^2.0.1:
version "2.0.1"
resolved "https://registry.npm.taobao.org/argparse/download/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38"
integrity sha1-JG9Q88p4oyQPbJl+ipvR6sSeSzg=
big.js@^5.2.2:
version "5.2.2"
resolved "https://registry.npm.taobao.org/big.js/download/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328"
integrity sha1-ZfCvOC9Xi83HQr2cKB6cstd2gyg=
cliui@^7.0.2:
version "7.0.4"
resolved "https://registry.npm.taobao.org/cliui/download/cliui-7.0.4.tgz?cache=0&sync_timestamp=1604880333411&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcliui%2Fdownload%2Fcliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f"
integrity sha1-oCZe5lVHb8gHrqnfPfjfd4OAi08=
dependencies:
string-width "^4.2.0"
strip-ansi "^6.0.0"
wrap-ansi "^7.0.0"
color-convert@^2.0.1:
version "2.0.1"
resolved "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3"
integrity sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=
dependencies:
color-name "~1.1.4"
color-name@~1.1.4:
version "1.1.4"
resolved "https://registry.npm.taobao.org/color-name/download/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
integrity sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=
emoji-regex@^8.0.0:
version "8.0.0"
resolved "https://registry.npm.taobao.org/emoji-regex/download/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37"
integrity sha1-6Bj9ac5cz8tARZT4QpY79TFkzDc=
emojis-list@^3.0.0:
version "3.0.0"
resolved "https://registry.npm.taobao.org/emojis-list/download/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78"
integrity sha1-VXBmIEatKeLpFucariYKvf9Pang=
entities@~2.1.0:
version "2.1.0"
resolved "https://registry.npm.taobao.org/entities/download/entities-2.1.0.tgz?cache=0&sync_timestamp=1611535562200&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fentities%2Fdownload%2Fentities-2.1.0.tgz#992d3129cf7df6870b96c57858c249a120f8b8b5"
integrity sha1-mS0xKc999ocLlsV4WMJJoSD4uLU=
escalade@^3.1.1:
version "3.1.1"
resolved "https://registry.npm.taobao.org/escalade/download/escalade-3.1.1.tgz?cache=0&sync_timestamp=1602567437752&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fescalade%2Fdownload%2Fescalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40"
integrity sha1-2M/ccACWXFoBdLSoLqpcBVJ0LkA=
esprima@^4.0.0:
version "4.0.1"
resolved "https://registry.npm.taobao.org/esprima/download/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71"
integrity sha1-E7BM2z5sXRnfkatph6hpVhmwqnE=
front-matter@^4.0.2:
version "4.0.2"
resolved "https://registry.npm.taobao.org/front-matter/download/front-matter-4.0.2.tgz#b14e54dc745cfd7293484f3210d15ea4edd7f4d5"
integrity sha1-sU5U3HRc/XKTSE8yENFepO3X9NU=
dependencies:
js-yaml "^3.13.1"
get-caller-file@^2.0.5:
version "2.0.5"
resolved "https://registry.npm.taobao.org/get-caller-file/download/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e"
integrity sha1-T5RBKoLbMvNuOwuXQfipf+sDH34=
highlight.js@^10.7.1:
version "10.7.1"
resolved "https://registry.npm.taobao.org/highlight.js/download/highlight.js-10.7.1.tgz#a8ec4152db24ea630c90927d6cae2a45f8ecb955"
integrity sha1-qOxBUtsk6mMMkJJ9bK4qRfjsuVU=
is-fullwidth-code-point@^3.0.0:
version "3.0.0"
resolved "https://registry.npm.taobao.org/is-fullwidth-code-point/download/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d"
integrity sha1-8Rb4Bk/pCz94RKOJl8C3UFEmnx0=
js-yaml@^3.13.1:
version "3.13.1"
resolved "https://registry.npm.taobao.org/js-yaml/download/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847"
integrity sha1-r/FRswv9+o5J4F2iLnQV6d+jeEc=
dependencies:
argparse "^1.0.7"
esprima "^4.0.0"
json5@^2.1.2:
version "2.1.3"
resolved "https://registry.npm.taobao.org/json5/download/json5-2.1.3.tgz?cache=0&sync_timestamp=1586045666090&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjson5%2Fdownload%2Fjson5-2.1.3.tgz#c9b0f7fa9233bfe5807fe66fcf3a5617ed597d43"
integrity sha1-ybD3+pIzv+WAf+ZvzzpWF+1ZfUM=
dependencies:
minimist "^1.2.5"
linkify-it@^3.0.1:
version "3.0.2"
resolved "https://registry.npm.taobao.org/linkify-it/download/linkify-it-3.0.2.tgz#f55eeb8bc1d3ae754049e124ab3bb56d97797fb8"
integrity sha1-9V7ri8HTrnVASeEkqzu1bZd5f7g=
dependencies:
uc.micro "^1.0.1"
loader-utils@^2.0.0:
version "2.0.0"
resolved "https://registry.npm.taobao.org/loader-utils/download/loader-utils-2.0.0.tgz#e4cace5b816d425a166b5f097e10cd12b36064b0"
integrity sha1-5MrOW4FtQloWa18JfhDNErNgZLA=
dependencies:
big.js "^5.2.2"
emojis-list "^3.0.0"
json5 "^2.1.2"
markdown-it-anchor@^7.1.0:
version "7.1.0"
resolved "https://registry.npm.taobao.org/markdown-it-anchor/download/markdown-it-anchor-7.1.0.tgz#30fb21497bf59e83ff4d1ddc052d821962e2489e"
integrity sha1-MPshSXv1noP/TR3cBS2CGWLiSJ4=
markdown-it@^12.0.4:
version "12.0.4"
resolved "https://registry.npm.taobao.org/markdown-it/download/markdown-it-12.0.4.tgz#eec8247d296327eac3ba9746bdeec9cfcc751e33"
integrity sha1-7sgkfSljJ+rDupdGve7Jz8x1HjM=
dependencies:
argparse "^2.0.1"
entities "~2.1.0"
linkify-it "^3.0.1"
mdurl "^1.0.1"
uc.micro "^1.0.5"
mdurl@^1.0.1:
version "1.0.1"
resolved "https://registry.npm.taobao.org/mdurl/download/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e"
integrity sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=
minimist@^1.2.5:
version "1.2.5"
resolved "https://registry.npm.taobao.org/minimist/download/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
integrity sha1-Z9ZgFLZqaoqqDAg8X9WN9OTpdgI=
require-directory@^2.1.1:
version "2.1.1"
resolved "https://registry.npm.taobao.org/require-directory/download/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"
integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I=
sprintf-js@~1.0.2:
version "1.0.3"
resolved "https://registry.npm.taobao.org/sprintf-js/download/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=
string-width@^4.1.0, string-width@^4.2.0:
version "4.2.0"
resolved "https://registry.npm.taobao.org/string-width/download/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5"
integrity sha1-lSGCxGzHssMT0VluYjmSvRY7crU=
dependencies:
emoji-regex "^8.0.0"
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.0"
strip-ansi@^6.0.0:
version "6.0.0"
resolved "https://registry.npm.taobao.org/strip-ansi/download/strip-ansi-6.0.0.tgz?cache=0&sync_timestamp=1573280577145&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fstrip-ansi%2Fdownload%2Fstrip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532"
integrity sha1-CxVx3XZpzNTz4G4U7x7tJiJa5TI=
dependencies:
ansi-regex "^5.0.0"
transliteration@^2.2.0:
version "2.2.0"
resolved "https://registry.npm.taobao.org/transliteration/download/transliteration-2.2.0.tgz#e6333cc74b25ef4465bc27086ed8465c9a19211d"
integrity sha1-5jM8x0sl70RlvCcIbthGXJoZIR0=
dependencies:
yargs "^16.1.0"
uc.micro@^1.0.1, uc.micro@^1.0.5:
version "1.0.6"
resolved "https://registry.npm.taobao.org/uc.micro/download/uc.micro-1.0.6.tgz#9c411a802a409a91fc6cf74081baba34b24499ac"
integrity sha1-nEEagCpAmpH8bPdAgbq6NLJEmaw=
wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.npm.taobao.org/wrap-ansi/download/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha1-Z+FFz/UQpqaYS98RUpEdadLrnkM=
dependencies:
ansi-styles "^4.0.0"
string-width "^4.1.0"
strip-ansi "^6.0.0"
y18n@^5.0.5:
version "5.0.5"
resolved "https://registry.npm.taobao.org/y18n/download/y18n-5.0.5.tgz?cache=0&sync_timestamp=1609798602895&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fy18n%2Fdownload%2Fy18n-5.0.5.tgz#8769ec08d03b1ea2df2500acef561743bbb9ab18"
integrity sha1-h2nsCNA7HqLfJQCs71YXQ7u5qxg=
yargs-parser@^20.2.2:
version "20.2.7"
resolved "https://registry.npm.taobao.org/yargs-parser/download/yargs-parser-20.2.7.tgz?cache=0&sync_timestamp=1615404893185&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fyargs-parser%2Fdownload%2Fyargs-parser-20.2.7.tgz#61df85c113edfb5a7a4e36eb8aa60ef423cbc90a"
integrity sha1-Yd+FwRPt+1p6TjbriqYO9CPLyQo=
yargs@^16.1.0:
version "16.2.0"
resolved "https://registry.npm.taobao.org/yargs/download/yargs-16.2.0.tgz?cache=0&sync_timestamp=1617506941953&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fyargs%2Fdownload%2Fyargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66"
integrity sha1-HIK/D2tqZur85+8w43b0mhJHf2Y=
dependencies:
cliui "^7.0.2"
escalade "^3.1.1"
get-caller-file "^2.0.5"
require-directory "^2.1.1"
string-width "^4.2.0"
y18n "^5.0.5"
yargs-parser "^20.2.2"

View File

@ -16,13 +16,14 @@
"scripts": {
"dev": "tsc --watch",
"build": "tsc",
"release": "npm run build && npm publish"
"release": "pnpm build && npm publish",
"prepare": "pnpm build"
},
"dependencies": {
"fast-glob": "^3.2.2",
"fs-extra": "^9.0.0"
"fs-extra": "^10.0.0"
},
"devDependencies": {
"@types/fs-extra": "^8.1.0"
"@types/fs-extra": "^9.0.13"
}
}

View File

@ -1,162 +0,0 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@nodelib/fs.scandir@2.1.3":
version "2.1.3"
resolved "https://registry.npm.taobao.org/@nodelib/fs.scandir/download/@nodelib/fs.scandir-2.1.3.tgz#3a582bdb53804c6ba6d146579c46e52130cf4a3b"
integrity sha1-Olgr21OATGum0UZXnEblITDPSjs=
dependencies:
"@nodelib/fs.stat" "2.0.3"
run-parallel "^1.1.9"
"@nodelib/fs.stat@2.0.3", "@nodelib/fs.stat@^2.0.2":
version "2.0.3"
resolved "https://registry.npm.taobao.org/@nodelib/fs.stat/download/@nodelib/fs.stat-2.0.3.tgz#34dc5f4cabbc720f4e60f75a747e7ecd6c175bd3"
integrity sha1-NNxfTKu8cg9OYPdadH5+zWwXW9M=
"@nodelib/fs.walk@^1.2.3":
version "1.2.4"
resolved "https://registry.npm.taobao.org/@nodelib/fs.walk/download/@nodelib/fs.walk-1.2.4.tgz#011b9202a70a6366e436ca5c065844528ab04976"
integrity sha1-ARuSAqcKY2bkNspcBlhEUoqwSXY=
dependencies:
"@nodelib/fs.scandir" "2.1.3"
fastq "^1.6.0"
"@types/fs-extra@^8.1.0":
version "8.1.1"
resolved "https://registry.npm.taobao.org/@types/fs-extra/download/@types/fs-extra-8.1.1.tgz#1e49f22d09aa46e19b51c0b013cb63d0d923a068"
integrity sha1-HknyLQmqRuGbUcCwE8tj0NkjoGg=
dependencies:
"@types/node" "*"
"@types/node@*":
version "14.11.2"
resolved "https://registry.npm.taobao.org/@types/node/download/@types/node-14.11.2.tgz?cache=0&sync_timestamp=1600732726474&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fnode%2Fdownload%2F%40types%2Fnode-14.11.2.tgz#2de1ed6670439387da1c9f549a2ade2b0a799256"
integrity sha1-LeHtZnBDk4faHJ9UmireKwp5klY=
at-least-node@^1.0.0:
version "1.0.0"
resolved "https://registry.npm.taobao.org/at-least-node/download/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2"
integrity sha1-YCzUtG6EStTv/JKoARo8RuAjjcI=
braces@^3.0.1:
version "3.0.2"
resolved "https://registry.npm.taobao.org/braces/download/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107"
integrity sha1-NFThpGLujVmeI23zNs2epPiv4Qc=
dependencies:
fill-range "^7.0.1"
fast-glob@^3.2.2:
version "3.2.4"
resolved "https://registry.npm.taobao.org/fast-glob/download/fast-glob-3.2.4.tgz#d20aefbf99579383e7f3cc66529158c9b98554d3"
integrity sha1-0grvv5lXk4Pn88xmUpFYybmFVNM=
dependencies:
"@nodelib/fs.stat" "^2.0.2"
"@nodelib/fs.walk" "^1.2.3"
glob-parent "^5.1.0"
merge2 "^1.3.0"
micromatch "^4.0.2"
picomatch "^2.2.1"
fastq@^1.6.0:
version "1.8.0"
resolved "https://registry.npm.taobao.org/fastq/download/fastq-1.8.0.tgz#550e1f9f59bbc65fe185cb6a9b4d95357107f481"
integrity sha1-VQ4fn1m7xl/hhctqm02VNXEH9IE=
dependencies:
reusify "^1.0.4"
fill-range@^7.0.1:
version "7.0.1"
resolved "https://registry.npm.taobao.org/fill-range/download/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40"
integrity sha1-GRmmp8df44ssfHflGYU12prN2kA=
dependencies:
to-regex-range "^5.0.1"
fs-extra@^9.0.0:
version "9.0.1"
resolved "https://registry.npm.taobao.org/fs-extra/download/fs-extra-9.0.1.tgz?cache=0&sync_timestamp=1592843137563&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ffs-extra%2Fdownload%2Ffs-extra-9.0.1.tgz#910da0062437ba4c39fedd863f1675ccfefcb9fc"
integrity sha1-kQ2gBiQ3ukw5/t2GPxZ1zP78ufw=
dependencies:
at-least-node "^1.0.0"
graceful-fs "^4.2.0"
jsonfile "^6.0.1"
universalify "^1.0.0"
glob-parent@^5.1.0:
version "5.1.1"
resolved "https://registry.npm.taobao.org/glob-parent/download/glob-parent-5.1.1.tgz#b6c1ef417c4e5663ea498f1c45afac6916bbc229"
integrity sha1-tsHvQXxOVmPqSY8cRa+saRa7wik=
dependencies:
is-glob "^4.0.1"
graceful-fs@^4.1.6, graceful-fs@^4.2.0:
version "4.2.4"
resolved "https://registry.npm.taobao.org/graceful-fs/download/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb"
integrity sha1-Ila94U02MpWMRl68ltxGfKB6Kfs=
is-extglob@^2.1.1:
version "2.1.1"
resolved "https://registry.npm.taobao.org/is-extglob/download/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2"
integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=
is-glob@^4.0.1:
version "4.0.1"
resolved "https://registry.npm.taobao.org/is-glob/download/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc"
integrity sha1-dWfb6fL14kZ7x3q4PEopSCQHpdw=
dependencies:
is-extglob "^2.1.1"
is-number@^7.0.0:
version "7.0.0"
resolved "https://registry.npm.taobao.org/is-number/download/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b"
integrity sha1-dTU0W4lnNNX4DE0GxQlVUnoU8Ss=
jsonfile@^6.0.1:
version "6.0.1"
resolved "https://registry.npm.taobao.org/jsonfile/download/jsonfile-6.0.1.tgz#98966cba214378c8c84b82e085907b40bf614179"
integrity sha1-mJZsuiFDeMjIS4LghZB7QL9hQXk=
dependencies:
universalify "^1.0.0"
optionalDependencies:
graceful-fs "^4.1.6"
merge2@^1.3.0:
version "1.4.1"
resolved "https://registry.npm.taobao.org/merge2/download/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae"
integrity sha1-Q2iJL4hekHRVpv19xVwMnUBJkK4=
micromatch@^4.0.2:
version "4.0.2"
resolved "https://registry.npm.taobao.org/micromatch/download/micromatch-4.0.2.tgz#4fcb0999bf9fbc2fcbdd212f6d629b9a56c39259"
integrity sha1-T8sJmb+fvC/L3SEvbWKbmlbDklk=
dependencies:
braces "^3.0.1"
picomatch "^2.0.5"
picomatch@^2.0.5, picomatch@^2.2.1:
version "2.2.2"
resolved "https://registry.npm.taobao.org/picomatch/download/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad"
integrity sha1-IfMz6ba46v8CRo9RRupAbTRfTa0=
reusify@^1.0.4:
version "1.0.4"
resolved "https://registry.npm.taobao.org/reusify/download/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76"
integrity sha1-kNo4Kx4SbvwCFG6QhFqI2xKSXXY=
run-parallel@^1.1.9:
version "1.1.9"
resolved "https://registry.npm.taobao.org/run-parallel/download/run-parallel-1.1.9.tgz#c9dd3a7cf9f4b2c4b6244e173a6ed866e61dd679"
integrity sha1-yd06fPn0ssS2JE4XOm7YZuYd1nk=
to-regex-range@^5.0.1:
version "5.0.1"
resolved "https://registry.npm.taobao.org/to-regex-range/download/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4"
integrity sha1-FkjESq58jZiKMmAY7XL1tN0DkuQ=
dependencies:
is-number "^7.0.0"
universalify@^1.0.0:
version "1.0.0"
resolved "https://registry.npm.taobao.org/universalify/download/universalify-1.0.0.tgz#b61a1da173e8435b2fe3c67d29b9adf8594bd16d"
integrity sha1-thodoXPoQ1sv48Z9Kbmt+FlL0W0=

View File

@ -1,3 +1,3 @@
module.exports = {
presets: [['@vant/cli/preset', { loose: true }]],
presets: [['@vant/cli/preset.cjs', { loose: true }]],
};

View File

@ -15,7 +15,8 @@
"scripts": {
"dev": "rollup --config rollup.config.js --watch",
"build": "rollup --config rollup.config.js && tsc -p ./tsconfig.json --emitDeclarationOnly",
"release": "npm run build && release-it"
"release": "pnpm build && release-it",
"prepare": "pnpm build"
},
"license": "MIT",
"repository": "https://github.com/youzan/vant/tree/dev/packages/vant-popperjs",
@ -23,6 +24,7 @@
"@popperjs/core": "^2.9.2"
},
"devDependencies": {
"@vant/cli": "workspace:*",
"@rollup/plugin-babel": "^5.2.1",
"@rollup/plugin-node-resolve": "^10.0.0",
"release-it": "^14.2.2",

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,3 @@
module.exports = {
presets: [['@vant/cli/preset', { loose: true }]],
presets: [['@vant/cli/preset.cjs', { loose: true }]],
};

View File

@ -13,8 +13,9 @@
"clean": "rm -rf ./dist",
"build:lib": "node ./scripts/build.js",
"build:types": "tsc -p ./tsconfig.json --emitDeclarationOnly",
"build": "yarn build:lib && yarn build:types",
"release": "yarn build && release-it"
"build": "pnpm build:lib && pnpm build:types",
"release": "pnpm build && release-it",
"prepare": "pnpm build"
},
"publishConfig": {
"access": "public",
@ -24,8 +25,12 @@
"repository": "https://github.com/youzan/vant/tree/dev/packages/vant-use",
"devDependencies": {
"@babel/core": "^7.12.9",
"@vant/cli": "workspace:*",
"fast-glob": "^3.2.7",
"fs-extra": "^10.0.0",
"release-it": "^14.0.2",
"typescript": "^4.0.2"
"typescript": "4.x",
"vue": "^3.2.20"
},
"release-it": {
"git": {

File diff suppressed because it is too large Load Diff

View File

@ -16,6 +16,23 @@ Vant follows [Semantic Versioning 2.0.0](https://semver.org/lang/zh-CN/).
## Details
### [v3.2.8](https://github.com/compare/v3.2.7...v3.2.8)
`2021-11-09`
**Feature**
- Cascader: add options-bottom slot [#9804](https://github.com/issues/9804)
- SubmitBar: add SubmitBarTextAlign type [f95567](https://github.com/commit/f95567ade758d453f4acad8a40d8ae717035476a)
- PasswordInput: add PasswordInputProps type [#9820](https://github.com/issues/9820)
**Bug Fixes**
- NavBar: fix NavBarProps spelling [#9818](https://github.com/issues/9818)
- Progress: incorrect border-radius [#9826](https://github.com/issues/9826)
- SubmitBar: fix missing SubmitBarProps export [#9819](https://github.com/issues/9819)
- Tabs: should emit click-tab after before-change [#9805](https://github.com/issues/9805)
### [v3.2.7](https://github.com/youzan/vant/compare/v3.2.6...v3.2.7)
`2021-11-04`

View File

@ -16,6 +16,23 @@ Vant 遵循 [Semver](https://semver.org/lang/zh-CN/) 语义化版本规范。
## 更新内容
### [v3.2.8](https://github.com/compare/v3.2.7...v3.2.8)
`2021-11-09`
**Feature**
- Cascader: 新增 options-bottom 插槽 [#9804](https://github.com/issues/9804)
- SubmitBar: 新增 SubmitBarTextAlign 类型 [f95567](https://github.com/commit/f95567ade758d453f4acad8a40d8ae717035476a)
- PasswordInput: 新增 PasswordInputProps 类型 [#9820](https://github.com/issues/9820)
**Bug Fixes**
- NavBar: 修复 NavBarProps 拼写错误的问题 [#9818](https://github.com/issues/9818)
- Progress: 修复圆角大小错误的问题 [#9826](https://github.com/issues/9826)
- SubmitBar: 修复未导出 SubmitBarProps 的问题 [#9819](https://github.com/issues/9819)
- Tabs: 修复 click-tab 触发顺序早于 before-change 的问题 [#9805](https://github.com/issues/9805)
### [v3.2.7](https://github.com/youzan/vant/compare/v3.2.6...v3.2.7)
`2021-11-04`

View File

@ -15,6 +15,8 @@
### 本地开发
在进行本地开发前,请先确保你的开发环境中安装了 [Node.js >= 14](https://nodejs.org) 和 [pnpm](https://pnpm.io).
按照下面的步骤操作,即可在本地开发 Vant 组件。
```bash
@ -24,10 +26,10 @@
git clone git@github.com:youzan/vant.git
# 安装依赖
yarn
pnpm i
# 进入开发模式,浏览器访问 localhost
yarn dev
pnpm dev
```
### 目录结构

View File

@ -1,6 +1,6 @@
{
"name": "vant",
"version": "3.2.7",
"version": "3.2.8",
"description": "Mobile UI Components built on Vue",
"main": "lib/index.js",
"module": "es/index.js",
@ -21,7 +21,7 @@
"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-dist --add --dest v3",
"release:site": "pnpm build:site && gh-pages -d site-dist --add --dest v3",
"test:watch": "vant-cli test --watch",
"test:coverage": "open test/coverage/index.html"
},
@ -55,8 +55,11 @@
"devDependencies": {
"@vant/area-data": "^1.1.3",
"@vant/cli": "^4.0.0-beta.5",
"@vue/compiler-sfc": "^3.2.19",
"vue": "^3.2.20"
"@vue/compiler-sfc": "^3.2.20",
"@vue/runtime-core": "^3.2.20",
"typescript": "4.x",
"vue": "^3.2.20",
"vue-router": "^4.0.12"
},
"sideEffects": [
"es/**/style/*",

View File

@ -259,10 +259,9 @@ export default defineComponent({
unselected: !selected,
})}
>
{slots['options-top']
? slots['options-top']({ tabIndex: activeTab.value })
: null}
{slots['options-top']?.({ tabIndex })}
{renderOptions(options, selected, tabIndex)}
{slots['options-bottom']?.({ tabIndex })}
</Tab>
);
};

View File

@ -282,7 +282,8 @@ export default {
| --- | --- | --- |
| title | Custom title | - |
| option `v3.1.4` | Custom option text | _{ option: Option, selected: boolean }_ |
| options-top `v3.2.7` | Custom the content above options | _{ tabIndex: number }_ |
| options-top `v3.2.7` | Custom the content above the options | _{ tabIndex: number }_ |
| options-bottom `v3.2.8` | Custom the content below the options | _{ tabIndex: number }_ |
### Types

View File

@ -295,6 +295,7 @@ export default {
| title | 自定义顶部标题 | - |
| option `v3.1.4` | 自定义选项文字 | _{ option: Option, selected: boolean }_ |
| options-top `v3.2.7` | 自定义选项上方的内容 | _{ tabIndex: number }_ |
| options-bottom `v3.2.8` | 自定义选项下方的内容 | _{ tabIndex: number }_ |
### 类型定义

View File

@ -1,8 +1,19 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[` should allow more custom content 1`] = `
exports[`should change close icon when using close-icon prop 1`] = `
<i class="van-badge__wrapper van-icon van-icon-success van-cascader__close-icon van-haptics-feedback">
</i>
`;
exports[`should render option slot correctly 1`] = `
<li class="van-cascader__option">
Custom Option foo
</li>
`;
exports[`should render options-top、options-bottom slots correctly 1`] = `
<div class="van-tab__pane">
tab index: 1
Top, tab index: 0
<ul class="van-cascader__options">
<li class="van-cascader__option van-cascader__option--selected">
<span>
@ -17,20 +28,10 @@ exports[` should allow more custom content 1`] = `
</span>
</li>
</ul>
Bottom, tab index: 0
</div>
`;
exports[`should change close icon when using close-icon prop 1`] = `
<i class="van-badge__wrapper van-icon van-icon-success van-cascader__close-icon van-haptics-feedback">
</i>
`;
exports[`should render option slot correctly 1`] = `
<li class="van-cascader__option">
Custom Option foo
</li>
`;
exports[`should render title slot correctly 1`] = `
<h2 class="van-cascader__title">
Custom Title

View File

@ -242,10 +242,11 @@ test('should allow to custom the color of option', async () => {
expect(option.style.color).toEqual('red');
});
test(' should allow more custom content', async () => {
test('should render options-top、options-bottom slots correctly', async () => {
const wrapper = mount(Cascader, {
slots: {
'options-top': ({ tabIndex }) => `tab index: ${tabIndex}`,
'options-top': ({ tabIndex }) => `Top, tab index: ${tabIndex}`,
'options-bottom': ({ tabIndex }) => `Bottom, tab index: ${tabIndex}`,
},
props: {
options,

View File

@ -30,7 +30,7 @@ const navBarProps = {
safeAreaInsetTop: Boolean,
};
export type NavbarProps = ExtractPropTypes<typeof navBarProps>;
export type NavBarProps = ExtractPropTypes<typeof navBarProps>;
export default defineComponent({
name,

View File

@ -120,7 +120,7 @@ export default {
The component exports the following type definitions:
```ts
import type { NavbarProps } from 'vant';
import type { NavBarProps } from 'vant';
```
## Theming

View File

@ -128,7 +128,7 @@ export default {
组件导出以下类型定义:
```ts
import type { NavbarProps } from 'vant';
import type { NavBarProps } from 'vant';
```
## 主题定制

View File

@ -3,4 +3,4 @@ import _NavBar from './NavBar';
export const NavBar = withInstall(_NavBar);
export default NavBar;
export type { NavbarProps } from './NavBar';
export type { NavBarProps } from './NavBar';

View File

@ -91,8 +91,8 @@ app.use(NoticeBar);
| --- | --- | --- | --- |
| mode | Mode, can be set to `closeable` `link` | _string_ | `''` |
| text | Notice text content | _string_ | `''` |
| color | Text color | _string_ | `#f60` |
| background | Background color | _string_ | `#fff7cc` |
| color | Text color | _string_ | `#ed6a0c` |
| background | Background color | _string_ | `#fffbe8` |
| left-icon | Left Icon | _string_ | - |
| delay | Animation delay (s) | _number \| string_ | `1` |
| speed | Scroll speed (px/s) | _number \| string_ | `60` |

View File

@ -112,8 +112,8 @@ app.use(NoticeBar);
| --- | --- | --- | --- |
| mode | 通知栏模式,可选值为 `closeable` `link` | _string_ | `''` |
| text | 通知文本内容 | _string_ | `''` |
| color | 通知文本颜色 | _string_ | `#f60` |
| background | 滚动条背景 | _string_ | `#fff7cc` |
| color | 通知文本颜色 | _string_ | `#ed6a0c` |
| background | 滚动条背景 | _string_ | `#fffbe8` |
| left-icon | 左侧[图标名称](#/zh-CN/icon)或图片链接 | _string_ | - |
| delay | 动画延迟时间 (s) | _number \| string_ | `1` |
| speed | 滚动速率 (px/s) | _number \| string_ | `60` |

View File

@ -1,4 +1,4 @@
import { defineComponent } from 'vue';
import { defineComponent, ExtractPropTypes } from 'vue';
import {
addUnit,
truthProp,
@ -12,18 +12,22 @@ import {
const [name, bem] = createNamespace('password-input');
const passwordInputProps = {
info: String,
mask: truthProp,
value: makeStringProp(''),
gutter: numericProp,
length: makeNumericProp(6),
focused: Boolean,
errorInfo: String,
};
export type PasswordInputProps = ExtractPropTypes<typeof passwordInputProps>;
export default defineComponent({
name,
props: {
info: String,
mask: truthProp,
value: makeStringProp(''),
gutter: numericProp,
length: makeNumericProp(6),
focused: Boolean,
errorInfo: String,
},
props: passwordInputProps,
emits: ['focus'],

View File

@ -2,7 +2,7 @@
### Intro
The passwordinput component is usually used with [NumberKeyboard](#/en-US/number-keyboard) Component.
The PasswordInput component is usually used with [NumberKeyboard](#/en-US/number-keyboard) Component.
### Install
@ -148,6 +148,14 @@ export default {
| ----- | ----------------------------- | --------- |
| focus | Emitted when input is focused | - |
### Types
The component exports the following type definitions:
```ts
import type { PasswordInputProps } from 'vant';
```
## Theming
### CSS Variables

View File

@ -158,6 +158,14 @@ export default {
| ------ | ---------------- | -------- |
| focus | 输入框聚焦时触发 | - |
### 类型定义
组件导出以下类型定义:
```ts
import type { PasswordInputProps } from 'vant';
```
## 主题定制
### 样式变量

View File

@ -3,3 +3,4 @@ import _PasswordInput from './PasswordInput';
export const PasswordInput = withInstall(_PasswordInput);
export default PasswordInput;
export type { PasswordInputProps } from './PasswordInput';

View File

@ -61,8 +61,8 @@ export default defineComponent({
height: addUnit(strokeWidth),
};
const portionStyle = {
width: `${percentage}%`,
background: background.value,
transform: `scaleX(${+percentage / 100})`,
};
return (

View File

@ -4,7 +4,7 @@ exports[`should render demo and match snapshot 1`] = `
<div>
<div class="van-progress">
<span class="van-progress__portion"
style="transform: scaleX(0.5);"
style="width: 50%;"
>
</span>
<span style="left: 50%; transform: translate(-50%,-50%);"
@ -19,7 +19,7 @@ exports[`should render demo and match snapshot 1`] = `
style="height: 8px;"
>
<span class="van-progress__portion"
style="transform: scaleX(0.5);"
style="width: 50%;"
>
</span>
<span style="left: 50%; transform: translate(-50%,-50%);"
@ -32,7 +32,7 @@ exports[`should render demo and match snapshot 1`] = `
<div>
<div class="van-progress">
<span class="van-progress__portion van-progress__portion--inactive"
style="transform: scaleX(0.5);"
style="width: 50%;"
>
</span>
<span style="left: 50%; transform: translate(-50%,-50%);"
@ -45,7 +45,7 @@ exports[`should render demo and match snapshot 1`] = `
<div>
<div class="van-progress">
<span class="van-progress__portion"
style="background: rgb(242, 130, 106); transform: scaleX(0.25);"
style="width: 25%; background: rgb(242, 130, 106);"
>
</span>
<span style="left: 25%; transform: translate(-25%,-50%); background: rgb(242, 130, 106);"
@ -56,7 +56,7 @@ exports[`should render demo and match snapshot 1`] = `
</div>
<div class="van-progress">
<span class="van-progress__portion"
style="background: rgb(238, 10, 36); transform: scaleX(0.5);"
style="width: 50%; background: rgb(238, 10, 36);"
>
</span>
<span style="left: 50%; transform: translate(-50%,-50%); background: rgb(238, 10, 36);"
@ -67,7 +67,7 @@ exports[`should render demo and match snapshot 1`] = `
</div>
<div class="van-progress">
<span class="van-progress__portion"
style="transform: scaleX(0.75);"
style="width: 75%;"
>
</span>
<span style="left: 75%; transform: translate(-75%,-50%); background: rgb(114, 50, 221);"
@ -80,7 +80,7 @@ exports[`should render demo and match snapshot 1`] = `
<div>
<div class="van-progress">
<span class="van-progress__portion"
style="transform: scaleX(0.5);"
style="width: 50%;"
>
</span>
<span style="left: 50%; transform: translate(-50%,-50%);"

View File

@ -3,7 +3,7 @@
exports[`should re-calc width if showing pivot dynamically 1`] = `
<div class="van-progress">
<span class="van-progress__portion"
style="transform: scaleX(1);"
style="width: 100%;"
>
</span>
</div>
@ -12,7 +12,7 @@ exports[`should re-calc width if showing pivot dynamically 1`] = `
exports[`should re-calc width if showing pivot dynamically 2`] = `
<div class="van-progress">
<span class="van-progress__portion"
style="transform: scaleX(1);"
style="width: 100%;"
>
</span>
<span style="left: 100%; transform: translate(-100%,-50%);"

View File

@ -127,7 +127,7 @@ export default {
The component exports the following type definitions:
```ts
import type { SubmitBarProps } from 'vant';
import type { SubmitBarProps, SubmitBarTextAlign } from 'vant';
```
## Theming

View File

@ -134,7 +134,7 @@ export default {
组件导出以下类型定义:
```ts
import type { SubmitBarProps } from 'vant';
import type { SubmitBarProps, SubmitBarTextAlign } from 'vant';
```
## 主题定制

View File

@ -1,9 +1,4 @@
import {
PropType,
CSSProperties,
defineComponent,
ExtractPropTypes,
} from 'vue';
import { PropType, defineComponent, ExtractPropTypes } from 'vue';
import {
truthProp,
makeStringProp,
@ -17,6 +12,8 @@ import { Button, ButtonType } from '../button';
const [name, bem, t] = createNamespace('submit-bar');
export type SubmitBarTextAlign = 'left' | 'right';
const submitBarProps = {
tip: String,
label: String,
@ -25,7 +22,7 @@ const submitBarProps = {
loading: Boolean,
currency: makeStringProp('¥'),
disabled: Boolean,
textAlign: String as PropType<CSSProperties['textAlign']>,
textAlign: String as PropType<SubmitBarTextAlign>,
buttonText: String,
buttonType: makeStringProp<ButtonType>('danger'),
buttonColor: String,

View File

@ -3,3 +3,4 @@ import _SubmitBar from './SubmitBar';
export const SubmitBar = withInstall(_SubmitBar);
export default SubmitBar;
export type { SubmitBarProps, SubmitBarTextAlign } from './SubmitBar';

View File

@ -272,13 +272,6 @@ export default defineComponent({
const { title, disabled } = children[index];
const name = getTabName(children[index], index);
emit('click-tab', {
name,
title,
event,
disabled,
});
if (!disabled) {
callInterceptor(props.beforeChange, {
args: [name],
@ -290,6 +283,13 @@ export default defineComponent({
route(item as ComponentPublicInstance<RouteProps>);
}
emit('click-tab', {
name,
title,
event,
disabled,
});
};
const onStickyScroll = (params: {

View File

@ -4,6 +4,7 @@ export default {
srcDir: 'src',
namedExport: true,
skipInstall: ['lazyload'],
packageManager: 'pnpm',
site: {
publicPath:
(typeof window === 'undefined' && process.env.PUBLIC_PATH) ||

8529
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

2
pnpm-workspace.yaml Normal file
View File

@ -0,0 +1,2 @@
packages:
- 'packages/*'

8466
yarn.lock

File diff suppressed because it is too large Load Diff