docs: add guides (#414)
This commit is contained in:
Родитель
b54b7ab913
Коммит
0ca5698620
|
@ -0,0 +1,13 @@
|
|||
# Contributing to Ant Design
|
||||
|
||||
Want to contribute to Ant Design? There are a few things you need to know.
|
||||
|
||||
We wrote a **[contribution guide](https://ant.design/en-US/docs/contributing)** to help you get started.
|
||||
|
||||
---
|
||||
|
||||
# 参与共建
|
||||
|
||||
想要给 Ant Design Blazor 贡献自己的一份力量?
|
||||
|
||||
我们写了一份 **[贡献指南](https://ant.design/zh-CN/docs/contributing)** 来帮助你开始。
|
|
@ -0,0 +1,28 @@
|
|||
---
|
||||
name: 🐞 Bug report
|
||||
about: Create a report about something that is not working
|
||||
---
|
||||
|
||||
|
||||
### Describe the bug
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
### To Reproduce
|
||||
<!--
|
||||
We ❤ code! Point us to a minimalistic repro project hosted in a GitHub repo.
|
||||
For a repro project, create a new ASP.NET Core project using the template of your your choice, apply the minimum required code to result in the issue you're observing.
|
||||
|
||||
We will close this issue if:
|
||||
- the repro project you share with us is complex. We can't investigate custom projects, so don't point us to such, please.
|
||||
- if we will not be able to repro the behavior you're reporting
|
||||
-->
|
||||
|
||||
### Exceptions (if any)
|
||||
<!--
|
||||
Include the exception you get when facing this issue
|
||||
-->
|
||||
|
||||
### Further technical details
|
||||
- AntDesign Nuget Package version
|
||||
- Include the output of `dotnet --info`
|
||||
- The IDE (VS / VS Code/ VS4Mac) you're running on, and it's version
|
|
@ -0,0 +1,14 @@
|
|||
---
|
||||
name: 💡 Feature request
|
||||
about: Suggest an idea for this project
|
||||
---
|
||||
|
||||
### Is your feature request related to a problem? Please describe.
|
||||
A clear and concise description of what the problem is.
|
||||
Example: I am trying to do [...] but [...]
|
||||
|
||||
### Describe the solution you'd like
|
||||
A clear and concise description of what you want to happen. Include any alternative solutions you've considered.
|
||||
|
||||
### Additional context
|
||||
Add any other context or screenshots about the feature request here.
|
|
@ -0,0 +1,58 @@
|
|||
<!--
|
||||
First of all, thank you for your contribution! 😄
|
||||
|
||||
New feature please send pull request to feature branch, and rest to master branch.
|
||||
Pull request will be merged after one of collaborators approve.
|
||||
Please makes sure that these form are filled before submitting your pull request, thank you!
|
||||
-->
|
||||
|
||||
[[中文版模板 / Chinese template](https://github.com/ant-design-blazor/ant-design-blazor/blob/master/.github/PULL_REQUEST_TEMPLATE/pr_cn.md)]
|
||||
|
||||
### 🤔 This is a ...
|
||||
|
||||
- [ ] New feature
|
||||
- [ ] Bug fix
|
||||
- [ ] Site / documentation update
|
||||
- [ ] Demo update
|
||||
- [ ] Component style update
|
||||
- [ ] TypeScript definition update
|
||||
- [ ] Bundle size optimization
|
||||
- [ ] Performance optimization
|
||||
- [ ] Refactoring
|
||||
- [ ] Code style optimization
|
||||
- [ ] Test Case
|
||||
- [ ] Branch merge
|
||||
- [ ] Other (about what?)
|
||||
|
||||
### 🔗 Related issue link
|
||||
|
||||
<!--
|
||||
1. Describe the source of requirement, like related issue link.
|
||||
-->
|
||||
|
||||
### 💡 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 final API implementation and usage sample if that is an new feature.
|
||||
-->
|
||||
|
||||
### 📝 Changelog
|
||||
|
||||
<!--
|
||||
Describe changes from userside, and list all potential break changes or other risks.
|
||||
--->
|
||||
|
||||
| Language | Changelog |
|
||||
| ---------- | --------- |
|
||||
| 🇺🇸 English | |
|
||||
| 🇨🇳 Chinese | |
|
||||
|
||||
### ☑️ Self Check before Merge
|
||||
|
||||
⚠️ Please check all items below before review. ⚠️
|
||||
|
||||
- [ ] Doc is updated/provided or not needed
|
||||
- [ ] Demo is updated/provided or not needed
|
||||
- [ ] Changelog is provided or not needed
|
|
@ -0,0 +1,58 @@
|
|||
<!--
|
||||
首先,感谢你的贡献!😄
|
||||
|
||||
新特性请提交至 feature 分支,其余可提交至 master 分支。
|
||||
在一个维护者审核通过后合并。
|
||||
请确保填写以下 pull request 的信息,谢谢!~
|
||||
|
||||
[[English Template / 英文模板](?expand=1)]
|
||||
-->
|
||||
|
||||
### 🤔 这个变动的性质是?
|
||||
|
||||
- [ ] 新特性提交
|
||||
- [ ] 日常 bug 修复
|
||||
- [ ] 站点、文档改进
|
||||
- [ ] 演示代码改进
|
||||
- [ ] 组件样式改进
|
||||
- [ ] TypeScript 定义更新
|
||||
- [ ] 包体积优化
|
||||
- [ ] 性能优化
|
||||
- [ ] 重构
|
||||
- [ ] 代码风格优化
|
||||
- [ ] 测试用例
|
||||
- [ ] 分支合并
|
||||
- [ ] 其他改动(是关于什么的改动?)
|
||||
|
||||
### 🔗 相关 Issue
|
||||
|
||||
<!--
|
||||
1. 描述相关需求的来源,如相关的 issue 讨论链接。
|
||||
-->
|
||||
|
||||
### 💡 需求背景和解决方案
|
||||
|
||||
<!--
|
||||
1. 要解决的具体问题。
|
||||
2. 列出最终的 API 实现和用法。
|
||||
3. 涉及UI/交互变动需要有截图或 GIF。
|
||||
-->
|
||||
|
||||
### 📝 更新日志怎么写?
|
||||
|
||||
<!--
|
||||
> 从用户角度描述具体变化,以及可能的 breaking change 和其他风险?
|
||||
-->
|
||||
|
||||
| 语言 | 更新描述 |
|
||||
| ------- | -------- |
|
||||
| 🇺🇸 英文 | |
|
||||
| 🇨🇳 中文 | |
|
||||
|
||||
### ☑️ 请求合并前的自查清单
|
||||
|
||||
⚠️ 请自检并全部**勾选全部选项**。⚠️
|
||||
|
||||
- [ ] 文档已补充或无须补充
|
||||
- [ ] 代码演示已提供或无须提供
|
||||
- [ ] Changelog 已提供或无须提供
|
|
@ -0,0 +1,76 @@
|
|||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and maintainers pledge to making participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, sex characteristics, gender identity and expression,
|
||||
level of experience, education, socio-economic status, nationality, personal
|
||||
appearance, race, religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community. Examples of
|
||||
representing a project or community include using an official project e-mail
|
||||
address, posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event. Representation of a project may be
|
||||
further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting the project team at shunjiey@hotmail.com. All
|
||||
complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate to the circumstances. The project team is
|
||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||
faith may face temporary or permanent repercussions as determined by other
|
||||
members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
|
||||
For answers to common questions about this code of conduct, see
|
||||
https://www.contributor-covenant.org/faq
|
|
@ -0,0 +1,239 @@
|
|||
# Contributing to ant-design-blazor
|
||||
|
||||
We would love for you to contribute to ant-design-blazor and help make it even better than it is
|
||||
today! As a contributor, here are the guidelines we would like you to follow:
|
||||
|
||||
- [Code of Conduct](#coc)
|
||||
- [Question or Problem?](#question)
|
||||
- [Issues and Bugs](#issue)
|
||||
- [Feature Requests](#feature)
|
||||
- [Submission Guidelines](#submit)
|
||||
- [Coding Rules](#rules)
|
||||
- [Commit Message Guidelines](#commit)
|
||||
|
||||
## <a name="coc"></a> Code of Conduct
|
||||
Help us keep ant-design-blazor open and inclusive. Please read and follow our [Code of Conduct][coc].
|
||||
|
||||
## <a name="question"></a> Got a Question or Problem?
|
||||
|
||||
Do not open issues for general support questions as we want to keep GitHub issues for bug reports and feature requests. You've got much better chances of getting your question answered on [Segmentfault](https://segmentfault.com/t/ant-design-blazor) or [Stack Overflow](https://stackoverflow.com/tags/ant-design-blazor) where the questions should be tagged with tag `ant-design-blazor`.
|
||||
|
||||
Segmentfault / Stack Overflow is a much better place to ask questions since:
|
||||
|
||||
- there are thousands of people willing to help on Segmentfault
|
||||
- questions and answers stay available for public viewing so your question / answer might help someone else
|
||||
- Segmentfault's voting system assures that the best answers are prominently visible.
|
||||
|
||||
To save your and our time, we will systematically close all issues that are requests for general support and redirect people to Segmentfault / Stack Overflow.
|
||||
|
||||
If you would like to chat about the question in real-time, you can reach out via [our slack channel][slack].
|
||||
|
||||
## <a name="issue"></a> Found a Bug?
|
||||
If you find a bug in the source code, you can help us by
|
||||
[submitting an issue](#submit-issue) to our [GitHub Repository][github]. Even better, you can
|
||||
[submit a Pull Request](#submit-pr) with a fix.
|
||||
|
||||
## <a name="feature"></a> Missing a Feature?
|
||||
You can *request* a new feature by [submitting an issue](#submit-issue) to our GitHub
|
||||
Repository. If you would like to *implement* a new feature, please submit an issue with
|
||||
a for your work first, to be sure that we can use it.
|
||||
Please consider what kind of change it is:
|
||||
|
||||
* For a **Major Feature**, first open an issue and outline your proposal so that it can be
|
||||
discussed. This will also allow us to better coordinate our efforts, prevent duplication of work,
|
||||
and help you to craft the change so that it is successfully accepted into the project.
|
||||
* **Small Features** can be crafted and directly [submitted as a Pull Request](#submit-pr).
|
||||
|
||||
## <a name="submit"></a> Submission Guidelines
|
||||
|
||||
### <a name="submit-issue"></a> Submitting an Issue
|
||||
|
||||
Before you submit an issue, please search the issue tracker, maybe an issue for your problem already exists and the discussion might inform you of workarounds readily available.
|
||||
|
||||
We want to fix all the issues as soon as possible, but before fixing a bug we need to reproduce and confirm it. In order to reproduce bugs we will systematically ask you to provide a minimal reproduction scenario using http://plnkr.co. Having a live, reproducible scenario gives us wealth of important information without going back & forth to you with additional questions like:
|
||||
|
||||
- version of ant-design-blazor used
|
||||
- 3rd-party libraries and their versions
|
||||
- and most importantly - a use-case that fails
|
||||
|
||||
A minimal reproduce scenario using http://plnkr.co/ allows us to quickly confirm a bug (or point out coding problem) as well as confirm that we are fixing the right problem. If plunker is not a suitable way to demonstrate the problem (for example for issues related to our npm packaging), please create a standalone git repository demonstrating the problem.
|
||||
|
||||
We will be insisting on a minimal reproduce scenario in order to save maintainers time and ultimately be able to fix more bugs. Interestingly, from our experience users often find coding problems themselves while preparing a minimal plunk. We understand that sometimes it might be hard to extract essentials bits of code from a larger code-base but we really need to isolate the problem before we can fix it.
|
||||
|
||||
Unfortunately we are not able to investigate / fix bugs without a minimal reproduction, so if we don't hear back from you we are going to close an issue that don't have enough info to be reproduced.
|
||||
|
||||
You can file new issues by filling out our [new issue form](https://github.com/ant-design-blazor/ant-design-blazor/issues/new).
|
||||
|
||||
|
||||
### <a name="submit-pr"></a> Submitting a Pull Request (PR)
|
||||
Before you submit your Pull Request (PR) consider the following guidelines:
|
||||
|
||||
* Search [GitHub](https://github.com/ant-design-blazor/ant-design-blazor/pulls) for an open or closed PR
|
||||
that relates to your submission. You don't want to duplicate effort.
|
||||
* Make your changes in a new git branch:
|
||||
|
||||
```shell
|
||||
git checkout -b my-fix-branch master
|
||||
```
|
||||
|
||||
* Create your patch, **including appropriate test cases**.
|
||||
* Follow our [Coding Rules](#rules).
|
||||
* Run the full ant-design-blazor test suite <!-- , as described in the [developer documentation][dev-doc] -->, and ensure that all tests pass.
|
||||
* Commit your changes using a descriptive commit message that follows our
|
||||
[commit message conventions](#commit). Adherence to these conventions
|
||||
is necessary because release notes are automatically generated from these messages.
|
||||
|
||||
```shell
|
||||
git commit -a
|
||||
```
|
||||
Note: the optional commit `-a` command line option will automatically "add" and "rm" edited files.
|
||||
|
||||
* Push your branch to GitHub:
|
||||
|
||||
```shell
|
||||
git push origin my-fix-branch
|
||||
```
|
||||
|
||||
* In GitHub, send a pull request to `ant-design-blazor:master`.
|
||||
* If we suggest changes then:
|
||||
* Make the required updates.
|
||||
* Re-run the ant-design-blazor test suites to ensure tests are still passing.
|
||||
* Rebase your branch and force push to your GitHub repository (this will update your Pull Request):
|
||||
|
||||
```shell
|
||||
git rebase master -i
|
||||
git push -f
|
||||
```
|
||||
|
||||
That's it! Thank you for your contribution!
|
||||
|
||||
#### After your pull request is merged
|
||||
|
||||
After your pull request is merged, you can safely delete your branch and pull the changes
|
||||
from the main (upstream) repository:
|
||||
|
||||
* Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:
|
||||
|
||||
```shell
|
||||
git push origin --delete my-fix-branch
|
||||
```
|
||||
|
||||
* Check out the master branch:
|
||||
|
||||
```shell
|
||||
git checkout master -f
|
||||
```
|
||||
|
||||
* Delete the local branch:
|
||||
|
||||
```shell
|
||||
git branch -D my-fix-branch
|
||||
```
|
||||
|
||||
* Update your master with the latest upstream version:
|
||||
|
||||
```shell
|
||||
git pull --ff upstream master
|
||||
```
|
||||
|
||||
## <a name="rules"></a> Coding Rules
|
||||
To ensure consistency throughout the source code, keep these rules in mind as you are working:
|
||||
|
||||
* All features or bug fixes **must be tested** by one or more specs (unit-tests).
|
||||
* All public API methods **must be documented**.
|
||||
|
||||
## <a name="commit"></a> Commit Message Guidelines
|
||||
|
||||
We have very precise rules over how our git commit messages can be formatted. This leads to **more
|
||||
readable messages** that are easy to follow when looking through the **project history**. But also,
|
||||
we use the git commit messages to **generate the ant-design-blazor change log**.
|
||||
|
||||
### Commit Message Format
|
||||
Each commit message consists of a **header**, a **body** and a **footer**. The header has a special
|
||||
format that includes a **type**, a **scope** and a **subject**:
|
||||
|
||||
```
|
||||
<type>(<scope>): <subject>
|
||||
<BLANK LINE>
|
||||
<body>
|
||||
<BLANK LINE>
|
||||
<footer>
|
||||
```
|
||||
|
||||
The **header** is mandatory and the **scope** of the header is optional.
|
||||
|
||||
Any line of the commit message cannot be longer 100 characters! This allows the message to be easier
|
||||
to read on GitHub as well as in various git tools.
|
||||
|
||||
Footer should contain a [closing reference to an issue](https://help.github.com/articles/closing-issues-via-commit-messages/) if any.
|
||||
|
||||
Samples: (even more [samples](https://github.com/ant-design-blazor/ant-design-blazor/commits/master))
|
||||
|
||||
```
|
||||
docs(changelog): update change log to beta.5
|
||||
```
|
||||
```
|
||||
fix(release): need to depend on latest rxjs and zone.js
|
||||
|
||||
The version in our package.json gets copied to the one we publish, and users need the latest of these.
|
||||
```
|
||||
|
||||
### Revert
|
||||
If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of the reverted commit. In the body it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit being reverted.
|
||||
|
||||
### Type
|
||||
Must be one of the following:
|
||||
|
||||
* **build**: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
|
||||
* **ci**: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
|
||||
* **docs**: Documentation only changes
|
||||
* **feat**: A new feature
|
||||
* **fix**: A bug fix
|
||||
* **perf**: A code change that improves performance
|
||||
* **refactor**: A code change that neither fixes a bug nor adds a feature
|
||||
* **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
|
||||
* **test**: Adding missing tests or correcting existing tests
|
||||
|
||||
### Scope
|
||||
The scope should be the name of the module affected (folder name or other meaningful words), and should prefix with *module:* (as perceived by person reading changelog generated from commit messages.
|
||||
|
||||
The following are some examples:
|
||||
|
||||
* **module:alert**
|
||||
* **module:badge**
|
||||
* **module:breadcrumb**
|
||||
* **module:OTHER_COMPONENT_NAME**
|
||||
|
||||
There are currently a few exceptions to the "use module name" rule:
|
||||
|
||||
* **packaging**: used for changes that change the npm package layout, e.g. public path changes, package.json changes, d.ts file/format changes, changes to bundles, etc.
|
||||
* **changelog**: used for updating the release notes in CHANGELOG.md
|
||||
* **showcase**: used for docs-app (ng.ant.design) related changes within the /showcase directory of the repo
|
||||
* none/empty string: useful for `style`, `test` and `refactor` changes that are done across all packages (e.g. `style: add missing semicolons`)
|
||||
|
||||
### Subject
|
||||
The subject contains succinct description of the change:
|
||||
|
||||
* use the imperative, present tense: "change" not "changed" nor "changes"
|
||||
* don't capitalize first letter
|
||||
* no dot (.) at the end
|
||||
|
||||
### Body
|
||||
Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes".
|
||||
The body should include the motivation for the change and contrast this with previous behavior.
|
||||
|
||||
### Footer
|
||||
The footer should contain any information about **Breaking Changes** and is also the place to
|
||||
reference GitHub issues that this commit **Closes**.
|
||||
|
||||
**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines. The rest of the commit message is then used for this.
|
||||
|
||||
A detailed explanation can be found in this [document][commit-message-format].
|
||||
|
||||
|
||||
[coc]: https://github.com/ant-design-blazor/ant-design-blazor/blob/master/CODE_OF_CONDUCT.md
|
||||
[commit-message-format]: https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit#
|
||||
[dev-doc]: https://github.com/ant-design-blazor/ant-design-blazor/blob/master/docs/DEVELOPER.md
|
||||
[github]: https://github.com/ant-design-blazor/ant-design-blazor
|
||||
[slack]: https://join.slack.com/t/AntBlazor/shared_invite/zt-etfaf1ww-AEHRU41B5YYKij7SlHqajA
|
||||
[plunker]: http://plnkr.co/edit
|
|
@ -0,0 +1,74 @@
|
|||
---
|
||||
order: 11
|
||||
title: How to Contribute
|
||||
---
|
||||
|
||||
The following is a set of guidelines for contributing to Ant Design Blazor. Please spend several minutes in reading these guidelines before you create an issue or pull request.
|
||||
|
||||
## Code of Conduct
|
||||
|
||||
We have adopted a [Code of Conduct](https://github.com/ant-design-blazor/ant-design-blazor/blob/master/CODE_OF_CONDUCT.md) that we expect project participants to adhere to. Please read the full text so that you can understand what actions will and will not be tolerated.
|
||||
|
||||
## Open Development
|
||||
|
||||
All work on ant-design-blazor happens directly on [GitHub](https://github.com/ant-design-blazor/ant-design-blazor). Both core team members and external contributors send pull requests which go through the same review process.
|
||||
|
||||
## Bugs
|
||||
|
||||
We are using [GitHub Issues](https://github.com/ant-design-blazor/ant-design-blazor/issues) for bug tracing. The best way to get your bug fixed is using our [issue helper](https://ng.ant.design/issue-helper/#/en).
|
||||
|
||||
Before you reporting a bug, please make sure you've searched exists issues, and read our [FAQ](docs/faq).
|
||||
|
||||
## Proposing a Change
|
||||
|
||||
If you intend to change the public API or introduce new feature, we also recommend use our [issue helper](https://ng.ant.design/issue-helper/#/en) to create a feature request issue.
|
||||
|
||||
## Your First Pull Request
|
||||
|
||||
Working on your first Pull Request? You can learn how from these resources:
|
||||
|
||||
* [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/)
|
||||
* [First Contributions](https://github.com/firstcontributions/first-contributions)
|
||||
|
||||
To help you get your feet wet and get you familiar with our contribution process, we have a list of [Good First Issue](https://github.com/ant-design-blazor/ant-design-blazor/labels/good%20first%20issue) that contain bugs or small features that have a relatively limited scope. This is a great place to get started.
|
||||
|
||||
If you decide to fix an issue, please be sure to check the comment thread in case somebody is already working on a fix. If nobody is working on it at the moment, please leave a comment stating that you intend to work on it so other people don’t accidentally duplicate your effort.
|
||||
|
||||
If somebody claims an issue but doesn’t follow up for more than two weeks, it’s fine to take over it but you should still leave a comment.
|
||||
|
||||
## Contribute
|
||||
|
||||
The core team is monitoring for pull requests. We will review your pull request and either merge it, request changes to it, or close it with an explanation.
|
||||
|
||||
**Before submitting a pull request**, please make sure the followings are done:
|
||||
|
||||
1. Run `dotnet build` in the repository root.
|
||||
2. If you’ve fixed a bug or added code that should be tested, add tests!
|
||||
3. Make sure the test suite passes (`dotnet test`).
|
||||
4. Make sure your code lints (`dotnet build`).
|
||||
5. Make sure rebase your code to keep the history clean.
|
||||
6. Make sure your commit message meet the [guidelines](https://github.com/ant-design-blazor/ant-design-blazor/blob/master/CONTRIBUTING.md#-commit-message-guidelines)
|
||||
|
||||
## How to send a Pull Request
|
||||
|
||||
1. fork the repo of `ant-design-blazor`
|
||||
2. On `master`: `git remote add upstream https://github.com/ant-design-blazor/ant-design-blazor.git`
|
||||
3. On `master`: `git pull upstream master`
|
||||
4. On `master`: `git push origin master`
|
||||
5. Checkout the feature branch (for example if the branch is called `docs-fix`): `git checkout docs-fix`
|
||||
6. On `docs-fix` I rebase: `git rebase origin/master`
|
||||
7. On `docs-fix` change the code and commit: `git commit -a`, you need to follow the [commit message guidelines](https://github.com/ant-design-blazor/ant-design-blazor/blob/master/CONTRIBUTING.md#-commit-message-guidelines)
|
||||
8. Then, push up: `git push` (might need `-f`, just be sure you understand force pushing before you do it)
|
||||
9. Send Pull Request in the Github
|
||||
|
||||
## Development Workflow
|
||||
|
||||
After cloning `ant-design-blazor` and running `npm install` to fetch its dependencies, you can run the following commands:
|
||||
|
||||
* `dotnet run` runs ant-design-blazor website locally.
|
||||
* `dotnet build` checks the code style.
|
||||
* `dotnet test` runs the complete test suite.
|
||||
* `dotnet publish -c release -o publish` creates build of `ant-design-blazor`.
|
||||
|
||||
If you running into problems while developing ant-design-blazor, you can refer to our [developement guide](https://github.com/ant-design-blazor/ant-design-blazor/wiki/Development-Guide) on GitHub.
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
---
|
||||
order: 11
|
||||
title: 贡献指南
|
||||
---
|
||||
|
||||
这篇指南会指导你如何为 Ant Design Blazor 贡献一份自己的力量,请在你要提 issue 或者 pull request 之前花几分钟来阅读一遍这篇指南。
|
||||
|
||||
## 行为准则
|
||||
|
||||
我们有一份 [行为准则](https://github.com/ant-design-blazor/ant-design-blazor/blob/master/CODE_OF_CONDUCT.md),希望所有的贡献者都能遵守,请花时间阅读一遍全文以确保你能明白哪些是可以做的,哪些是不可以做的。
|
||||
|
||||
## 透明的开发
|
||||
|
||||
我们所有的工作都会放在 [GitHub](https://github.com/ant-design-blazor/ant-design-blazor) 上。不管是核心团队的成员还是外部贡献者的 pull request 都需要进过同样流程的 review。
|
||||
|
||||
## Bugs
|
||||
|
||||
我们使用 [GitHub Issues](https://github.com/ant-design-blazor/ant-design-blazor/issues) 来做 bug 追踪。 如果你想要你发现的 bug 被快速解决,最好的办法就是通过我们提供的 [issue 小助手](https://ng.ant.design/issue-helper/#/zh) 来提 issue。
|
||||
|
||||
在你报告一个 bug 之前,请先确保已经搜索过已有的 issue 和阅读了我们的 [常见问题](docs/faq)。
|
||||
|
||||
## 新增功能
|
||||
|
||||
如果你有改进我们的 API 或者新增功能的想法,我们同样推荐你使用我们提供的 [issue 小助手](https://ng.ant.design/issue-helper/#/zh) 来新建一个添加新功能的 issue。
|
||||
|
||||
## 第一次贡献
|
||||
|
||||
如果你还不清楚怎么在 GitHub 上提 Pull Request ,可以阅读下面这些文章来学习:
|
||||
|
||||
* [如何为开源做贡献](https://opensource.guide/zh-cn/how-to-contribute/)
|
||||
* [第一次参与开源](https://github.com/firstcontributions/first-contributions/blob/master/translations/README.chs.md)
|
||||
|
||||
为了能帮助你开始你的第一次尝试,我们用 [Good First Issue](https://github.com/ant-design-blazor/ant-design-blazor/labels/good%20first%20issue) 标记了一些比较比较容易修复的 bug 和小功能。这些 issue 可以很好地做为你的首次尝试。
|
||||
|
||||
如果你打算开始处理一个 issue,请先检查一下 issue 下面的留言以确保没有别人正在处理这个 issue。如果当前没有人在处理的话你可以留言告知其他人你将会处理这个 issue,以免别人重复劳动。
|
||||
|
||||
如果之前有人留言说会处理这个 issue 但是一两个星期都没有动静,那么你也可以接手处理这个 issue,当然还是需要留言告知其他人。
|
||||
|
||||
## 贡献代码
|
||||
|
||||
Ant Design Blazor 团队会关注所有的 Pull Request,我们会 review 以及合并你的代码,也有可能要求你做一些修改或者告诉你我们为什么不能接受这样的修改。
|
||||
|
||||
**在你发送 Pull Request 之前**,请确认你是按照下面的步骤来做的:
|
||||
|
||||
1. 在项目根目录下运行了 `dotnet build`。
|
||||
2. 如果你修复了一个 bug 或者新增了一个功能,请确保写了相应的测试,这很重要。
|
||||
3. 确认所有的测试都是通过的 `dotnet test`。
|
||||
4. 确保你的代码通过了 lint 检查 `dotnet build`。
|
||||
5. 确保你的代码在提交之前经过了正确的 [Rebase](https://www.digitalocean.com/community/tutorials/how-to-rebase-and-update-a-pull-request)。
|
||||
6. 确保你的提交信息符合[我们的 commit 规范](https://github.com/ant-design-blazor/ant-design-blazor/blob/master/CONTRIBUTING.md#-commit-message-guidelines)。
|
||||
|
||||
|
||||
## 如何提出 Pull Request
|
||||
|
||||
1. fork `ant-design-blazor` 仓库,以下所有操作均在 fork 之后的仓库上执行
|
||||
2. 在 `master` 分支运行:`git remote add upstream https://github.com/ant-design-blazor/ant-design-blazor.git`
|
||||
3. 在 `master` 分支运行: `git pull upstream master`
|
||||
4. 在 `master` 分支运行: `git push origin master`
|
||||
5. 切换到你要工作的 feature 分支 (例如有一个分支叫 `docs-fix`): `git checkout docs-fix`
|
||||
6. 在 `docs-fix` 分支运行: `git rebase origin/master`
|
||||
7. 在 `docs-fix` 分支修改代码,并 commit: `git commit -a`,按照我们 [commit 规范](https://github.com/ant-design-blazor/ant-design-blazor/blob/master/CONTRIBUTING.md#-commit-message-guidelines)进行填写。
|
||||
8. 推送代码 `git push` (可能需要 `-f`)
|
||||
9. 在 Github 上发起 Pull Request 请求
|
||||
|
||||
## 开发流程
|
||||
|
||||
在你 clone 了 `ant-design-blazor` 的代码并且使用 `dotnet restore` 安装完依赖后,你还可以运行下面几个常用的命令:
|
||||
|
||||
* `dotnet run` 在本地运行 `ant-design-blazor` 的网站。
|
||||
* `dotnet build` 检查代码风格。
|
||||
* `dotnet test` 运行测试。
|
||||
* `dotnet publish -c release -o publish` 构建 `ant-design-blazor` 到 `publish` 目录。
|
||||
|
||||
如果在开发过程中遇到问题,可查看 GitHub 上的[开发指南](https://github.com/ant-design-blazor/ant-design-blazor/wiki/%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97)。
|
|
@ -0,0 +1,61 @@
|
|||
---
|
||||
order: 1
|
||||
title: Getting Started
|
||||
---
|
||||
|
||||
Ant Design of Blazor is dedicated to providing a **good development experience** for programmers.
|
||||
|
||||
> Before delving into Ant Design Blazor, a good knowledge of [Blazor](https://blazor.net) and [.NET Core](https://dot.net/) is needed.
|
||||
|
||||
## First Local Development
|
||||
|
||||
During development, you may need to compile and debug .NET code, and even proxy some of the requests to mock data or other external services. All of these can be done with quick feedback provided through hot reloading of changes.
|
||||
|
||||
Such features, together with packaging the production version, are covered in this work flow.
|
||||
|
||||
### Installation
|
||||
|
||||
We strongly recommended to develop Blazor with `.NET Core SDK`, you can install it form `https://dotnet.microsoft.com/download`.
|
||||
|
||||
### Create a New Blazor WebAssembly Project
|
||||
|
||||
A new project can be created using .NET Core SDK.
|
||||
|
||||
```bash
|
||||
$ dotnet new blazorwasm -o PROJECT-NAME
|
||||
```
|
||||
|
||||
`dotnet cli` will run `dotnet restore` after a project is created. If it fails, you can run `dotnet restore` by yourself.
|
||||
|
||||
### Development & Debugging
|
||||
|
||||
Run your project now.
|
||||
|
||||
```bash
|
||||
$ dotnet run
|
||||
```
|
||||
|
||||
### Building & Deployment
|
||||
|
||||
```bash
|
||||
$ dotnet publish -c release -o dist
|
||||
```
|
||||
|
||||
Entry files will be built and generated in `dist/wwwroot` directory, where we can deploy it to different environments.
|
||||
|
||||
### Install Ant Design Blazor
|
||||
|
||||
```bash
|
||||
$ dotnet add package AntDesign
|
||||
```
|
||||
|
||||
### Import Styles
|
||||
|
||||
#### Use styles and JS
|
||||
|
||||
Import the styles and script in `wwwroot/index.html`
|
||||
|
||||
```html
|
||||
<link href="_content/AntDesign/css/ant-design-blazor.css" rel="stylesheet" />
|
||||
<script src="_content/AntDesign/js/ant-design-blazor.js"></script>
|
||||
```
|
|
@ -0,0 +1,66 @@
|
|||
---
|
||||
order: 1
|
||||
title: 快速上手
|
||||
---
|
||||
|
||||
Ant Design of Blazor 致力于提供给程序员**愉悦**的开发体验。
|
||||
|
||||
> 在开始之前,推荐先学习 [Blazor](https://blazor.net) 和 [.Net Core](https://dot.net/),并正确安装和配置了 [.NET Core SDK](https://dotnet.microsoft.com/download) 3.1.300 或以上。官方指南假设你已了解关于 HTML、CSS 和 JavaScript 的初级知识,并且已经完全掌握了 Blazor 的正确开发方式。如果你刚开始学习.NET 或者 Blazor,将 UI 框架作为你的第一步可能不是最好的主意。
|
||||
|
||||
|
||||
## 第一个本地实例
|
||||
|
||||
实际项目开发中,你会需要对 C# 代码的构建、调试、代理、打包部署等一系列工程化的需求。
|
||||
我们强烈建议使用官方的 Visual Studio 2009 或者 VS Code 进行开发,下面我们用一个简单的实例来说明。
|
||||
|
||||
|
||||
### 创建一个 Blazor WebAssembly 项目
|
||||
|
||||
> 在创建项目之前,请确保 `.NET Core SDK 3.1.300+` 已被成功安装。
|
||||
|
||||
执行以下命令,`dotnet cli` 会在当前目录下新建一个名称为 `PROJECT-NAME` 的文件夹,并自动安装好相应依赖。
|
||||
|
||||
```bash
|
||||
$ dotnet new blazorwasm -o PROJECT-NAME
|
||||
```
|
||||
|
||||
### 开发调试
|
||||
|
||||
一键启动调试,运行成功后显示模板页面。
|
||||
|
||||
```bash
|
||||
$ dotnet run
|
||||
```
|
||||
|
||||
### 构建和部署
|
||||
|
||||
```bash
|
||||
$ dotnet publish -c release -o dist
|
||||
```
|
||||
|
||||
入口文件会构建到 `dist/wwwroot` 目录中,你可以自由部署到不同环境中进行引用。
|
||||
|
||||
|
||||
### 安装组件
|
||||
|
||||
```bash
|
||||
$ dotnet add package AntDesign
|
||||
```
|
||||
|
||||
### 引入样式
|
||||
|
||||
#### 使用样式与脚本
|
||||
|
||||
在 `wwwroot/index.html` 中引入了
|
||||
|
||||
```html
|
||||
<link href="_content/AntDesign/css/ant-design-blazor.css" rel="stylesheet" />
|
||||
<script src="_content/AntDesign/js/ant-design-blazor.js"></script>
|
||||
```
|
||||
|
||||
然后在 Razor 模板中使用:
|
||||
|
||||
```html
|
||||
<Button Type="primary">Primary</Button>
|
||||
```
|
||||
|
Загрузка…
Ссылка в новой задаче