Skip to content

Commit 8650838

Browse files
committed
chore: standardize repository tooling
1 parent 08a9beb commit 8650838

7 files changed

Lines changed: 242 additions & 131 deletions

File tree

.github/workflows/react-component-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ name: ✅ test
22
on: [push, pull_request]
33
jobs:
44
test:
5-
uses: react-component/rc-test/.github/workflows/test.yml@main
5+
uses: react-component/rc-test/.github/workflows/test-utoo.yml@main
66
secrets: inherit

.github/workflows/react-doctor.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: React Doctor
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [master]
7+
8+
permissions:
9+
contents: read
10+
pull-requests: write
11+
issues: write
12+
statuses: write
13+
14+
jobs:
15+
react-doctor:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v5
19+
with:
20+
fetch-depth: 0
21+
- uses: millionco/react-doctor@v2
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Surge Preview
2+
3+
on:
4+
pull_request:
5+
6+
permissions:
7+
contents: read
8+
pull-requests: write
9+
checks: write
10+
11+
jobs:
12+
preview:
13+
runs-on: ubuntu-latest
14+
env:
15+
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
16+
steps:
17+
- uses: actions/checkout@v5
18+
- uses: afc163/surge-preview@v1
19+
if: ${{ env.SURGE_TOKEN != '' }}
20+
with:
21+
surge_token: ${{ env.SURGE_TOKEN }}
22+
github_token: ${{ secrets.GITHUB_TOKEN }}
23+
dist: dist
24+
failOnError: true
25+
setCommitStatus: true
26+
build: |
27+
npm install
28+
npm run build
29+
- name: Skip Surge preview
30+
if: ${{ env.SURGE_TOKEN == '' }}
31+
run: echo "SURGE_TOKEN is not configured; skip Surge preview."

README.md

Lines changed: 177 additions & 125 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@
3535
"now-build": "npm run build",
3636
"prepare": "husky && dumi setup",
3737
"prepublishOnly": "npm run compile && rc-np",
38-
"prettier": "prettier '{src,tests}/**/*.{ts,tsx}' 'tests/**/*.js' --write",
38+
"prettier": "prettier --write --ignore-unknown .",
3939
"start": "dumi dev",
40-
"test": "rc-test"
40+
"test": "rc-test",
41+
"tsc": "tsc --noEmit"
4142
},
4243
"lint-staged": {
4344
"*": "prettier --write --ignore-unknown"
@@ -61,11 +62,13 @@
6162
"@types/react": "^18.3.11",
6263
"@types/react-dom": "^18.0.0",
6364
"@types/warning": "^3.0.3",
65+
"@typescript-eslint/eslint-plugin": "^5.62.0",
66+
"@typescript-eslint/parser": "^5.62.0",
6467
"@umijs/fabric": "^4.0.1",
6568
"cross-env": "^7.0.3",
6669
"dumi": "^2.4.12",
6770
"eslint": "^8.57.1",
68-
"eslint-plugin-jest": "^28.10.0",
71+
"eslint-plugin-jest": "^27.9.0",
6972
"eslint-plugin-unicorn": "^56.0.0",
7073
"father": "^4.5.0",
7174
"glob": "^11.0.0",

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
"@@/*": [".dumi/tmp/*"],
1313
"@rc-component/tree-select": ["src/index.tsx"]
1414
}
15-
}
15+
},
16+
"include": [".dumirc.ts", ".fatherrc.ts", "src", "tests", "examples"]
1617
}

vercel.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
{
2-
"framework": "umijs"
2+
"framework": "umijs",
3+
"installCommand": "npm install",
4+
"buildCommand": "npm run build",
5+
"outputDirectory": "dist"
36
}

0 commit comments

Comments
 (0)