diff --git a/.gitignore b/.gitignore
index 971b25d..318cde2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -29,3 +29,8 @@ yarn.lock
package-lock.json
coverage/
.doc
+# umi
+.umi
+.umi-production
+.umi-test
+.env.local
diff --git a/.umirc.ts b/.umirc.ts
new file mode 100644
index 0000000..07a646c
--- /dev/null
+++ b/.umirc.ts
@@ -0,0 +1,21 @@
+// more config: https://d.umijs.org/config
+import { defineConfig } from 'dumi';
+
+const name = 'textarea';
+
+export default defineConfig({
+ title: 'rc-textarea',
+ 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: {},
+ base: `/${name}/`,
+ publicPath: `/${name}/`,
+ styles: [
+ `
+ .markdown table {
+ width: auto !important;
+ }
+ `,
+ ],
+});
diff --git a/HISTORY.md b/CHANGELOG.md
similarity index 100%
rename from HISTORY.md
rename to CHANGELOG.md
diff --git a/README.md b/README.md
index d844907..21e1a13 100644
--- a/README.md
+++ b/README.md
@@ -1,12 +1,6 @@
# rc-textarea
-[![NPM version][npm-image]][npm-url]
-[![npm download][download-image]][download-url]
-[![build status][github-actions-image]][github-actions-url]
-[![Codecov][codecov-image]][codecov-url]
-[![Dependencies][david-image]](david-url)
-[![DevDependencies][david-dev-image]][david-dev-url]
-[![bundle size][bundlephobia-image]][bundlephobia-url]
+[![NPM version][npm-image]][npm-url] [](https://github.com/umijs/dumi) [![npm download][download-image]][download-url] [![build status][github-actions-image]][github-actions-url] [![Codecov][codecov-image]][codecov-url] [![Dependencies][david-image]](david-url) [![DevDependencies][david-dev-image]][david-dev-url] [![bundle size][bundlephobia-image]][bundlephobia-url]
[npm-image]: http://img.shields.io/npm/v/rc-textarea.svg?style=flat-square
[npm-url]: http://npmjs.org/package/rc-textarea
diff --git a/docs/demo/autoSize.md b/docs/demo/autoSize.md
new file mode 100644
index 0000000..a2dfa90
--- /dev/null
+++ b/docs/demo/autoSize.md
@@ -0,0 +1,3 @@
+## autoSize
+
+
diff --git a/docs/demo/simple.md b/docs/demo/simple.md
new file mode 100644
index 0000000..34a6d23
--- /dev/null
+++ b/docs/demo/simple.md
@@ -0,0 +1,3 @@
+## simple
+
+
diff --git a/examples/autoSize.js b/docs/examples/autoSize.jsx
similarity index 95%
rename from examples/autoSize.js
rename to docs/examples/autoSize.jsx
index f3c906b..814de0e 100644
--- a/examples/autoSize.js
+++ b/docs/examples/autoSize.jsx
@@ -1,6 +1,6 @@
/* eslint-disable no-console */
import React, { useState } from 'react';
-import Textarea from '../src/index';
+import Textarea from 'rc-textarea';
export default function App() {
const [value, setValue] = useState('hello\nworld');
diff --git a/examples/simple.js b/docs/examples/simple.jsx
similarity index 95%
rename from examples/simple.js
rename to docs/examples/simple.jsx
index 50c5eae..29d5cd7 100644
--- a/examples/simple.js
+++ b/docs/examples/simple.jsx
@@ -1,6 +1,6 @@
/* eslint-disable no-console */
import React, { useState } from 'react';
-import Textarea from '../src/index';
+import Textarea from 'rc-textarea';
export default function App() {
const [value, setValue] = useState('');
diff --git a/docs/index.md b/docs/index.md
new file mode 100644
index 0000000..56fc654
--- /dev/null
+++ b/docs/index.md
@@ -0,0 +1,5 @@
+---
+title: rc-textarea
+---
+
+
diff --git a/index.js b/index.js
deleted file mode 100644
index fd4d7e5..0000000
--- a/index.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./src/');
diff --git a/package.json b/package.json
index bfacde8..db27bdc 100644
--- a/package.json
+++ b/package.json
@@ -29,10 +29,11 @@
},
"license": "MIT",
"scripts": {
- "start": "cross-env NODE_ENV=development father doc dev --storybook",
- "build": "father doc build --storybook",
+ "start": "dumi dev",
+ "docs:build": "dumi build",
+ "docs:deploy": "gh-pages -d .doc",
"compile": "father build && lessc assets/index.less assets/index.css",
- "gh-pages": "npm run build && father doc deploy",
+ "gh-pages": "npm run docs:build && npm run docs:deploy",
"prepublishOnly": "npm run compile && np --yolo --no-publish && npm run gh-pages",
"lint": "eslint src/ --ext .ts,.tsx,.jsx,.js,.md",
"prettier": "prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"",
@@ -53,11 +54,13 @@
"@umijs/fabric": "^2.0.8",
"coveralls": "^3.0.6",
"cross-env": "^7.0.2",
+ "dumi": "^1.1.0",
"enzyme": "^3.0.0",
"enzyme-adapter-react-16": "^1.0.1",
"enzyme-to-json": "^3.4.0",
"eslint": "^7.0.0",
"father": "^2.13.4",
+ "gh-pages": "^3.1.0",
"husky": "^4.2.5",
"less": "^3.10.3",
"np": "^5.1.0",
diff --git a/tests/index.spec.js b/tests/index.spec.js
index caba8dc..5e1daa4 100644
--- a/tests/index.spec.js
+++ b/tests/index.spec.js
@@ -1,6 +1,6 @@
import React from 'react';
import { mount } from 'enzyme';
-import TextArea from '../index';
+import TextArea from '../src';
import { focusTest, sleep } from './utils';
import calculateNodeHeight, {
calculateNodeStyling,
diff --git a/tsconfig.json b/tsconfig.json
index bba2297..4da5e9f 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -6,6 +6,11 @@
"jsx": "preserve",
"declaration": true,
"skipLibCheck": true,
- "esModuleInterop": true
+ "esModuleInterop": true,
+ "paths": {
+ "@/*": ["src/*"],
+ "@@/*": ["src/.umi/*"],
+ "rc-textarea": ["src/index.tsx"]
+ }
}
-}
\ No newline at end of file
+}