Skip to content

Commit

Permalink
Merge branch 'youzan:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
suncohey authored Nov 27, 2023
2 parents 4aebbdc + 17a65c1 commit af3febc
Show file tree
Hide file tree
Showing 795 changed files with 45,968 additions and 36,203 deletions.
41 changes: 3 additions & 38 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,4 @@
# Contributing to Vant
# Vant Contributing Guide

The following is a set of guidelines for contributing to Vant. Please spend several minutes in reading these guidelines before you create an issue or pull request.

Anyway, these are just guidelines, not rules, use your best judgment and feel free to propose changes to this document in a pull request.

## Opening an Issue

If you think you have found a bug, or have a new feature idea, please start by making sure it hasn't already been reported or fixed. You can search through existing issues and PRs to see if someone has reported one similar to yours.

Next, create a new issue that briefly explains the problem, and provides a bit of background as to the circumstances that triggered it, and steps to reproduce it.

## Submitting a Pull Request

It's welcomed to pull request, And there are some tips about that:

- Before working on a large change, it is best to open an issue first to discuss it with the maintainers.

- 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 behavior.

- Rebase before creating a PR to keep commit history clear.

- Add some descriptions and refer relative issues for you PR.

## Getting started

You will need [Node.js >= 14](https://nodejs.org) and [pnpm](https://pnpm.io).

```bash
git clone [email protected]:vant-ui/vant.git

# Install dependencies
pnpm i

# Start development
pnpm dev
```
- [English Version](../packages/vant/docs/markdown/contribution.en-US.md)
- [中文版](../packages/vant/docs/markdown/contribution.zh-CN.md)
31 changes: 2 additions & 29 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,3 @@
### Before submitting a pull request, please make sure the following is done:
Before submitting a pull request, please read the [contributing guide](https://vant-contrib.gitee.io/vant/#/en-US/contribution).

1. Read the [contributing guide](https://github.com/vant-ui/vant/blob/main/.github/CONTRIBUTING.md).
2. If you've added code that should be tested, add tests.
3. If you've changed APIs, update the documentation.
4. Ensure the test suite passes (`npm test`).

#### Title Format

type(ComponentName?):commit message

Example:

- docs: fix typo in quickstart
- build: optimize build speed
- fix(Button): incorrect style
- feat(Button): add color prop

Allowed Types:

- fix
- feat
- docs
- perf
- test
- types
- build
- chore
- refactor
- breaking change
在提交 pull request 之前,请阅读 [贡献指南](https://vant-contrib.gitee.io/vant/#/zh-CN/contribution)
10 changes: 10 additions & 0 deletions .github/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"change: feat":
- "/^(feat|types|style)/"
"change: fix":
- "/^fix/"
"change: perf":
- "/^perf/"
"change: breaking":
- "/^breaking change/"
"change: docs":
- "/^docs/"
26 changes: 26 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# .github/release.yml

changelog:
exclude:
authors:
# Ignore the release PR created by github-actions
- github-actions
categories:
- title: Breaking Changes 🍭
labels:
- "change: breaking"
- title: New Features 🎉
labels:
- "change: feat"
- title: Performance 🚀
labels:
- "change: perf"
- title: Bug Fixes 🐞
labels:
- "change: fix"
- title: Document 📖
labels:
- "change: docs"
- title: Other Changes
labels:
- "*"
5 changes: 1 addition & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ name: "CodeQL"
on:
push:
branches: [ main ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
schedule:
- cron: '36 21 * * 2'

Expand All @@ -39,7 +36,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/deploy-v4-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ref: 'main'

- name: Install pnpm
run: corepack enable

- uses: actions/setup-node@v2
- uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'pnpm'
Expand All @@ -32,10 +32,12 @@ jobs:
run: npm run build:site

- name: Deploy for Gitee 🚀
uses: JamesIves/[email protected].0
uses: JamesIves/[email protected].1
with:
branch: gh-pages
folder: packages/vant/site-dist
# enable single-commit to reduce the repo size
single-commit: true
clean: true
clean-exclude: |
1.x/*
Expand All @@ -61,6 +63,8 @@ jobs:
token: ${{ secrets.VANT_UI_TOKEN }}
repository-name: vant-ui/vant-ui.github.io
target-folder: vant
# enable single-commit to reduce the repo size
single-commit: true
clean: true
clean-exclude: |
1.x/*
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/issue-close-require.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ jobs:
labels: 'need reproduce'
inactive-day: 3
body: |
Since the issue was labeled with `need reproduce`, but no response in 3 days. This issue will be closed. If you have any questions, you can comment and reply.
As the issue was labeled with `need reproduce`, but no response in 3 days. This issue will be closed. Feel free to comment and reopen it if you have any further questions. For background, please refer to [Why reproductions are required](https://antfu.me/posts/why-reproductions-are-required).
由于该 issue 被标记为需要复现,却 3 天未收到回应。现关闭 issue,若有任何问题,可评论回复
由于该 issue 被标记为 "需要重现",但在 3 天内没有回应,因此该 issue 将被关闭。如果你有任何进一步的问题,请随时发表评论并重新打开该 issue。背景请参考 [为什么需要最小重现](https://antfu.me/posts/why-reproductions-are-required-zh)
12 changes: 6 additions & 6 deletions .github/workflows/issue-labeled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ jobs:
actions: 'create-comment'
issue-number: ${{ github.event.issue.number }}
body: |
Hello @${{ github.event.issue.user.login }}. We totally like your proposal/feedback, welcome to [send us a Pull Request](https://help.github.com/en/articles/creating-a-pull-request) for it. Please send your Pull Request to `main` branch, fill the [Pull Request Template](https://github.com/vant-ui/vant/blob/main/.github/PULL_REQUEST_TEMPLATE.md) here, provide changelog/TypeScript/documentation/test cases if needed and make sure CI passed, we will review it soon. We appreciate your effort in advance and looking forward to your contribution!
Hello @${{ github.event.issue.user.login }}. We totally like your proposal/feedback, welcome to [send us a Pull Request](https://help.github.com/en/articles/creating-a-pull-request) for it. Please send your Pull Request to `main` branch, provide changelog/TypeScript/documentation/test cases if needed and make sure CI passed, we will review it soon. We appreciate your effort in advance and looking forward to your contribution!
你好 @${{ github.event.issue.user.login }},我们完全同意你的提议/反馈,欢迎直接在此仓库 [创建一个 Pull Request](https://help.github.com/en/articles/creating-a-pull-request) 来解决这个问题。请将 Pull Request 发到 `main` 分支,务必填写 Pull Request 内的[预设模板](https://github.com/vant-ui/vant/blob/main/.github/PULL_REQUEST_TEMPLATE.md),提供改动所需相应的 changelog、TypeScript 定义、测试用例、文档等,并确保 CI 通过,我们会尽快进行 Review,提前感谢和期待您的贡献
你好 @${{ github.event.issue.user.login }},我们完全同意你的提议/反馈,欢迎直接在此仓库 [创建一个 Pull Request](https://help.github.com/en/articles/creating-a-pull-request) 来解决这个问题。请将 Pull Request 发到 `main` 分支,提供改动所需相应的 changelog、TypeScript 定义、测试用例、文档等,并确保 CI 通过,我们会尽快进行 Review,提前感谢和期待你的贡献
- name: need reproduce
if: github.event.label.name == 'need reproduce'
Expand All @@ -31,9 +31,9 @@ jobs:
actions: 'create-comment'
issue-number: ${{ github.event.issue.number }}
body: |
Hello @${{ github.event.issue.user.login }}. Please provide an online reproduction demo by clicking this [link](https://codesandbox.io/s/vant-3-issue-template-8fuq5o) or a minimal GitHub repository. Issues marked with `need reproduce` will be closed if they have no activity within 3 days.
Hello @${{ github.event.issue.user.login }}. Please provide an online reproduction demo by [codesandbox](https://codesandbox.io/s/vant-3-issue-template-8fuq5o) or a minimal GitHub repository. Issues marked with `need reproduce` will be closed if there is no activity within 3 days. For background, please refer to [Why reproductions are required](https://antfu.me/posts/why-reproductions-are-required).
你好 @${{ github.event.issue.user.login }}, 我们需要你提供一个在线的重现实例以便于我们帮你排查问题。可以通过点击 [此处](https://codesandbox.io/s/vant-3-issue-template-8fuq5o) 创建或者提供一个最小化的 GitHub 仓库。3 天内未跟进此 issue 将会被自动关闭。
你好 @${{ github.event.issue.user.login }}, 我们需要你提供一个在线的重现示例,以便于我们帮你排查问题。你可以通过点击 [codesandbox](https://codesandbox.io/s/vant-3-issue-template-8fuq5o) 创建,或者提供一个最小化的 GitHub 仓库。如果 3 天内未跟进,此 issue 将会被自动关闭。背景请参考 [为什么需要最小重现](https://antfu.me/posts/why-reproductions-are-required-zh)
- name: question
if: github.event.label.name == 'question'
Expand All @@ -42,9 +42,9 @@ jobs:
actions: 'create-comment, close-issue'
issue-number: ${{ github.event.issue.number }}
body: |
Hello @${{ github.event.issue.user.login }}, we use GitHub issues to trace bugs or discuss plans of Vant. So, please don't ask usage questions here. You can try to open a new discussion in [vant discussions](https://github.com/vant-ui/vant/discussions), select `Q&A` to ask questions.
Hello @${{ github.event.issue.user.login }}, we use GitHub issues to trace bugs or discuss plans of Vant. So, please don't ask usage questions here. You can open a new discussion in [Vant Discussions](https://github.com/vant-ui/vant/discussions), select `Q&A` to ask questions.
你好 @${{ github.event.issue.user.login }},Vant Issue 板块是用于 bug 反馈与需求讨论的地方。请勿在这里询问如何使用等相关问题,你可以试着在 [vant discussions](https://github.com/vant-ui/vant/discussions) 新开一个 discussion,选择 `Q&A` 类别进行提问。
你好 @${{ github.event.issue.user.login }},Vant Issue 板块是用于 bug 反馈与需求讨论的地方。请勿在这里询问如何使用等相关问题,你可以在 [Vant Discussions](https://github.com/vant-ui/vant/discussions) 新开一个 discussion,选择 `Q&A` 类别进行提问。
- name: 2.x
if: github.event.label.name == '2.x'
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/pr-label.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: PR Labeler

on:
pull_request_target:
types:
- opened
- edited

jobs:
change-labeling:
name: Labeling for changes
runs-on: ubuntu-latest
steps:
- uses: github/[email protected]
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/pr-labeler.yml
enable-versioned-regex: 0
include-title: 1
sync-labels: 1
13 changes: 5 additions & 8 deletions .github/workflows/release-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@master
uses: actions/checkout@v4

- name: Create Release for Tag
id: release_tag
uses: yyx990803/release-tag@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: ncipollo/release-action@v1
with:
tag_name: ${{ github.ref }}
generateReleaseNotes: "true"
body: |
更新内容参见 [CHANGELOG](https://vant-ui.github.io/vant/#/zh-CN/changelog)。
Please refer to [CHANGELOG](https://vant-ui.github.io/vant/#/en-US/changelog) for details.
> Please refer to [Changelog](https://vant-ui.github.io/vant/#/en-US/changelog) for all changes. | 请访问 [更新日志](https://vant-ui.github.io/vant/#/zh-CN/changelog) 了解所有更新。
7 changes: 6 additions & 1 deletion .github/workflows/sync-gitee.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,19 @@ on:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

# Sync to gitee everyday
schedule:
- cron: '0 1 * * *'

workflow_dispatch:

jobs:
build:
if: github.repository == 'youzan/vant'
runs-on: ubuntu-latest
steps:
- name: Sync to Gitee
uses: wearerequired/git-mirror-action@master
uses: wearerequired/git-mirror-action@v1.2.0
env:
# 在 Settings->Secrets 配置 GITEE_RSA_PRIVATE_KEY
SSH_PRIVATE_KEY: ${{ secrets.GITEE_RSA_PRIVATE_KEY }}
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Install pnpm
run: corepack enable

- uses: actions/setup-node@v2
- uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'pnpm'
Expand All @@ -34,12 +34,12 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Install pnpm
run: corepack enable

- uses: actions/setup-node@v2
- uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'pnpm'
Expand All @@ -48,22 +48,23 @@ jobs:
run: pnpm install

- name: Run test cases
run: npm test
run: pnpm run test:coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./packages/vant/test/coverage

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Install pnpm
run: corepack enable

- uses: actions/setup-node@v2
- uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'pnpm'
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ lib
dist
**/site-dist
changelog.generated.md

# temp file
packages/vant/README.md
3 changes: 1 addition & 2 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
registry=https://registry.npmmirror.com/
registry=https://registry.npmjs.org/

strict-peer-dependencies=false
auto-install-peers=false
resolution-mode=highest
4 changes: 0 additions & 4 deletions .prettierrc

This file was deleted.

Loading

0 comments on commit af3febc

Please sign in to comment.