Skip to content

Commit

Permalink
feat: init
Browse files Browse the repository at this point in the history
  • Loading branch information
neuqzxy committed May 27, 2024
0 parents commit 3bbe7f6
Show file tree
Hide file tree
Showing 522 changed files with 69,290 additions and 0 deletions.
83 changes: 83 additions & 0 deletions CONTRIBUTING.zh-CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# 贡献指南

首先非常感谢你能抽出时间为我们的开源项目做贡献。希望这份指南能够清晰地阐明贡献过程并回答你可能有的一些问题,所以请你在提 issue 或者 pull request 之前花几分钟时间阅读。

## 行为准则

我们有一份[行为准则](CODE_OF_CONDUCT.md),希望所有的贡献者都能遵守,请花时间阅读一遍全文以确保你能明白哪些是可以做的,哪些是不可以做的。

## 透明的开发

我们所有的工作都会放在 [GitHub](https://github.com/VisActor/) 上。不管是核心团队的成员还是外部贡献者的 pull request 都需要经过同样流程的 review。

## 版本管理

VStory 遵循[语义化版本控制](https://semver.org/lang/zh-CN/)。我们发布 patch 补丁版本以修复重要的错误,发布 minor 次要版本以提供新功能或非必要的更改,发布 major 主要版本以适应任何重大更改。当我们进行重大更改时,在次要版本中还会引入弃用警告,以便用户了解即将到来的更改并提前迁移代码。

每个重要的更改我们都会记录在对应项目 CHANGELOG 更新日志中。

## 发布周期

<!-- TODO -->

- patch 修订版本号:每周末会进行日常 bugfix 更新。(如果有紧急的 bugfix,则任何时候都可发布)
- minor 次版本号:每月发布一个带有新特性的向下兼容的版本。
- major 主版本号:含有破坏性更新和新特性,不在发布周期内。

## 分支管理

<!-- TODO:待讨论 -->

**请将所有的更改提交到 `main` 主分支**。我们不使用单独的分支进行开发或即将发布的版本管理。我们尽力保持主分支良好状态,确保所有测试都能通过。

这里需要注意,所有进入主分支的代码必须与最新的稳定版本兼容,它可能包含其他功能,但不能有任何破坏性更改。我们应该能够随时从主分支的末端发布一个新的次要版本。

## Bugs 管理

我们使用 [GitHub Issues](todo) 来追踪所有的缺陷。无论内外部的缺陷,我们都会在 issues 上进行管理,尽量让一切公开、清晰明了。在你报告一个 bug 之前,请先确保已经搜索
过已有的 issues。

如果你想要你发现的 bug 被快速解决,最好的办法就是根据我们提供的 issue 模板进行提问,只需要进入 [New issue](todo) 页面,然后选择其中任意一个开始即可,最好能使用这个[模板](todo) 来提供复现的示例代码。

## 提交变更建议

如果你有改进我们的配置项、接口或者新增功能的想法,我们同样推荐你通过 issue 进行提问,或者进入我们的 [New issue](todo) 页面,选择相应的 issue 模板进行提交,

如果你准备帮助我们修复一个 bug,那么你可以立即提交一个 pull request 请求,但我们仍然建议你先创建一个 issue 并在 issue 中详细说明将要修复的内容,这样可以帮助我们更好得追踪问题。

## 你的第一个 Pull Request

`
如果你还不清楚怎么在 GitHub 上提 Pull Request ,可以阅读下面这篇文章来学习:[如何优雅地在 GitHub 上贡献代码](https://segmentfault.com/a/1190000000736629)

为了能帮助你开始你的第一次尝试,我们用[good first issues](todo)标记了一些比较容易修复的 bug 和小功能。这些 issue 可以很好地作为你的首次尝试。

如果你打算开始处理一个 issue,请先检查一下 issue 下面的留言以确保没有别人正在处理这个 issue。如果当前没有人在处理的话你可以留言告知其他人你将会处理这个 issue,以免别人重复劳动。

如果之前有人留言说会处理这个 issue 但是一两个星期都没有动静,那么你也可以接手处理这个 issue,当然还是需要留言告知其他人。

### 如何发送 Pull Request

VisActor 团队会关注所有的 pull request,我们会 review 以及合并你的代码,也有可能要求你做一些修改或者告诉你我们为什么不能接受这样的修改。我们将尽最大努力在整个过程中提供及时的更新和反馈。

**你发送 Pull Request 之前**,请确认你是按照下面的步骤来做的:

<!-- TODO: 待完善 -->

1. 基于 `main` 分支做修改
2. (如果你已经安装,请跳过此步骤)全局安装 [@microsoft/rush](https://rushjs.io/pages/intro/get_started/)`npm i --global @microsoft/rush`
3. 根目录下运行 `rush update --full`
4. 如果你修复了一个 bug 或者新增了一个功能,请确保写了相应的测试,这很重要。
5. 确认所有的测试都是通过的 `rush test`。 小贴士:开发过程中可以用 `rush test -- --watch TestName` 来运行指定的测试。
6. 确保你的代码通过了 lint 检查 `rush lint`. 小贴士: Lint 会在你 git commit 的时候自动运行(通过 Git Hooks)。
7. 运行 `rush compile` 进行 ts 类型检测。

## 开发流程

在你 clone 了 VStory 的代码并且使用 `rush update --full` 安装完依赖后,你还可以运行下面几个常用的命令:

1. `rush run -p @internal/dev-demos -s start` 在本地运行 VStory 代码的测试页面
2. `rush eslint` 运行所有项目的 eslint 脚本
3. `rush test` 运行所有项目的 test 脚本
4. `rush run -p <project_name> -s <script>` 运行指定项目的指定脚本,eg. `rush run -p @visActor/VStory -s start`
5. `rush prettier --dir <project_relative_path> --ext <file_type>` 格式化指定项目的源代码,eg. `rush prettier --dir packages/VStory --ext ts`
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
14 changes: 14 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Don't allow people to merge changes to these generated files, because the result
# may be invalid. You need to run "rush update" again.
pnpm-lock.yaml merge=text
shrinkwrap.yaml merge=binary
npm-shrinkwrap.json merge=binary
yarn.lock merge=binary

# Rush's JSON config files use JavaScript-style code comments. The rule below prevents pedantic
# syntax highlighters such as GitHub's from highlighting these comments as errors. Your text editor
# may also require a special configuration to allow comments in JSON.
#
# For more information, see this issue: https://github.com/microsoft/rushstack/issues/1088
#
*.json linguist-language=JSON-with-Comments
102 changes: 102 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Bug Report
description: Report a bug to @VisActor/vstory
title: '[Bug] '
labels: [bug]
body:
- type: markdown
attributes:
value: |
The issue list is reserved exclusively for bug reports and feature requests.
For usage questions, please use the following resources:
- Read the [docs](https://www.visactor.io/)
- Find in [examples](https://www.visactor.io/)
- Look for / ask questions on [Stack Overflow](https://stackoverflow.com/questions/tagged/visactor)
For non-technical support or general questions, you can email [[email protected]](mailto:[email protected]).
Also try to search for your issue - it may have already been answered or even fixed in the development branch. However, if you find that an old, closed issue still persists in the latest version, you should open a new issue using the form below instead of commenting on the old issue.
# - type: checkboxes
# attributes:
# label: Is there an existing issue for this?
# description: Please search to see if an issue already exists for the bug you encountered.
# options:
# - label: I have searched the existing issues
# required: true

- type: input
attributes:
label: Version
description: |
Check if the issue is reproducible with the latest stable version of @VisActor/vstory.
placeholder: |
e.g. 1.0.0
validations:
required: true

- type: input
attributes:
label: Link to Minimal Reproduction
description: |
If the reproduction does not need a build setup, please provide a link to [Official Editor](TODO), [JSFiddle](https://jsfiddle.net/neuqzxy/s5y0kgtz/13/), [JSBin](https://jsbin.com/) or [CodePen](https://codepen.io/neuqzxy/pen/ExOWWLg).. If it requires a build setup, you can use [CodeSandbox](https://codesandbox.io/s/visactor-vstory-issue-template-c7fgqr?file=/src/index.ts) or provide a GitHub repo.
The reproduction should be **minimal** - i.e. it should contain only the bare minimum amount of code needed to show the bug.
Please do not just fill in a random link. The issue will be closed if no valid reproduction is provided. [Why?](https://antfu.me/posts/why-reproductions-are-required)
validations:
required: true

- type: textarea
attributes:
label: Steps to Reproduce
description: |
What do we need to do after opening your repo in order to make the bug happen? Clear and concise reproduction instructions are important for us to be able to triage your issue in a timely manner. Note that you can use [Markdown](https://guides.github.com/features/mastering-markdown/) to format lists and code.
placeholder: |
1. How do you create the view
2. What's the spec of view
3. User interactions before the error happens.
validations:
required: true

- type: textarea
attributes:
label: Current Behavior
description: A concise description of what you're experiencing.
validations:
required: true

- type: textarea
attributes:
label: Expected Behavior
description: A concise description of what you expected to happen.
validations:
required: true

- type: textarea
attributes:
label: Environment
description: |
e.g.
- **OS**: macOS Monterey
- **Browser**: Chrome 96.0.4664.55
- **Framework** Vue@3
value: |
- OS:
- Browser:
- Framework:
render: markdown

validations:
required: false

- type: textarea
attributes:
label: Any additional comments?
description: |
e.g. some background/context of how you ran into this bug.
validations:
required: false
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
# contact_links:
# - name: @VisaActor/vrender
# url: https://www.visactor.io/
# about: Please search question here before opening a new issue
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/feaure_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Feature Request
description: Request a new feature from @VisActor/vstory
title: '[Feature] '
labels: [new-feature]
body:
- type: markdown
attributes:
value: |
The issue list is reserved exclusively for bug reports and feature requests.
For usage questions, please use the following resources:
- Read the [docs](https://www.visactor.io/)
- Find in [examples](https://www.visactor.io//)
- Look for / ask questions on [Stack Overflow](https://stackoverflow.com/questions/tagged/visactors)
For non-technical support or general questions, you can email [[email protected]](mailto:[email protected]).
Also try to search for your issue - it may have already been answered or even fixed in the development branch. However, if you find that an old, closed issue still persists in the latest version, you should open a new issue using the form below instead of commenting on the old issue.
- type: textarea
attributes:
label: What problem does this feature solve?
description: |
Explain your use case, context, and rationale behind this feature request. More importantly, what is the end user experience you are trying to build that led to the need for this feature?
An important design goal of @VisActor/vstory is keeping the API surface small and straightforward. In general, we only consider adding new features that solve a problem that cannot be easily dealt with using existing APIs (i.e. not just an alternative way of doing things that can already be done). The problem should also be common enough to justify the addition.
validations:
required: true

- type: textarea
attributes:
label: What does the proposed API look like?
description: Describe how you propose to solve the problem and provide code samples of how the API would work once implemented. Note that you can use [Markdown](https://docs.github.com/en/github/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax) to format your code blocks.

validations:
required: true
82 changes: 82 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<!--
First of all, thank you for your contribution! 😄
For requesting to pull a new feature or bugfix, please send it from a feature/bugfix branch based on the `main` branch.
Before submitting your pull request, please make sure the checklist below is confirmed.
Your pull requests will be merged after one of the collaborators approve.
Thank you!
-->

[[中文版模板 / Chinese template](https://github.com/VisActor/vstory/blob/main/.github/PULL_REQUEST_TEMPLATE/pr_cn.md?plain=1)]

### 🤔 This is a ...

- [ ] New feature
- [ ] Bug fix
- [ ] TypeScript definition update
- [ ] Bundle size optimization
- [ ] Performance optimization
- [ ] Enhancement feature
- [ ] Refactoring
- [ ] Update dependency
- [ ] Code style optimization
- [ ] Test Case
- [ ] Branch merge
- [ ] Site / documentation update
- [ ] Demo update
- [ ] Workflow
- [ ] Release
- [ ] Other (about what?)

### 🔗 Related issue link

<!--
1. Put the related issue or discussion links here.
2. close #xxxx or fix #xxxx for instance.
-->

### 🐞 Bugserver case id

<!-- paste the `fileid` field in the bugserver case url -->

### 💡 Background and solution

<!--
1. Describe the problem and the scenario.
2. GIF or snapshot should be provided if includes UI/interactive modification.
3. How to fix the problem, and list the final API implementation and usage sample if that is a new feature.
-->

### 📝 Changelog

<!--
Describe changes from the user side, and list all potential break changes or other risks.
--->

| Language | Changelog |
| ---------- | --------- |
| 🇺🇸 English | |
| 🇨🇳 Chinese | |

### ☑️ Self-Check before Merge

⚠️ Please check all items below before requesting a reviewing. ⚠️

- [ ] Doc is updated/provided or not needed
- [ ] Demo is updated/provided or not needed
- [ ] TypeScript definition is updated/provided or not needed
- [ ] Changelog is provided or not needed

---

<!--
Below are template for copilot to generate CR message.
Please DO NOT modify it.
-->

### 🚀 Summary

copilot:summary

### 🔍 Walkthrough

copilot:walkthrough
Loading

0 comments on commit 3bbe7f6

Please sign in to comment.