Skip to content

Commit 5167828

Browse files
authored
chore: migrate to dumi 2 & father 4 (#280)
* docs: use dumi * docs: use dumi * chore: adjust * test: mig test * test: all test case
1 parent a39fc5a commit 5167828

File tree

19 files changed

+153
-85
lines changed

19 files changed

+153
-85
lines changed

.dumirc.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { defineConfig } from 'dumi';
2+
3+
export default defineConfig({
4+
themeConfig: {
5+
name: 'Align',
6+
},
7+
mfsu: false,
8+
});

.fatherrc.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
export default {
2-
cjs: 'babel',
3-
esm: { type: 'babel', importLibToEs: true },
4-
preCommit: {
5-
eslint: true,
6-
prettier: true,
7-
},
8-
runtimeHelpers: true,
9-
};
1+
import { defineConfig } from 'father';
2+
3+
export default defineConfig({
4+
plugins: ['@rc-component/father-plugin'],
5+
});

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,4 @@ es
2929
coverage
3030
package-lock.json
3131
yarn.lock
32+
.dumi

docs/demo/follow.md

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

docs/demo/point.md

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

docs/demo/simple.md

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

examples/follow.tsx renamed to docs/examples/follow.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import Align from '../src';
2+
import Align from '../../src';
33

44
const Demo = () => {
55
const [width, setWidth] = React.useState(100);
@@ -51,7 +51,6 @@ const Demo = () => {
5151
<div
5252
style={{
5353
border: '1px solid red',
54-
width: '90vw',
5554
height: '50vh',
5655
position: 'relative',
5756
}}

examples/point.js renamed to docs/examples/point.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { Component } from 'react';
2-
import Align from '../src';
2+
import Align from '../../src';
33

44
const align = {
55
points: ['cc', 'cc'],

examples/simple.js renamed to docs/examples/simple.tsx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
1+
import Align, { type RefAlign } from 'rc-align';
12
import React, { Component } from 'react';
2-
import Align from '../src';
33

44
const allPoints = ['tl', 'tc', 'tr', 'cl', 'cc', 'cr', 'bl', 'bc', 'br'];
55

6-
class Test extends Component {
6+
interface TestState {
7+
monitor: boolean;
8+
random: boolean;
9+
disabled: boolean;
10+
randomWidth: number;
11+
align: any;
12+
sourceWidth: number;
13+
}
14+
15+
class Test extends Component<{}, TestState> {
716
state = {
817
monitor: true,
918
random: false,
@@ -15,6 +24,10 @@ class Test extends Component {
1524
sourceWidth: 50,
1625
};
1726

27+
id: NodeJS.Timer;
28+
$container: HTMLElement;
29+
$align: RefAlign;
30+
1831
componentDidMount() {
1932
this.id = setInterval(() => {
2033
const { random } = this.state;

docs/index.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
hero:
3+
title: rc-align
4+
description: align ui component for react
5+
---
6+
7+
<embed src="../README.md"></embed>

0 commit comments

Comments
 (0)