Skip to content

Commit

Permalink
chore: use dumi (#240)
Browse files Browse the repository at this point in the history
* chore: use dumi

* update
  • Loading branch information
ajuner authored Jan 24, 2021
1 parent 08b9c49 commit c4023f5
Show file tree
Hide file tree
Showing 20 changed files with 85 additions and 22 deletions.
18 changes: 13 additions & 5 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
# top-most EditorConfig file
# http://editorconfig.org
root = true

# Unix-style newlines with a newline ending every file
[*.{js,css}]
end_of_line = lf
insert_final_newline = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[Makefile]
indent_style = tab

6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,9 @@ es
coverage
yarn.lock
package-lock.json

# umi
.umi
.umi-production
.umi-test
.env.local
19 changes: 19 additions & 0 deletions .umirc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// more config: https://d.umijs.org/config
import { defineConfig } from 'dumi';

export default defineConfig({
title: 'rc-tooltip',
favicon:
'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4',
logo:
'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4',
outputPath: '.doc',
exportStatic: {},
styles: [
`
.markdown table {
width: auto !important;
}
`,
]
});
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ Online examples: <https://react-component.github.io/tooltip/examples/>
## Accessibility

For accessibility purpose you can use the `id` prop to link your tooltip with another element. For example attaching it to an input element:
```jsx
```js
<Tooltip
...
id={this.props.name}>
Expand Down
1 change: 1 addition & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<embed src="../CHANGELOG.md"></embed>
3 changes: 3 additions & 0 deletions docs/demo/arrowContent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## arrowContent

<code src="../examples/arrowContent.tsx">
3 changes: 3 additions & 0 deletions docs/demo/formError.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## formError

<code src="../examples/formError.tsx">
3 changes: 3 additions & 0 deletions docs/demo/onVisibleChange.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## onVisibleChange

<code src="../examples/onVisibleChange.tsx">
3 changes: 3 additions & 0 deletions docs/demo/placement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## placement

<code src="../examples/placement.tsx">
3 changes: 3 additions & 0 deletions docs/demo/simple.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## simple

<code src="../examples/simple.tsx">
4 changes: 2 additions & 2 deletions examples/arrowContent.js → docs/examples/arrowContent.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import Tooltip from '../src';
import '../assets/bootstrap_white.less';
import Tooltip from 'rc-tooltip';
import '../../assets/bootstrap_white.less';

const text = <span>Tooltip Text</span>;
const styles = {
Expand Down
4 changes: 2 additions & 2 deletions examples/formError.js → docs/examples/formError.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { Component } from 'react';
import Tooltip from '../src';
import Tooltip from 'rc-tooltip';

import '../assets/bootstrap.less';
import '../../assets/bootstrap.less';

class Test extends Component {
state = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { Component } from 'react';
import Tooltip from '../src';
import '../assets/bootstrap.less';
import Tooltip from 'rc-tooltip';
import '../../assets/bootstrap.less';

function preventDefault(e) {
e.preventDefault();
Expand Down
4 changes: 2 additions & 2 deletions examples/placement.js → docs/examples/placement.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import Tooltip from '../src';
import '../assets/bootstrap.less';
import Tooltip from 'rc-tooltip';
import '../../assets/bootstrap.less';

const text = <span>Tooltip Text</span>;
const styles = {
Expand Down
6 changes: 3 additions & 3 deletions examples/simple.js → docs/examples/simple.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { Component } from 'react';
import Tooltip from '../src';
import '../assets/bootstrap.less';
import { placements } from '../src/placements';
import Tooltip from 'rc-tooltip';
import '../../assets/bootstrap.less';
import { placements } from '../../src/placements';

class Test extends Component {
state = {
Expand Down
5 changes: 5 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: rc-tooltip
---

<embed src="../README.md"></embed>
3 changes: 3 additions & 0 deletions now.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@
"use": "@now/static-build",
"config": { "distDir": ".doc" }
}
],
"routes": [
{ "src": "/(.*)", "dest": "/dist/$1" }
]
}
12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@
"main": "lib/index",
"module": "es/index",
"scripts": {
"build": "father doc build --storybook",
"start": "dumi dev",
"docs:build": "dumi build",
"docs:deploy": "gh-pages -d .doc",
"compile": "father build && lessc assets/bootstrap.less assets/bootstrap.css && lessc assets/bootstrap_white.less assets/bootstrap_white.css",
"coverage": "father test --coverage",
"lint": "eslint src/ examples/ --ext .tsx,.ts,.jsx,.js",
"lint": "eslint src/ --ext .tsx,.ts,.jsx,.js",
"now-build": "npm run build",
"prepublishOnly": "npm run compile && np --no-cleanup --yolo --no-publish",
"start": "cross-env NODE_ENV=development father doc dev --storybook",
"test": "father test"
},
"dependencies": {
Expand All @@ -46,16 +47,19 @@
"@types/react-dom": "^16.9.2",
"@types/warning": "^3.0.0",
"cross-env": "^7.0.0",
"dumi": "^1.1.0",
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.15.1",
"enzyme-to-json": "^3.4.3",
"eslint": "^7.1.0",
"father": "^2.23.1",
"father-build": "^1.18.6",
"gh-pages": "^3.1.0",
"less": "^3.11.1",
"np": "^7.1.0",
"react": "^16.10.2",
"react-dom": "^16.10.2",
"typescript": "^4.0.3"
"typescript": "^4.0.5"
},
"maintainers": [
"[email protected]"
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"paths": {
"@/*": ["src/*"],
"@@/*": ["src/.umi/*"],
"rc-tooltip": ["src/index.ts"]
"rc-tooltip": ["src/index.tsx"]
}
}
}
2 changes: 2 additions & 0 deletions type.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
declare module '*.css';
declare module '*.less';

0 comments on commit c4023f5

Please sign in to comment.