Skip to content

Commit c4023f5

Browse files
authored
chore: use dumi (#240)
* chore: use dumi * update
1 parent 08b9c49 commit c4023f5

20 files changed

+85
-22
lines changed

Diff for: .editorconfig

+13-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
1-
# top-most EditorConfig file
1+
# http://editorconfig.org
22
root = true
33

4-
# Unix-style newlines with a newline ending every file
5-
[*.{js,css}]
6-
end_of_line = lf
7-
insert_final_newline = true
4+
[*]
85
indent_style = space
96
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.md]
13+
trim_trailing_whitespace = false
14+
15+
[Makefile]
16+
indent_style = tab
17+

Diff for: .gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,9 @@ es
3030
coverage
3131
yarn.lock
3232
package-lock.json
33+
34+
# umi
35+
.umi
36+
.umi-production
37+
.umi-test
38+
.env.local

Diff for: .umirc.ts

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// more config: https://d.umijs.org/config
2+
import { defineConfig } from 'dumi';
3+
4+
export default defineConfig({
5+
title: 'rc-tooltip',
6+
favicon:
7+
'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4',
8+
logo:
9+
'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4',
10+
outputPath: '.doc',
11+
exportStatic: {},
12+
styles: [
13+
`
14+
.markdown table {
15+
width: auto !important;
16+
}
17+
`,
18+
]
19+
});

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ Online examples: <https://react-component.github.io/tooltip/examples/>
202202
## Accessibility
203203

204204
For accessibility purpose you can use the `id` prop to link your tooltip with another element. For example attaching it to an input element:
205-
```jsx
205+
```js
206206
<Tooltip
207207
...
208208
id={this.props.name}>

Diff for: docs/changelog.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<embed src="../CHANGELOG.md"></embed>

Diff for: docs/demo/arrowContent.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## arrowContent
2+
3+
<code src="../examples/arrowContent.tsx">

Diff for: docs/demo/formError.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## formError
2+
3+
<code src="../examples/formError.tsx">

Diff for: docs/demo/onVisibleChange.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## onVisibleChange
2+
3+
<code src="../examples/onVisibleChange.tsx">

Diff for: docs/demo/placement.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## placement
2+
3+
<code src="../examples/placement.tsx">

Diff for: docs/demo/simple.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## simple
2+
3+
<code src="../examples/simple.tsx">

Diff for: examples/arrowContent.js renamed to docs/examples/arrowContent.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
2-
import Tooltip from '../src';
3-
import '../assets/bootstrap_white.less';
2+
import Tooltip from 'rc-tooltip';
3+
import '../../assets/bootstrap_white.less';
44

55
const text = <span>Tooltip Text</span>;
66
const styles = {

Diff for: examples/formError.js renamed to docs/examples/formError.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { Component } from 'react';
2-
import Tooltip from '../src';
2+
import Tooltip from 'rc-tooltip';
33

4-
import '../assets/bootstrap.less';
4+
import '../../assets/bootstrap.less';
55

66
class Test extends Component {
77
state = {

Diff for: examples/onVisibleChange.js renamed to docs/examples/onVisibleChange.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { Component } from 'react';
2-
import Tooltip from '../src';
3-
import '../assets/bootstrap.less';
2+
import Tooltip from 'rc-tooltip';
3+
import '../../assets/bootstrap.less';
44

55
function preventDefault(e) {
66
e.preventDefault();

Diff for: examples/placement.js renamed to docs/examples/placement.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
2-
import Tooltip from '../src';
3-
import '../assets/bootstrap.less';
2+
import Tooltip from 'rc-tooltip';
3+
import '../../assets/bootstrap.less';
44

55
const text = <span>Tooltip Text</span>;
66
const styles = {

Diff for: examples/simple.js renamed to docs/examples/simple.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { Component } from 'react';
2-
import Tooltip from '../src';
3-
import '../assets/bootstrap.less';
4-
import { placements } from '../src/placements';
2+
import Tooltip from 'rc-tooltip';
3+
import '../../assets/bootstrap.less';
4+
import { placements } from '../../src/placements';
55

66
class Test extends Component {
77
state = {

Diff for: docs/index.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: rc-tooltip
3+
---
4+
5+
<embed src="../README.md"></embed>

Diff for: now.json

+3
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,8 @@
77
"use": "@now/static-build",
88
"config": { "distDir": ".doc" }
99
}
10+
],
11+
"routes": [
12+
{ "src": "/(.*)", "dest": "/dist/$1" }
1013
]
1114
}

Diff for: package.json

+8-4
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,14 @@
2727
"main": "lib/index",
2828
"module": "es/index",
2929
"scripts": {
30-
"build": "father doc build --storybook",
30+
"start": "dumi dev",
31+
"docs:build": "dumi build",
32+
"docs:deploy": "gh-pages -d .doc",
3133
"compile": "father build && lessc assets/bootstrap.less assets/bootstrap.css && lessc assets/bootstrap_white.less assets/bootstrap_white.css",
3234
"coverage": "father test --coverage",
33-
"lint": "eslint src/ examples/ --ext .tsx,.ts,.jsx,.js",
35+
"lint": "eslint src/ --ext .tsx,.ts,.jsx,.js",
3436
"now-build": "npm run build",
3537
"prepublishOnly": "npm run compile && np --no-cleanup --yolo --no-publish",
36-
"start": "cross-env NODE_ENV=development father doc dev --storybook",
3738
"test": "father test"
3839
},
3940
"dependencies": {
@@ -46,16 +47,19 @@
4647
"@types/react-dom": "^16.9.2",
4748
"@types/warning": "^3.0.0",
4849
"cross-env": "^7.0.0",
50+
"dumi": "^1.1.0",
4951
"enzyme": "^3.10.0",
5052
"enzyme-adapter-react-16": "^1.15.1",
5153
"enzyme-to-json": "^3.4.3",
5254
"eslint": "^7.1.0",
5355
"father": "^2.23.1",
56+
"father-build": "^1.18.6",
57+
"gh-pages": "^3.1.0",
5458
"less": "^3.11.1",
5559
"np": "^7.1.0",
5660
"react": "^16.10.2",
5761
"react-dom": "^16.10.2",
58-
"typescript": "^4.0.3"
62+
"typescript": "^4.0.5"
5963
},
6064
"maintainers": [
6165

Diff for: tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"paths": {
1111
"@/*": ["src/*"],
1212
"@@/*": ["src/.umi/*"],
13-
"rc-tooltip": ["src/index.ts"]
13+
"rc-tooltip": ["src/index.tsx"]
1414
}
1515
}
1616
}

Diff for: type.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
declare module '*.css';
2+
declare module '*.less';

0 commit comments

Comments
 (0)