Skip to content

Commit 4abce43

Browse files
authored
refactor: upgrade project (#294)
* feat: Upgrade build deps * chore: update * test: replace enzyme with testing * chore: remove script * style: format code use prettier * test: update case ref: testing-library/react-testing-library#269 (comment) * style: update README.md * chore: update docs * chore: rname * style: foramt
1 parent fc32392 commit 4abce43

24 files changed

+333
-342
lines changed

.dumirc.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// more config: https://d.umijs.org/config
2+
import { defineConfig } from 'dumi';
3+
import path from 'path';
4+
5+
export default defineConfig({
6+
alias: {
7+
'rc-collapse$': path.resolve('src'),
8+
'rc-collapse/es': path.resolve('src'),
9+
},
10+
favicons: ['https://avatars0.githubusercontent.com/u/9441414?s=200&v=4'],
11+
themeConfig: {
12+
name: 'Collapse',
13+
logo: 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4',
14+
},
15+
outputPath: '.doc',
16+
exportStatic: {},
17+
});

.fatherrc.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

.fatherrc.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { defineConfig } from 'father';
2+
3+
export default defineConfig({
4+
plugins: ['@rc-component/father-plugin'],
5+
});

.gitignore

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ package-lock.json
3131
.storybook
3232
.doc
3333

34-
# umi
35-
.umi
36-
.umi-production
37-
.umi-test
34+
# dumi
35+
.dumi/tmp
36+
.dumi/tmp-production
37+
.dumi/tmp-test
3838
.env.local

HISTORY.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# History
2-
----
2+
3+
---
34

45
## 2.0.0 `2020-05-08`
56

README.md

Lines changed: 26 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
# rc-collapse
2-
---
32

43
rc-collapse ui component for react
54

6-
[![NPM version][npm-image]][npm-url]
7-
[![build status][github-actions-image]][github-actions-url]
8-
[![Test coverage][codecov-image]][codecov-url]
9-
[![npm download][download-image]][download-url]
5+
[![NPM version][npm-image]][npm-url] [![build status][github-actions-image]][github-actions-url] [![Test coverage][codecov-image]][codecov-url] [![npm download][download-image]][download-url]
106

117
[npm-image]: http://img.shields.io/npm/v/rc-collapse.svg?style=flat-square
128
[npm-url]: http://npmjs.org/package/rc-collapse
@@ -17,23 +13,9 @@ rc-collapse ui component for react
1713
[download-image]: https://img.shields.io/npm/dm/rc-collapse.svg?style=flat-square
1814
[download-url]: https://npmjs.org/package/rc-collapse
1915

20-
## Development
21-
22-
```
23-
npm install
24-
npm start
25-
```
26-
27-
## Example
16+
## Live Demo
2817

29-
http://localhost:8000/examples/
30-
31-
online example: http://react-component.github.io/collapse/
32-
33-
34-
## Features
35-
36-
* support ie8,ie8+,chrome,firefox,safari
18+
http://react-component.github.io/collapse/
3719

3820
## Install
3921

@@ -48,20 +30,24 @@ var React = require('react');
4830
var ReactDOM = require('react-dom');
4931
require('rc-collapse/assets/index.css');
5032

51-
var collapse = (
33+
var App = (
5234
<Collapse accordion={true}>
53-
<Panel header="hello" headerClass="my-header-class">this is panel content</Panel>
35+
<Panel header="hello" headerClass="my-header-class">
36+
this is panel content
37+
</Panel>
5438
<Panel header="title2">this is panel content2 or other</Panel>
5539
</Collapse>
5640
);
57-
ReactDOM.render(collapse, container);
41+
ReactDOM.render(App, container);
5842
```
5943

60-
## API
44+
## Features
45+
46+
- support ie8,ie8+,chrome,firefox,safari
6147

62-
### Collapse
48+
## API
6349

64-
#### props:
50+
### Collapse props
6551

6652
<table class="table table-bordered table-striped">
6753
<thead>
@@ -124,15 +110,11 @@ ReactDOM.render(collapse, container);
124110
</tbody>
125111
</table>
126112

127-
If `accordion` is null or false, every panel can open. Opening another panel will not close any of the other panels.
128-
`activeKey` should be an string, if passing an array (the first item in the array will be used).
129-
130-
If `accordion` is true, only one panel can be open. Opening another panel will cause the previously opened panel to close.
131-
`activeKey` should be an string, if passing an array (the first item in the array will be used).
113+
If `accordion` is null or false, every panel can open. Opening another panel will not close any of the other panels. `activeKey` should be an string, if passing an array (the first item in the array will be used).
132114

133-
### Collapse.Panel
115+
If `accordion` is true, only one panel can be open. Opening another panel will cause the previously opened panel to close. `activeKey` should be an string, if passing an array (the first item in the array will be used).
134116

135-
#### props
117+
### Collapse.Panel props
136118

137119
<table class="table table-bordered table-striped">
138120
<thead>
@@ -207,20 +189,24 @@ If `accordion` is true, only one panel can be open. Opening another panel will
207189

208190
If `key` is not provided, the panel's index will be used instead.
209191

210-
## Test Case
192+
## Development
211193

194+
```bash
195+
npm install
196+
npm start
212197
```
198+
199+
## Test Case
200+
201+
```bash
213202
npm test
214-
npm run chrome-test
215203
```
216204

217205
## Coverage
218206

207+
```bash
208+
npm test -- --coverage
219209
```
220-
npm run coverage
221-
```
222-
223-
open coverage/ dir
224210

225211
## License
226212

docs/demo/custom-icon.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
1-
## custom-icon
2-
<code src="../examples/custom-icon.tsx">
1+
---
2+
title: custom-icon
3+
nav:
4+
title: Demo
5+
path: /demo
6+
---
7+
8+
<code src="../examples/custom-icon.tsx"></code>

docs/demo/fragment.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
1-
## fragment
2-
<code src="../examples/fragment.tsx">
1+
---
2+
title: fragment
3+
nav:
4+
title: Demo
5+
path: /demo
6+
---
7+
8+
<code src="../examples/fragment.tsx"></code>

docs/demo/simple.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
1-
## simple
2-
<code src="../examples/simple.tsx">
1+
---
2+
title: simple
3+
nav:
4+
title: Demo
5+
path: /demo
6+
---
7+
8+
<code src="../examples/simple.tsx"></code>

docs/examples/_util/motionUtil.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CSSMotionProps, MotionEventHandler, MotionEndEventHandler } from 'rc-motion';
1+
import type { CSSMotionProps, MotionEventHandler, MotionEndEventHandler } from 'rc-motion';
22

33
const getCollapsedHeight: MotionEventHandler = () => ({ height: 0, opacity: 0 });
44
const getRealHeight: MotionEventHandler = (node) => ({ height: node.scrollHeight, opacity: 1 });

0 commit comments

Comments
 (0)