Skip to content

Commit

Permalink
feat: crete react doc
Browse files Browse the repository at this point in the history
  • Loading branch information
MuYunyun committed Dec 25, 2023
1 parent bec361d commit 36c56ce
Show file tree
Hide file tree
Showing 176 changed files with 21,498 additions and 1 deletion.
20 changes: 20 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[*.less]
indent_style = space
indent_size = 2

[Makefile]
indent_style = tab
94 changes: 94 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
const eslintrc = {
"parser": "babel-eslint",
"extends": "airbnb",
"env": {
"browser": true,
"node": true,
"es6": true,
"mocha": true,
"jest": true,
"jasmine": true
},
"plugins": [
"react",
"import"
],
"parserOptions": {
parser: 'babel-eslint',
},
"rules": {
"linebreak-style": 0,
"func-names": 0,
"sort-imports": 0,
"arrow-body-style": 0,
"prefer-destructuring": 0,
"max-len": 0,
"consistent-return": 0,
"comma-dangle": [
"error",
"always-multiline"
],
"function-paren-newline": 0,
"class-methods-use-this": 0,
"react/sort-comp": 0,
"react/prop-types": 0,
"react/jsx-first-prop-new-line": 0,
"react/require-extension": 0,
"react/jsx-filename-extension": [
1,
{
"extensions": [
".js",
".jsx"
]
}
],
"import/extensions": 0,
"import/no-unresolved": 0,
"import/no-extraneous-dependencies": 0,
"import/prefer-default-export": 0,
"jsx-a11y/no-static-element-interactions": 0,
"jsx-a11y/anchor-has-content": 0,
"jsx-a11y/click-events-have-key-events": 0,
"jsx-a11y/anchor-is-valid": 0,
"jsx-a11y/label-has-for": 0,
"jsx-a11y/no-noninteractive-element-interactions": 0,
"jsx-a11y/mouse-events-have-key-events": 0,
"react/no-danger": 0,
"react/jsx-no-bind": 0,
"react/forbid-prop-types": 0,
"react/require-default-props": 0,
"react/no-did-mount-set-state": 0,
"react/no-array-index-key": 0,
"react/no-find-dom-node": 0,
"react/no-unused-state": 0,
"react/no-unused-prop-types": 0,
"react/default-props-match-prop-types": 0,
"react/jsx-curly-spacing": 0,
"react/no-render-return-value": 0,
'react/jsx-uses-react': 0,
'react/react-in-jsx-scope': 0,
"object-curly-newline": 0,
"no-param-reassign": 0,
"no-return-assign": 0,
"no-redeclare": 0,
"no-restricted-globals": 0,
"no-restricted-syntax": 0,
"no-underscore-dangle": 0,
"no-unused-expressions": 0,
"no-use-before-define": 0,
"semi": ["error", "never"],
"quotes": 0,
"no-plusplus": 0
}
}

if (process.env.NODE_ENV === 'development') {
Object.assign(eslintrc.rules,
{
'no-console': 0,
'no-unused-vars': 0,
});
}

module.exports = eslintrc
13 changes: 13 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
# Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
custom: ['http://muyunyun.cn/sponsor/']
2 changes: 2 additions & 0 deletions .github/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
todo:
keyword: "@makeAnIssue"
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# see https://github.com/yi-Xu-0100/traffic-to-badge/blob/main/.github/dependabot.yml
version: 2
updates:
# Enable version updates for npm
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: 'daily'
# Maintain dependencies for GitHub Actions
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'daily'
61 changes: 61 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Configuration for probot-stale - https://github.com/probot/stale

# Number of days of inactivity before an Issue or Pull Request becomes stale
daysUntilStale: 60

# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
daysUntilClose: 7

# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled)
onlyLabels: []

# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
exemptLabels:
- pinned
- security
- "[Status] Maybe Later"

# Set to true to ignore issues in a project (defaults to false)
exemptProjects: false

# Set to true to ignore issues in a milestone (defaults to false)
exemptMilestones: false

# Set to true to ignore issues with an assignee (defaults to false)
exemptAssignees: false

# Label to use when marking as stale
staleLabel: wontfix

# Comment to post when marking as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when removing the stale label.
# unmarkComment: >
# Your comment here.

# Comment to post when closing a stale Issue or Pull Request.
# closeComment: >
# Your comment here.

# Limit the number of actions per hour, from 1-30. Default is 30
limitPerRun: 30

# Limit to only `issues` or `pulls`
# only: issues

# Optionally, specify configuration settings that are specific to just 'issues' or 'pulls':
# pulls:
# daysUntilStale: 30
# markComment: >
# This pull request has been automatically marked as stale because it has not had
# recent activity. It will be closed if no further activity occurs. Thank you
# for your contributions.

# issues:
# exemptLabels:
# - confirmed
44 changes: 44 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: GitHub Pages

on:
push:
branches:
- main
pull_request:

jobs:
deploy:
runs-on: ubuntu-22.04
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '14'

- name: Get yarn cache
id: yarn-cache
run: echo "YARN_CACHE_DIR=$(yarn cache dir)" >> "${GITHUB_OUTPUT}"

- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache.outputs.YARN_CACHE_DIR }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn install --frozen-lockfile
- run: yarn build

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/main' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: .crd-dist
13 changes: 13 additions & 0 deletions .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Greetings

on: [pull_request, issues]

jobs:
greeting:
runs-on: ubuntu-latest
steps:
- uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: 'Welcome your first issue here, thanks'
pr-message: 'Welcome your first pr here, thanks'
59 changes: 59 additions & 0 deletions .github/workflows/traffic2badge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: traffic2badge
on:
push:
branches:
- main
schedule:
- cron: '1 0 * * *' #UTC

jobs:
run:
name: Make GitHub Traffic to Badge
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2.3.3

- name: Get Commit Message
id: message
uses: actions/github-script@v3.0.0
env:
FULL_COMMIT_MESSAGE: '${{ github.event.head_commit.message }}'
with:
result-encoding: string
script: |
var message = `${process.env.FULL_COMMIT_MESSAGE}`;
core.info(message);
if (message != '') return message;
var time = new Date(Date.now()).toISOString();
core.info(time);
return `Get traffic data at ${time}`;
- name: Set Traffic
id: traffic
uses: yi-Xu-0100/traffic-to-badge@v1.4.0
with:
my_token: ${{ secrets.TRAFFIC_TOKEN }}
#(default) static_list: ${{ github.repository }}
#(default) traffic_branch: traffic
#(default) views_color: brightgreen
#(default) clones_color: brightgreen
#(default) logo: github
#(default) year:

- name: Deploy
uses: peaceiris/actions-gh-pages@v3.7.3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: ${{ steps.traffic.outputs.traffic_branch }}
publish_dir: ${{ steps.traffic.outputs.traffic_path }}
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
full_commit_message: ${{ steps.message.outputs.result }}

- name: Show Traffic Data
run: |
echo ${{ steps.traffic.outputs.traffic_branch }}
echo ${{ steps.traffic.outputs.traffic_path }}
cd ${{ steps.traffic.outputs.traffic_path }}
ls -a
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
node_modules
.create-react-doc-dist
package-lock.json
.cache
.DS_Store
.crd-dist/

*.bak
*.tem
*.log
*.temp
#.swp
*.*~
~*.*

docs/忽略文件.md
7 changes: 7 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.cache
.gitignore
.editorconfig
.create-react-doc-dist
node_modules
package-lock.json
dist
3 changes: 3 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# .npmrc

registry=https://registry.npmjs.org/
2 changes: 2 additions & 0 deletions .yarnrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# .yarnrc
registry "https://registry.npmjs.org/"
24 changes: 24 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# HOW TO CONTRIBUTE

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;
2. Switch to the new branch based main, submit the pr to branch `qa/latest` after finishing development.

## DEV

Run these bash command firstly.

```bash
$ git clone https://github.com/MuYunyun/create-react-doc
$ cd create-react-doc
$ yarn && yarn bootstrap && yarn start
```

And now you can see the document is running at http://localhost:3000.

## Test

After merging pr to qa/latest and publish beta package. You should verify the feature/bugfix with following bash:

```js
yarn add create-react-doc@beta
```
Loading

0 comments on commit 36c56ce

Please sign in to comment.