Skip to content

Commit b02ee2f

Browse files
authored
refactor: upgrade project (#411)
* chore(deps): bump `father@4.1.3` * chore(deps): add `@rc-component/father-plugin` * chore: update config * chore(deps): bump `@umijs/fabric@3.x` * chore(deps): remove local eslint ref: umijs/fabric#136 * chore: add eslint eq @umijs/fabric * chore: add rc-test remove coveralls * ci: update config * remove jest config * remove deps * test: update test 这里的用例遇到点问题,需要进一步确定 * chore: lock version * chore: update script * update dumi@2.x * ci: add site-deploy workflow * docs: update * remove unused
1 parent 12a535a commit b02ee2f

25 files changed

+145
-78
lines changed

.dumirc.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// more config: https://d.umijs.org/config
2+
import { defineConfig } from 'dumi';
3+
4+
const basePath = process.env.GITHUB_ACTIONS ? '/util/' : '/';
5+
const publicPath = process.env.GITHUB_ACTIONS ? '/util/' : '/';
6+
7+
export default defineConfig({
8+
favicons: ['https://avatars0.githubusercontent.com/u/9441414?s=200&v=4'],
9+
themeConfig: {
10+
name: 'Util',
11+
logo: 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4',
12+
},
13+
outputPath: '.doc',
14+
exportStatic: {},
15+
base: basePath,
16+
publicPath,
17+
});

.eslintrc.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
const config = {
1+
module.exports = {
22
extends: [require.resolve('@umijs/fabric/dist/eslint')],
33
rules: {
44
'react/no-did-update-set-state': 0,
55
'react/no-find-dom-node': 0,
66
'import/no-extraneous-dependencies': 0,
7-
'react/sort-comp': 0,
87
},
98
};
10-
11-
module.exports = config;

.fatherrc.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

.fatherrc.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { defineConfig } from 'father';
2+
3+
export default defineConfig({
4+
// Locked version only supports 1.0.0
5+
plugins: ['@rc-component/father-plugin'],
6+
});

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

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ jobs:
4646

4747
lint:
4848
runs-on: ubuntu-latest
49+
needs: setup
4950
steps:
5051
- name: checkout
5152
uses: actions/checkout@master
@@ -64,11 +65,10 @@ jobs:
6465

6566
- name: lint
6667
run: npm run lint
67-
68-
needs: setup
6968

7069
compile:
7170
runs-on: ubuntu-latest
71+
needs: setup
7272
steps:
7373
- name: checkout
7474
uses: actions/checkout@master
@@ -87,11 +87,10 @@ jobs:
8787

8888
- name: compile
8989
run: npm run compile
90-
91-
needs: setup
9290

9391
coverage:
9492
runs-on: ubuntu-latest
93+
needs: setup
9594
steps:
9695
- name: checkout
9796
uses: actions/checkout@master
@@ -109,6 +108,4 @@ jobs:
109108
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
110109

111110
- name: coverage
112-
run: npm test -- --coverage && bash <(curl -s https://codecov.io/bash)
113-
114-
needs: setup
111+
run: npm run coverage && bash <(curl -s https://codecov.io/bash)

.github/workflows/site-deploy.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Deploy website
2+
on:
3+
push:
4+
tags:
5+
- '*'
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
build-and-deploy:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: checkout
16+
uses: actions/checkout@v3
17+
18+
- name: setup node
19+
uses: actions/setup-node@v1
20+
with:
21+
node-version: 14
22+
23+
- name: create package-lock.json
24+
run: npm i --package-lock-only --ignore-scripts
25+
26+
- name: Install dependencies
27+
run: npm ci
28+
29+
- name: build Docs
30+
run: npm run build
31+
32+
- name: Deploy to GitHub Pages
33+
uses: peaceiris/actions-gh-pages@v3
34+
with:
35+
github_token: ${{ secrets.GITHUB_TOKEN }}
36+
publish_dir: ./.doc
37+
force_orphan: true
38+
user_name: 'github-actions[bot]'
39+
user_email: 'github-actions[bot]@users.noreply.github.com'

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,8 @@ package-lock.json
3333
.umi
3434
.umi-production
3535
.umi-test
36-
.env.local
36+
.env.local
37+
38+
.dumi/tmp
39+
.dumi/tmp-test
40+
.dumi/tmp-production

.umirc.ts

Lines changed: 0 additions & 20 deletions
This file was deleted.

docs/demo/dynaymicCSS.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
1-
## dynaymicCSS
2-
<code src="../examples/dynaymicCSS.tsx">
1+
---
2+
title: dynaymicCSS
3+
nav:
4+
title: Demo
5+
path: /demo
6+
---
7+
8+
<code src="../examples/dynaymicCSS.tsx" iframe></code>

docs/demo/getScrollBarSize.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
1-
## getScrollBarSize
2-
<code src="../examples/getScrollBarSize.tsx">
1+
---
2+
title: getScrollBarSize
3+
nav:
4+
title: Demo
5+
path: /demo
6+
---
7+
8+
<code src="../examples/getScrollBarSize.tsx"></code>

0 commit comments

Comments
 (0)