Skip to content

Commit 36c56ce

Browse files
committed
feat: crete react doc
1 parent bec361d commit 36c56ce

File tree

176 files changed

+21498
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

176 files changed

+21498
-1
lines changed

.editorconfig

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.md]
13+
trim_trailing_whitespace = false
14+
15+
[*.less]
16+
indent_style = space
17+
indent_size = 2
18+
19+
[Makefile]
20+
indent_style = tab

.eslintrc.js

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
const eslintrc = {
2+
"parser": "babel-eslint",
3+
"extends": "airbnb",
4+
"env": {
5+
"browser": true,
6+
"node": true,
7+
"es6": true,
8+
"mocha": true,
9+
"jest": true,
10+
"jasmine": true
11+
},
12+
"plugins": [
13+
"react",
14+
"import"
15+
],
16+
"parserOptions": {
17+
parser: 'babel-eslint',
18+
},
19+
"rules": {
20+
"linebreak-style": 0,
21+
"func-names": 0,
22+
"sort-imports": 0,
23+
"arrow-body-style": 0,
24+
"prefer-destructuring": 0,
25+
"max-len": 0,
26+
"consistent-return": 0,
27+
"comma-dangle": [
28+
"error",
29+
"always-multiline"
30+
],
31+
"function-paren-newline": 0,
32+
"class-methods-use-this": 0,
33+
"react/sort-comp": 0,
34+
"react/prop-types": 0,
35+
"react/jsx-first-prop-new-line": 0,
36+
"react/require-extension": 0,
37+
"react/jsx-filename-extension": [
38+
1,
39+
{
40+
"extensions": [
41+
".js",
42+
".jsx"
43+
]
44+
}
45+
],
46+
"import/extensions": 0,
47+
"import/no-unresolved": 0,
48+
"import/no-extraneous-dependencies": 0,
49+
"import/prefer-default-export": 0,
50+
"jsx-a11y/no-static-element-interactions": 0,
51+
"jsx-a11y/anchor-has-content": 0,
52+
"jsx-a11y/click-events-have-key-events": 0,
53+
"jsx-a11y/anchor-is-valid": 0,
54+
"jsx-a11y/label-has-for": 0,
55+
"jsx-a11y/no-noninteractive-element-interactions": 0,
56+
"jsx-a11y/mouse-events-have-key-events": 0,
57+
"react/no-danger": 0,
58+
"react/jsx-no-bind": 0,
59+
"react/forbid-prop-types": 0,
60+
"react/require-default-props": 0,
61+
"react/no-did-mount-set-state": 0,
62+
"react/no-array-index-key": 0,
63+
"react/no-find-dom-node": 0,
64+
"react/no-unused-state": 0,
65+
"react/no-unused-prop-types": 0,
66+
"react/default-props-match-prop-types": 0,
67+
"react/jsx-curly-spacing": 0,
68+
"react/no-render-return-value": 0,
69+
'react/jsx-uses-react': 0,
70+
'react/react-in-jsx-scope': 0,
71+
"object-curly-newline": 0,
72+
"no-param-reassign": 0,
73+
"no-return-assign": 0,
74+
"no-redeclare": 0,
75+
"no-restricted-globals": 0,
76+
"no-restricted-syntax": 0,
77+
"no-underscore-dangle": 0,
78+
"no-unused-expressions": 0,
79+
"no-use-before-define": 0,
80+
"semi": ["error", "never"],
81+
"quotes": 0,
82+
"no-plusplus": 0
83+
}
84+
}
85+
86+
if (process.env.NODE_ENV === 'development') {
87+
Object.assign(eslintrc.rules,
88+
{
89+
'no-console': 0,
90+
'no-unused-vars': 0,
91+
});
92+
}
93+
94+
module.exports = eslintrc

.github/FUNDING.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# These are supported funding model platforms
2+
3+
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4+
patreon: # Replace with a single Patreon username
5+
open_collective: # Replace with a single Open Collective username
6+
ko_fi: # Replace with a single Ko-fi username
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: # Replace with a single Liberapay username
10+
issuehunt: # Replace with a single IssueHunt username
11+
otechie: # Replace with a single Otechie username
12+
# Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
13+
custom: ['http://muyunyun.cn/sponsor/']

.github/config.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
todo:
2+
keyword: "@makeAnIssue"

.github/dependabot.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# see https://github.com/yi-Xu-0100/traffic-to-badge/blob/main/.github/dependabot.yml
2+
version: 2
3+
updates:
4+
# Enable version updates for npm
5+
- package-ecosystem: 'npm'
6+
directory: '/'
7+
schedule:
8+
interval: 'daily'
9+
# Maintain dependencies for GitHub Actions
10+
- package-ecosystem: 'github-actions'
11+
directory: '/'
12+
schedule:
13+
interval: 'daily'

.github/stale.yml

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Configuration for probot-stale - https://github.com/probot/stale
2+
3+
# Number of days of inactivity before an Issue or Pull Request becomes stale
4+
daysUntilStale: 60
5+
6+
# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
7+
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
8+
daysUntilClose: 7
9+
10+
# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled)
11+
onlyLabels: []
12+
13+
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
14+
exemptLabels:
15+
- pinned
16+
- security
17+
- "[Status] Maybe Later"
18+
19+
# Set to true to ignore issues in a project (defaults to false)
20+
exemptProjects: false
21+
22+
# Set to true to ignore issues in a milestone (defaults to false)
23+
exemptMilestones: false
24+
25+
# Set to true to ignore issues with an assignee (defaults to false)
26+
exemptAssignees: false
27+
28+
# Label to use when marking as stale
29+
staleLabel: wontfix
30+
31+
# Comment to post when marking as stale. Set to `false` to disable
32+
markComment: >
33+
This issue has been automatically marked as stale because it has not had
34+
recent activity. It will be closed if no further activity occurs. Thank you
35+
for your contributions.
36+
37+
# Comment to post when removing the stale label.
38+
# unmarkComment: >
39+
# Your comment here.
40+
41+
# Comment to post when closing a stale Issue or Pull Request.
42+
# closeComment: >
43+
# Your comment here.
44+
45+
# Limit the number of actions per hour, from 1-30. Default is 30
46+
limitPerRun: 30
47+
48+
# Limit to only `issues` or `pulls`
49+
# only: issues
50+
51+
# Optionally, specify configuration settings that are specific to just 'issues' or 'pulls':
52+
# pulls:
53+
# daysUntilStale: 30
54+
# markComment: >
55+
# This pull request has been automatically marked as stale because it has not had
56+
# recent activity. It will be closed if no further activity occurs. Thank you
57+
# for your contributions.
58+
59+
# issues:
60+
# exemptLabels:
61+
# - confirmed

.github/workflows/gh-pages.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
deploy:
11+
runs-on: ubuntu-22.04
12+
permissions:
13+
contents: write
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
steps:
17+
- uses: actions/checkout@v3
18+
19+
- name: Setup Node
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: '14'
23+
24+
- name: Get yarn cache
25+
id: yarn-cache
26+
run: echo "YARN_CACHE_DIR=$(yarn cache dir)" >> "${GITHUB_OUTPUT}"
27+
28+
- name: Cache dependencies
29+
uses: actions/cache@v3
30+
with:
31+
path: ${{ steps.yarn-cache.outputs.YARN_CACHE_DIR }}
32+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
33+
restore-keys: |
34+
${{ runner.os }}-yarn-
35+
36+
- run: yarn install --frozen-lockfile
37+
- run: yarn build
38+
39+
- name: Deploy
40+
uses: peaceiris/actions-gh-pages@v3
41+
if: ${{ github.ref == 'refs/heads/main' }}
42+
with:
43+
github_token: ${{ secrets.GITHUB_TOKEN }}
44+
publish_dir: .crd-dist

.github/workflows/greetings.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Greetings
2+
3+
on: [pull_request, issues]
4+
5+
jobs:
6+
greeting:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/first-interaction@v1
10+
with:
11+
repo-token: ${{ secrets.GITHUB_TOKEN }}
12+
issue-message: 'Welcome your first issue here, thanks'
13+
pr-message: 'Welcome your first pr here, thanks'

.github/workflows/traffic2badge.yml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: traffic2badge
2+
on:
3+
push:
4+
branches:
5+
- main
6+
schedule:
7+
- cron: '1 0 * * *' #UTC
8+
9+
jobs:
10+
run:
11+
name: Make GitHub Traffic to Badge
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout Code
15+
uses: actions/checkout@v2.3.3
16+
17+
- name: Get Commit Message
18+
id: message
19+
uses: actions/github-script@v3.0.0
20+
env:
21+
FULL_COMMIT_MESSAGE: '${{ github.event.head_commit.message }}'
22+
with:
23+
result-encoding: string
24+
script: |
25+
var message = `${process.env.FULL_COMMIT_MESSAGE}`;
26+
core.info(message);
27+
if (message != '') return message;
28+
var time = new Date(Date.now()).toISOString();
29+
core.info(time);
30+
return `Get traffic data at ${time}`;
31+
32+
- name: Set Traffic
33+
id: traffic
34+
uses: yi-Xu-0100/traffic-to-badge@v1.4.0
35+
with:
36+
my_token: ${{ secrets.TRAFFIC_TOKEN }}
37+
#(default) static_list: ${{ github.repository }}
38+
#(default) traffic_branch: traffic
39+
#(default) views_color: brightgreen
40+
#(default) clones_color: brightgreen
41+
#(default) logo: github
42+
#(default) year:
43+
44+
- name: Deploy
45+
uses: peaceiris/actions-gh-pages@v3.7.3
46+
with:
47+
github_token: ${{ secrets.GITHUB_TOKEN }}
48+
publish_branch: ${{ steps.traffic.outputs.traffic_branch }}
49+
publish_dir: ${{ steps.traffic.outputs.traffic_path }}
50+
user_name: 'github-actions[bot]'
51+
user_email: 'github-actions[bot]@users.noreply.github.com'
52+
full_commit_message: ${{ steps.message.outputs.result }}
53+
54+
- name: Show Traffic Data
55+
run: |
56+
echo ${{ steps.traffic.outputs.traffic_branch }}
57+
echo ${{ steps.traffic.outputs.traffic_path }}
58+
cd ${{ steps.traffic.outputs.traffic_path }}
59+
ls -a

.gitignore

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
node_modules
2+
.create-react-doc-dist
3+
package-lock.json
4+
.cache
5+
.DS_Store
6+
.crd-dist/
7+
8+
*.bak
9+
*.tem
10+
*.log
11+
*.temp
12+
#.swp
13+
*.*~
14+
~*.*
15+
16+
docs/忽略文件.md

.npmignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.cache
2+
.gitignore
3+
.editorconfig
4+
.create-react-doc-dist
5+
node_modules
6+
package-lock.json
7+
dist

.npmrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# .npmrc
2+
3+
registry=https://registry.npmjs.org/

.yarnrc

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# .yarnrc
2+
registry "https://registry.npmjs.org/"

CONTRIBUTING.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# HOW TO CONTRIBUTE
2+
3+
1. Welcome your pr! Before pr, talk about situations in the [issue](https://github.com/MuYunyun/create-react-doc/issues/new) firstly. If the situation is reasonable, go to the next step;
4+
2. Switch to the new branch based main, submit the pr to branch `qa/latest` after finishing development.
5+
6+
## DEV
7+
8+
Run these bash command firstly.
9+
10+
```bash
11+
$ git clone https://github.com/MuYunyun/create-react-doc
12+
$ cd create-react-doc
13+
$ yarn && yarn bootstrap && yarn start
14+
```
15+
16+
And now you can see the document is running at http://localhost:3000.
17+
18+
## Test
19+
20+
After merging pr to qa/latest and publish beta package. You should verify the feature/bugfix with following bash:
21+
22+
```js
23+
yarn add create-react-doc@beta
24+
```

0 commit comments

Comments
 (0)