Skip to content

Commit 2d1d48e

Browse files
authored
Merge 002c5ef into 921ef04
2 parents 921ef04 + 002c5ef commit 2d1d48e

File tree

14 files changed

+70
-47
lines changed

14 files changed

+70
-47
lines changed

.dumirc.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { defineConfig } from 'dumi';
2+
3+
export default defineConfig({
4+
favicons: ['https://avatars0.githubusercontent.com/u/9441414?s=200&v=4'],
5+
themeConfig: {
6+
name: 'resize-observer',
7+
logo: 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4',
8+
},
9+
exportStatic: {},
10+
outputPath: '.doc',
11+
base: '/resize-observer/',
12+
publicPath: '/resize-observer/',
13+
styles: [
14+
`
15+
section.dumi-default-header-left {
16+
width: 230px;
17+
}
18+
.markdown table {
19+
width: auto !important;
20+
}
21+
`,
22+
],
23+
});

.github/workflows/react-component-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515

1616
- uses: actions/setup-node@v1
1717
with:
18-
node-version: '16'
18+
node-version: '18'
1919

2020
- name: cache package-lock.json
2121
uses: actions/cache@v2
@@ -24,7 +24,7 @@ jobs:
2424
key: lock-${{ github.sha }}
2525

2626
- name: create package-lock.json
27-
run: npm i --package-lock-only
27+
run: npm i --package-lock-only --ignore-scripts
2828

2929
- name: hack for singe file
3030
run: |

.gitignore

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
.storybook
21
*.iml
32
*.log
43
.idea/
@@ -29,8 +28,8 @@ yarn.lock
2928
package-lock.json
3029
coverage/
3130
.doc
32-
# umi
33-
.umi
34-
.umi-production
35-
.umi-test
31+
# dumi
32+
.dumi/tmp
33+
.dumi/tmp-test
34+
.dumi/tmp-production
3635
.env.local

.prettierignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
.storybook
21
node_modules
32
lib
43
es
@@ -8,5 +7,4 @@ package-lock.json
87
public
98
.site
109
_site
11-
.umi
1210
.doc

.umirc.gh.ts

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

.umirc.ts

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

docs/demo/basic.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1-
## Basic
1+
---
2+
title: basic
3+
nav:
4+
title: Demo
5+
path: /demo
6+
---
27

3-
<code src="../../examples/basic.tsx">
8+
<code src="../../examples/basic.tsx"></code>

docs/demo/collection.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
## Collection
1+
---
2+
title: Collection
3+
nav:
4+
title: Demo
5+
path: /demo
6+
---
27

38
Use `ResizeObserver.Collection` to collect multiple `ResizeObserver` resize event within frame.
49

5-
<code src="../../examples/collection.tsx">
10+
<code src="../../examples/collection.tsx"></code>

docs/demo/debug.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1-
## debug
1+
---
2+
title: debug
3+
nav:
4+
title: Demo
5+
path: /demo
6+
---
27

3-
<code src="../../examples/debug.tsx">
8+
<code src="../../examples/debug.tsx"></code>

docs/demo/renderProps.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1-
## renderProps
1+
---
2+
title: renderProps
3+
nav:
4+
title: Demo
5+
path: /demo
6+
---
27

3-
<code src="../../examples/renderProps.tsx">
8+
<code src="../../examples/renderProps.tsx"></code>

docs/index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
---
2-
title: rc-resize-observer
2+
hero:
3+
title: rc-resize-observer
4+
description: React Resize-Observer Component
35
---
46

57
<embed src="../README.md"></embed>

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"compile": "father build && lessc assets/index.less assets/index.css",
3333
"deploy": "UMI_ENV=gh npm run build && gh-pages -d .doc",
3434
"gh-pages": "npm run deploy",
35+
"prepare": "dumi setup",
3536
"prepublishOnly": "npm run compile && np --no-cleanup --yolo --no-publish",
3637
"postpublish": "npm run gh-pages",
3738
"lint": "eslint src/ --ext .ts,.tsx,.jsx,.js,.md",
@@ -56,7 +57,7 @@
5657
"@umijs/fabric": "^2.0.9",
5758
"coveralls": "^3.0.6",
5859
"cross-env": "^7.0.2",
59-
"dumi": "^1.1.12",
60+
"dumi": "^2.0.0",
6061
"enzyme": "^3.0.0",
6162
"enzyme-adapter-react-16": "^1.15.6",
6263
"enzyme-to-json": "^3.4.0",

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"src/*"
1313
],
1414
"@@/*": [
15-
"src/.umi/*"
15+
".dumi/tmp/*"
1616
],
1717
"rc-resize-observer": [
1818
"src/index.tsx"

update-example.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,14 @@ paths.forEach(path => {
1313
const name = path.split('/').pop().split('.')[0];
1414
fs.writeFile(
1515
`./docs/demo/${name}.md`,
16-
`## ${name}
16+
`---
17+
title: ${name}
18+
nav:
19+
title: Demo
20+
path: /demo
21+
---
1722
18-
<code src="../../examples/${name}.tsx">
23+
<code src="../../examples/${name}.tsx"></code>
1924
`,
2025
'utf8',
2126
function(error) {

0 commit comments

Comments
 (0)