forked from zhihu/griffith
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 5047aec
Showing
351 changed files
with
35,858 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
**/dist | ||
**/es |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
const OFF = 0 | ||
const ERROR = 2 | ||
|
||
module.exports = { | ||
// parse proposal features like class fileds | ||
parser: 'babel-eslint', | ||
|
||
// https://eslint.org/docs/user-guide/configuring#specifying-parser-options | ||
parserOptions: { | ||
ecmaVersion: 2019, | ||
sourceType: 'module', | ||
ecmaFeatures: { | ||
// Supports JSX syntax (not the same as supporting React). | ||
jsx: true, | ||
}, | ||
}, | ||
|
||
// commonly used envs | ||
env: { | ||
browser: true, | ||
node: true, | ||
es6: true, | ||
jest: true, | ||
}, | ||
|
||
// we use recommended configurations | ||
extends: [ | ||
// https://eslint.org/docs/rules/ | ||
'eslint:recommended', | ||
// https://github.com/yannickcr/eslint-plugin-react | ||
'plugin:react/recommended', | ||
// https://github.com/benmosher/eslint-plugin-import | ||
'plugin:import/recommended', | ||
// https://github.com/prettier/eslint-plugin-prettier | ||
'plugin:prettier/recommended', | ||
], | ||
|
||
plugins: ['react-hooks'], | ||
|
||
rules: { | ||
'prettier/prettier': ['error', require('./.prettierrc')], | ||
|
||
// disable nice-to-have rules for migrate convenience | ||
'react/prop-types': OFF, | ||
'react/no-find-dom-node': OFF, | ||
'react/display-name': OFF, | ||
|
||
// recommended rules | ||
'prefer-const': ERROR, | ||
'no-var': ERROR, | ||
|
||
'react-hooks/rules-of-hooks': ERROR, | ||
}, | ||
|
||
settings: { | ||
// https://github.com/yannickcr/eslint-plugin-react#configuration | ||
react: { | ||
version: '16', | ||
}, | ||
'import/core-modules': ['griffith', 'griffith-mp4'], | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
name: 🐛 Bug report | ||
about: Create a report to help us improve | ||
--- | ||
|
||
## 🐛 Bug Report | ||
|
||
A clear and concise description of what the bug is. | ||
|
||
## To Reproduce | ||
|
||
Steps to reproduce the behavior: | ||
|
||
## Expected behavior | ||
|
||
A clear and concise description of what you expected to happen. | ||
|
||
## Link to repl or repo (highly encouraged) | ||
|
||
Please provide a minimal repository on GitHub. | ||
|
||
Issues without a reproduction link are likely to stall. | ||
|
||
## Run `npx envinfo --system --binaries --npmPackages griffith --markdown --clipboard` | ||
|
||
Paste the results here: | ||
|
||
```bash | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
name: 🐛 Bug report | ||
about: Create a report to help us improve | ||
--- | ||
|
||
## 🐛 Bug Report | ||
|
||
A clear and concise description of what the bug is. | ||
|
||
## To Reproduce | ||
|
||
Steps to reproduce the behavior: | ||
|
||
## Expected behavior | ||
|
||
A clear and concise description of what you expected to happen. | ||
|
||
## Link to repl or repo (highly encouraged) | ||
|
||
Please provide a minimal repository on GitHub. | ||
|
||
Issues without a reproduction link are likely to stall. | ||
|
||
## Run `npx envinfo --system --binaries --npmPackages griffith --markdown --clipboard` | ||
|
||
Paste the results here: | ||
|
||
```bash | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
name: 💬 Questions / Help | ||
about: If you have questions, please read full readme first | ||
--- | ||
|
||
## 💬 Questions and Help | ||
|
||
- Read carefully the README of the project | ||
- Search if your answer has already been answered in old issues | ||
|
||
After you can submit your question and we will be happy to help you! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
node_modules | ||
/coverage | ||
|
||
bin | ||
|
||
dist | ||
cjs | ||
es | ||
|
||
# Files | ||
package-lock.json | ||
.eslintcache | ||
*.log | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package.json | ||
package-lock.json | ||
lerna.json | ||
CHANGELOG.md | ||
**/dist | ||
**/es |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
bracketSpacing: false, | ||
semi: false, | ||
singleQuote: true, | ||
trailingComma: 'es5', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# 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, gender identity and expression, level of experience, 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 fe@zhihu.com. The project team will review and investigate all complaints, and will respond in a way that it deems 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 [http://contributor-covenant.org/version/1/4][version] | ||
|
||
[homepage]: http://contributor-covenant.org | ||
[version]: http://contributor-covenant.org/version/1/4/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
[English](./CONTRIBUTING.md) | 简体中文 | ||
|
||
# 贡献指南 | ||
|
||
这篇指南会指导你如何为 Griffith 贡献一份自己的力量,请在你要提 issue 或者 pull request 之前花几分钟来阅读一遍这篇指南。 | ||
|
||
## [行为准则](./CODE_OF_CONDUCT.md) | ||
|
||
我们有一份[行为准则](./CODE_OF_CONDUCT.md),希望所有的贡献者都能遵守,请花时间阅读一遍全文以确保你能明白哪些是可以做的,哪些是不可以做的。 | ||
|
||
## 透明的开发 | ||
|
||
我们所有的工作都会放在 GitHub 上。不管是核心团队的成员还是外部贡献者的 pull request 都需要经过同样流程的 review。 | ||
|
||
### 工作流和 Pull Request | ||
|
||
在提交 PR 前,请确保你做了以下的事情。 | ||
|
||
1. Fork Griffith 仓库,并在新仓库创建新的分支。这里有一份如何 fork 的指南:https://help.github.com/articles/fork-a-repo/。 | ||
|
||
打开命令行: | ||
|
||
```sh | ||
$ git clone https://github.com/<your_username>/griffith | ||
$ cd griffith | ||
$ git checkout -b my_branch | ||
``` | ||
|
||
Note: 把 `<your_username>` 替换成你的 GitHub 用户名。 | ||
|
||
2. Griffith 使用 [Yarn](https://yarnpkg.com/zh-Hant/) 来管理项目依赖. 请确保你的开发环境已经安装了 Yarn。 | ||
|
||
3. 使用 Yarn 安装依赖: | ||
|
||
```sh | ||
yarn | ||
``` | ||
|
||
检查 yarn 版本 | ||
|
||
```sh | ||
yarn --version | ||
``` | ||
|
||
4. 我们提供了多个例子供开发使用,你可以直接运行以下脚本,根据 webpack 提示进行开发。 | ||
|
||
```sh | ||
yarn start | ||
``` | ||
|
||
5. 如果你修改了 APIs,请更新文档。 | ||
|
||
6. 确保能通过 lint 校验。 | ||
|
||
```sh | ||
npm run lint:fix | ||
``` | ||
|
||
7. 请确保能通过所有测试用例。 | ||
|
||
```sh | ||
yarn test | ||
``` | ||
|
||
8. 请确保 commit 符合规范。Griffith 使用[约定式提交](https://www.conventionalcommits.org/zh/v1.0.0-beta.2/) 来规范 commit。 | ||
|
||
## 提交 bug | ||
|
||
### 查找已知的 Issues | ||
|
||
我们使用 GitHub Issues 来管理项目 bug。 我们将密切关注已知 bug,并尽快修复。 在提交新问题之前,请尝试确保您的问题尚不存在。 | ||
|
||
### 提交新的 Issues | ||
|
||
请按照 Issues Template 的指示来提交新的 Issues。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
English | [简体中文](./CONTRIBUTING-zh_CN.md) | ||
|
||
# How to Contribute | ||
|
||
The following is a set of guidelines for contributing to Griffith. Please spend several minutes in reading these guidelines before you create an issue or pull request. | ||
|
||
## [Code of Conduct](./CODE_OF_CONDUCT.md) | ||
|
||
We have adopted a Code of Conduct that we expect project participants to adhere to. Please read the [the full text](./CODE_OF_CONDUCT.md) so that you can understand what actions will and will not be tolerated. | ||
|
||
## Open Development | ||
|
||
All work on Griffith happens directly on GitHub. Both core team members and external contributors send pull requests which go through the same review process. | ||
|
||
### Workflow and Pull Requests | ||
|
||
_Before_ submitting a pull request, please make sure the following is done… | ||
|
||
1. Fork the repo and create your branch from `master`. A guide on how to fork a repository: https://help.github.com/articles/fork-a-repo/ | ||
|
||
Open terminal (e.g. Terminal, iTerm, Git Bash or Git Shell) and type: | ||
|
||
```sh | ||
$ git clone https://github.com/<your_username>/griffith | ||
$ cd griffith | ||
$ git checkout -b my_branch | ||
``` | ||
|
||
Note: Replace `<your_username>` with your GitHub username | ||
|
||
2. Griffith uses [Yarn](https://yarnpkg.com/en/) for running development scripts. If you haven't already done so, please [install yarn](https://yarnpkg.com/en/docs/install). | ||
3) Run `yarn install`. On Windows: To install [Yarn](https://yarnpkg.com/en/docs/install#windows-tab) on Windows you may need to download either node.js or Chocolatey<br />. | ||
```sh | ||
yarn | ||
``` | ||
To check your version of Yarn and ensure it's installed you can type: | ||
|
||
```sh | ||
yarn --version | ||
``` | ||
|
||
4) We have provided several examples for development. You can run the following script and develop according to the webpack prompt. | ||
|
||
```sh | ||
yarn start | ||
``` | ||
|
||
5) If you've changed APIs, update the documentation. | ||
6) Ensure the linting is good via `yarn run lint:fix`. | ||
```sh | ||
npm run lint:fix | ||
``` | ||
7) Ensure the testing is good via `yarn run test`. | ||
```sh | ||
yarn test | ||
``` | ||
8) Ensure the commit is readable. see [Conventional Commits](https://www.conventionalcommits.org/zh/v1.0.0-beta.2/). | ||
## Bugs | ||
### Where to Find Known Issues | ||
We will be using GitHub Issues for our public bugs. We will keep a close eye on this and try to make it clear when we have an internal fix in progress. Before filing a new issue, try to make sure your problem doesn't already exist. | ||
|
||
### Reporting New Issues | ||
|
||
The best way to get your bug fixed is to provide a reduced test case. Please provide a public repository with a runnable example. | ||
|
||
## License | ||
|
||
By contributing to Griffith, you agree that your contributions will be licensed under its MIT license. |
Oops, something went wrong.