Skip to content

Commit 622b1c9

Browse files
committed
chore: standardize rc tooling and docs
1 parent 93b7216 commit 622b1c9

5 files changed

Lines changed: 79 additions & 32 deletions

File tree

‎.dumirc.ts‎

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

44
const basePath = process.env.GH_PAGES ? '/switch/' : '/';
5-
const publicPath = process.env.GH_PAGES ? '/switch/' : '/';
5+
const publicPath = basePath;
66

77
export default defineConfig({
88
alias: {

‎README.md‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,17 @@ export default () => <Switch checkedChildren="On" unCheckedChildren="Off" />;
4040

4141
Online preview: https://switch.react-component.vercel.app/
4242

43+
## Examples
44+
45+
Run the local dumi site:
46+
47+
```bash
48+
npm install
49+
npm start
50+
```
51+
52+
Then open `http://localhost:8000`.
53+
4354
## API
4455

4556
| Name | Type | Default | Description |

‎README.zh-CN.md‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,17 @@ export default () => <Switch checkedChildren="On" unCheckedChildren="Off" />;
4040

4141
在线预览:https://switch.react-component.vercel.app/
4242

43+
## 示例
44+
45+
运行本地 dumi 站点:
46+
47+
```bash
48+
npm install
49+
npm start
50+
```
51+
52+
然后打开 `http://localhost:8000`。
53+
4354
## API
4455

4556
| 名称 | 类型 | 默认值 | 说明 |

‎package.json‎

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -44,27 +44,27 @@
4444
},
4545
"devDependencies": {
4646
"@rc-component/father-plugin": "^2.2.0",
47-
"@rc-component/np": "^1.0.3",
48-
"@testing-library/react": "^16.0.1",
49-
"@types/jest": "^29.4.0",
50-
"@types/node": "^24.5.2",
51-
"@types/react": "^19.1.14",
52-
"@types/react-dom": "^19.1.9",
53-
"@umijs/fabric": "^3.0.0",
54-
"dumi": "^2.0.0",
55-
"eslint": "^8.55.0",
56-
"eslint-plugin-jest": "^27.6.0",
57-
"eslint-plugin-unicorn": "^49.0.0",
58-
"father": "^4.0.0",
59-
"gh-pages": "^6.1.0",
60-
"husky": "^8.0.1",
61-
"less": "^4.1.3",
62-
"lint-staged": "^15.1.0",
63-
"prettier": "^3.1.0",
64-
"react": "^18.0.0",
65-
"react-dom": "^18.0.0",
66-
"cross-env": "^7.0.0",
67-
"rc-test": "^7.0.15"
47+
"@rc-component/np": "^1.0.4",
48+
"@testing-library/react": "^15.0.7",
49+
"@types/jest": "^29.5.14",
50+
"@types/node": "^26.0.1",
51+
"@types/react": "^18.3.31",
52+
"@types/react-dom": "^18.3.7",
53+
"@umijs/fabric": "^4.0.1",
54+
"dumi": "^2.4.35",
55+
"eslint": "^8.57.1",
56+
"eslint-plugin-jest": "^27.9.0",
57+
"eslint-plugin-unicorn": "^56.0.1",
58+
"father": "^4.6.23",
59+
"gh-pages": "^6.3.0",
60+
"husky": "^9.1.7",
61+
"less": "^4.6.7",
62+
"lint-staged": "^16.4.0",
63+
"prettier": "^3.9.0",
64+
"react": "^18.3.1",
65+
"react-dom": "^18.3.1",
66+
"cross-env": "^10.1.0",
67+
"rc-test": "^7.1.3"
6868
},
6969
"peerDependencies": {
7070
"react": ">=16.9.0",

‎tsconfig.json‎

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,46 @@
33
"target": "esnext",
44
"moduleResolution": "node",
55
"baseUrl": "./",
6-
"lib": ["dom", "es2017"],
6+
"lib": [
7+
"dom",
8+
"es2017"
9+
],
710
"jsx": "react",
811
"declaration": true,
912
"skipLibCheck": true,
1013
"esModuleInterop": true,
1114
"paths": {
12-
"@/*": ["src/*"],
13-
"@@/*": [".dumi/tmp/*"],
14-
"@rc-component/switch": ["src/index.tsx"],
15-
"@rc-component/switch/es": ["src"],
16-
"@rc-component/switch/es/*": ["src/*"],
17-
"@rc-component/switch/assets/*": ["assets/*"]
15+
"@/*": [
16+
"src/*"
17+
],
18+
"@@/*": [
19+
".dumi/tmp/*"
20+
],
21+
"@rc-component/switch": [
22+
"src/index.tsx"
23+
],
24+
"@rc-component/switch/es": [
25+
"src"
26+
],
27+
"@rc-component/switch/es/*": [
28+
"src/*"
29+
],
30+
"@rc-component/switch/assets/*": [
31+
"assets/*"
32+
]
1833
},
19-
"strict": true
34+
"strict": true,
35+
"ignoreDeprecations": "5.0"
2036
},
21-
"include": [".dumirc.ts", "src", "tests", "docs/examples"],
22-
"exclude": ["docs-dist", "lib", "es"]
37+
"include": [
38+
".dumirc.ts",
39+
"src",
40+
"tests",
41+
"docs/examples"
42+
],
43+
"exclude": [
44+
"docs-dist",
45+
"lib",
46+
"es"
47+
]
2348
}

0 commit comments

Comments
 (0)