Skip to content

Commit 7c64b9c

Browse files
committed
chore: standardize rc tooling and docs
1 parent fc3d5f4 commit 7c64b9c

6 files changed

Lines changed: 62 additions & 37 deletions

File tree

.dumirc.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
import { defineConfig } from 'dumi';
22

3+
const basePath = process.env.GH_PAGES ? '/input-number/' : '/';
4+
const publicPath = basePath;
5+
36
export default defineConfig({
4-
favicons: [
5-
'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4',
6-
],
7+
favicons: ['https://avatars0.githubusercontent.com/u/9441414?s=200&v=4'],
78
themeConfig: {
89
name: 'InputNumber',
9-
logo: 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4'
10+
logo: 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4',
1011
},
1112
outputPath: 'docs-dist',
13+
base: basePath,
14+
publicPath,
1215
exportStatic: {},
13-
styles: [`body .dumi-default-header-left { width: 230px; } body .dumi-default-hero-title { font-size: 100px; }`],
16+
styles: [
17+
`body .dumi-default-header-left { width: 230px; } body .dumi-default-hero-title { font-size: 100px; }`,
18+
],
1419
});

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ export default () => (
5050

5151
## Examples
5252

53-
Run the examples locally:
53+
Run the local dumi site:
5454

5555
```bash
5656
npm install
5757
npm start
5858
```
5959

60-
Online preview: https://input-number.vercel.app/
60+
Then open `http://localhost:8000`.
6161

6262
## API
6363

README.zh-CN.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ export default () => (
5050

5151
## 示例
5252

53-
本地运行示例
53+
运行本地 dumi 站点
5454

5555
```bash
5656
npm install
5757
npm start
5858
```
5959

60-
在线预览:https://input-number.vercel.app/
60+
然后打开 `http://localhost:8000`
6161

6262
## API
6363

package.json

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -52,31 +52,31 @@
5252
},
5353
"devDependencies": {
5454
"@rc-component/father-plugin": "^2.2.0",
55-
"@rc-component/np": "^1.0.3",
55+
"@rc-component/np": "^1.0.4",
5656
"@swc-node/jest": "^1.5.5",
57-
"@testing-library/jest-dom": "^6.1.5",
58-
"@testing-library/react": "^16.0.0",
59-
"@types/jest": "^29.2.4",
60-
"@types/node": "^24.5.2",
61-
"@types/react": "^18.0.26",
62-
"@types/react-dom": "^18.0.9",
57+
"@testing-library/jest-dom": "^6.9.1",
58+
"@testing-library/react": "^15.0.7",
59+
"@types/jest": "^29.5.14",
60+
"@types/node": "^26.0.1",
61+
"@types/react": "^18.3.31",
62+
"@types/react-dom": "^18.3.7",
6363
"@types/responselike": "^1.0.0",
6464
"@umijs/fabric": "^4.0.1",
65-
"@umijs/test": "^4.0.36",
66-
"dumi": "^2.0.13",
67-
"eslint": "^8.54.0",
68-
"father": "^4.5.5",
69-
"glob": "^11.0.0",
65+
"@umijs/test": "^4.6.68",
66+
"dumi": "^2.4.35",
67+
"eslint": "^8.57.1",
68+
"father": "^4.6.23",
69+
"glob": "^13.0.6",
7070
"husky": "^9.1.7",
71-
"jest-environment-jsdom": "^29.3.1",
72-
"less": "^4.1.3",
73-
"lint-staged": "^15.1.0",
74-
"rc-test": "^7.0.14",
75-
"react": "^18.2.0",
76-
"react-dom": "^18.2.0",
71+
"jest-environment-jsdom": "^29.7.0",
72+
"less": "^4.6.7",
73+
"lint-staged": "^16.4.0",
74+
"rc-test": "^7.1.3",
75+
"react": "^18.3.1",
76+
"react-dom": "^18.3.1",
7777
"regenerator-runtime": "^0.14.1",
7878
"ts-node": "^10.9.1",
79-
"typescript": "^5.1.6"
79+
"typescript": "^5.9.3"
8080
},
8181
"peerDependencies": {
8282
"react": ">=16.9.0",

tests/util/wrapper.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { RenderOptions } from '@testing-library/react';
1+
import type { RenderOptions, RenderResult } from '@testing-library/react';
22
import { act, render } from '@testing-library/react';
33
import type { ReactElement } from 'react';
44

@@ -12,8 +12,10 @@ export const sleep = async (timeout = 0) => {
1212
});
1313
};
1414

15-
const customRender = (ui: ReactElement, options?: Omit<RenderOptions, 'wrapper'>) =>
16-
render(ui, { ...options });
15+
const customRender = (
16+
ui: ReactElement,
17+
options?: Omit<RenderOptions, 'wrapper'>,
18+
): RenderResult => render(ui, { ...options });
1719

1820
export * from '@testing-library/react';
1921
export { customRender as render };

tsconfig.json

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,29 @@
88
"skipLibCheck": true,
99
"esModuleInterop": true,
1010
"paths": {
11-
"@/*": ["src/*"],
12-
"@@/*": ["src/.umi/*"],
13-
"@rc-component/input-number": ["src/index.ts"]
14-
}
11+
"@/*": [
12+
"src/*"
13+
],
14+
"@@/*": [
15+
"src/.umi/*"
16+
],
17+
"@rc-component/input-number": [
18+
"src/index.ts"
19+
]
20+
},
21+
"ignoreDeprecations": "5.0"
1522
},
16-
"include": [".dumirc.ts", "**/*.ts", "**/*.tsx"],
17-
"exclude": ["node_modules", "lib", "es", "dist", "docs-dist", ".dumi/tmp"]
23+
"include": [
24+
".dumirc.ts",
25+
"**/*.ts",
26+
"**/*.tsx"
27+
],
28+
"exclude": [
29+
"node_modules",
30+
"lib",
31+
"es",
32+
"dist",
33+
"docs-dist",
34+
".dumi/tmp"
35+
]
1836
}

0 commit comments

Comments
 (0)