Skip to content

Commit 32db381

Browse files
committed
chore: standardize rc tooling and docs
1 parent 633e7d7 commit 32db381

8 files changed

Lines changed: 48 additions & 33 deletions

File tree

.dumirc.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@ import os from 'node:os';
22
import { defineConfig } from 'dumi';
33
import path from 'path';
44

5+
const basePath = process.env.GH_PAGES ? '/dialog/' : '/';
6+
const publicPath = basePath;
7+
58
export default defineConfig({
9+
outputPath: 'docs-dist',
10+
base: basePath,
11+
publicPath,
612
alias: {
713
'rc-dialog$': path.resolve('src'),
814
'rc-dialog/es': path.resolve('src'),
@@ -13,4 +19,4 @@ export default defineConfig({
1319
logo: 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4',
1420
},
1521
mako: ['Darwin', 'Linux'].includes(os.type()) ? {} : false,
16-
});;
22+
});

.github/workflows/surge-preview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
with:
3535
surge_token: ${{ env.SURGE_TOKEN }}
3636
github_token: ${{ secrets.GITHUB_TOKEN }}
37-
dist: dist
37+
dist: docs-dist
3838
failOnError: false
3939
setCommitStatus: false
4040
- name: Skip Surge preview

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,15 @@ export default function App() {
5656

5757
## Examples
5858

59+
Run the local dumi site:
60+
5961
```bash
6062
npm install
6163
npm start
6264
```
6365

6466
Then open `http://localhost:8000`.
6567

66-
Online demo: https://dialog.react-component.vercel.app/
67-
6868
## API
6969

7070
| Property | Description | Type | Default |

README.zh-CN.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,15 @@ export default function App() {
5656

5757
## 示例
5858

59+
运行本地 dumi 站点:
60+
5961
```bash
6062
npm install
6163
npm start
6264
```
6365

6466
然后打开 `http://localhost:8000`
6567

66-
在线演示: https://dialog.react-component.vercel.app/
67-
6868
## API
6969

7070
| 参数 | 说明 | 类型 | 默认值 |

docs/examples/draggable.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ import Draggable from 'react-draggable';
44
import Dialog from '@rc-component/dialog';
55
import '../../assets/index.less';
66

7+
const DemoDraggable = Draggable as React.ComponentType<
8+
React.PropsWithChildren<{ disabled?: boolean }>
9+
>;
10+
711
const MyControl: React.FC = () => {
812
const [visible, setVisible] = React.useState(false);
913
const [disabled, setDisabled] = React.useState(true);
@@ -46,7 +50,7 @@ const MyControl: React.FC = () => {
4650
modal
4751
</div>
4852
}
49-
modalRender={(modal) => <Draggable disabled={disabled}>{modal}</Draggable>}
53+
modalRender={(modal) => <DemoDraggable disabled={disabled}>{modal}</DemoDraggable>}
5054
>
5155
<div style={{ height: 200 }}>
5256
Day before yesterday I saw a rabbit, and yesterday a deer, and today, you.

package.json

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"coverage": "rc-test --coverage",
3333
"deploy": "npm run docs:build && npm run docs:deploy",
3434
"docs:build": "dumi build",
35-
"docs:deploy": "gh-pages -d dist",
35+
"docs:deploy": "gh-pages -d docs-dist",
3636
"lint": "eslint src/ --ext .ts,.tsx,.jsx,.js,.md",
3737
"lint:tsc": "tsc -p tsconfig.json --noEmit",
3838
"prepare": "husky",
@@ -55,32 +55,32 @@
5555
},
5656
"devDependencies": {
5757
"@rc-component/drawer": "^1.0.0",
58-
"@rc-component/father-plugin": "^2.0.2",
59-
"@rc-component/np": "^1.0.3",
58+
"@rc-component/father-plugin": "^2.2.0",
59+
"@rc-component/np": "^1.0.4",
6060
"@rc-component/select": "^1.0.0",
61-
"@testing-library/jest-dom": "^6.1.6",
62-
"@testing-library/react": "^16.3.0",
63-
"@types/jest": "^30.0.0",
61+
"@testing-library/jest-dom": "^6.9.1",
62+
"@testing-library/react": "^15.0.7",
63+
"@types/jest": "^29.5.14",
6464
"@types/keyv": "3.1.4",
65-
"@types/node": "^24.0.8",
66-
"@types/react": "^19.1.4",
67-
"@types/react-dom": "^19.1.5",
68-
"@umijs/fabric": "^4.0.0",
65+
"@types/node": "^26.0.1",
66+
"@types/react": "^18.3.31",
67+
"@types/react-dom": "^18.3.7",
68+
"@umijs/fabric": "^4.0.1",
6969
"bootstrap": "^5.3.7",
70-
"dumi": "^2.1.3",
71-
"eslint": "8.x",
72-
"father": "^4.1.5",
73-
"gh-pages": "^6.1.1",
74-
"glob": "^11.0.0",
75-
"husky": "^9.1.6",
76-
"less": "^4.1.3",
77-
"lint-staged": "^16.1.2",
78-
"prettier": "^3.2.1",
79-
"rc-test": "^7.0.14",
80-
"react": "^18.0.0",
81-
"react-dom": "^18.0.0",
70+
"dumi": "^2.4.35",
71+
"eslint": "^8.57.1",
72+
"father": "^4.6.23",
73+
"gh-pages": "^6.3.0",
74+
"glob": "^13.0.6",
75+
"husky": "^9.1.7",
76+
"less": "^4.6.7",
77+
"lint-staged": "^16.4.0",
78+
"prettier": "^3.9.0",
79+
"rc-test": "^7.1.3",
80+
"react": "^18.3.1",
81+
"react-dom": "^18.3.1",
8282
"react-draggable": "^4.4.3",
83-
"typescript": "^5.4.3"
83+
"typescript": "^5.9.3"
8484
},
8585
"peerDependencies": {
8686
"react": ">=18.0.0",

tsconfig.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@
1818
"src/index.ts"
1919
]
2020
},
21-
"types": ["node", "jest", "@testing-library/jest-dom"],
21+
"types": [
22+
"node",
23+
"jest",
24+
"@testing-library/jest-dom"
25+
],
26+
"ignoreDeprecations": "5.0"
2227
},
2328
"include": [
2429
".dumirc.ts",
@@ -27,4 +32,4 @@
2732
"./docs/**/*.tsx",
2833
"./tests/**/*.tsx"
2934
]
30-
}
35+
}

vercel.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"framework": "umijs",
33
"installCommand": "npm install",
44
"buildCommand": "npm run build",
5-
"outputDirectory": "dist"
5+
"outputDirectory": "docs-dist"
66
}

0 commit comments

Comments
 (0)