Skip to content

Commit 6578c65

Browse files
authored
chore: bump [email protected] (#232)
* chore: bump [email protected] * chore: create package-lock.json add flag 'igonre-scripts' && update snapshots
1 parent 6138657 commit 6578c65

15 files changed

+122
-34
lines changed

.dumirc.ts

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// more config: https://d.umijs.org/config
2+
import { defineConfig } from 'dumi';
3+
4+
export default defineConfig({
5+
favicons: ['https://avatars0.githubusercontent.com/u/9441414?s=200&v=4'],
6+
themeConfig: {
7+
name: 'rc-dropdown',
8+
logo: 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4',
9+
},
10+
outputPath: '.docs',
11+
exportStatic: {},
12+
styles: [
13+
`
14+
section.dumi-default-header-left {
15+
width: 240px;
16+
}
17+
`,
18+
],
19+
});

.github/workflows/ci.yml

+2-2
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: '14'
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-script
2828

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

.gitignore

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
.storybook
21
*.iml
32
*.log
43
.idea/
@@ -31,7 +30,7 @@ yarn.lock
3130
package-lock.json
3231

3332
# dumi
34-
.umi
35-
.umi-production
36-
.umi-test
33+
.dumi/tmp
34+
.dumi/tmp-test
35+
.dumi/tmp-production
3736
.docs

.umirc.ts

-8
This file was deleted.

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -139,21 +139,21 @@ Note: Additional props are passed into the underlying [rc-trigger](https://githu
139139

140140
## Development
141141

142-
```
142+
```bash
143143
npm install
144144
npm start
145145
```
146146

147147
## Test Case
148148

149-
```
149+
```bash
150150
npm test
151151
npm run chrome-test
152152
```
153153

154154
## Coverage
155155

156-
```
156+
```bash
157157
npm run coverage
158158
```
159159

docs/demo/arrow.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1-
## Arrow
1+
---
2+
title: arrow
3+
nav:
4+
title: Demo
5+
path: /demo
6+
---
27

3-
<code src="../examples/arrow.jsx" />
8+
<code src="../examples/arrow.jsx"></code>

docs/demo/context-menu.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1-
## Context Menu
1+
---
2+
title: context-menu
3+
nav:
4+
title: Demo
5+
path: /demo
6+
---
27

3-
<code src="../examples/context-menu.jsx" />
8+
<code src="../examples/context-menu.jsx"></code>

docs/demo/dropdown-menu-width.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1-
## Dropdown Menu Width
1+
---
2+
title: dropdown-menu-width
3+
nav:
4+
title: Demo
5+
path: /demo
6+
---
27

3-
<code src="../examples/dropdown-menu-width.jsx" />
8+
<code src="../examples/dropdown-menu-width.jsx"></code>

docs/demo/multiple.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# Multiple
1+
---
2+
title: multiple
3+
nav:
4+
title: Demo
5+
path: /demo
6+
---
27

3-
4-
<code src="../examples/multiple.jsx" />
8+
<code src="../examples/multiple.jsx"></code>

docs/demo/overlay-callback.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1-
# Overlay Callback
1+
---
2+
title: overlay-callback
3+
nav:
4+
title: Demo
5+
path: /demo
6+
---
27

3-
<code src="../examples/overlay-callback.jsx" />
8+
<code src="../examples/overlay-callback.jsx"></code>

docs/demo/simple.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1-
# Simple
1+
---
2+
title: simple
3+
nav:
4+
title: Demo
5+
path: /demo
6+
---
27

3-
<code src="../examples/simple.jsx" />
8+
<code src="../examples/simple.jsx"></code>

docs/index.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
hero:
3+
title: rc-dropdown
4+
description: React Dropdown Component
5+
---
6+
7+
<embed src="../README.md"></embed>

package.json

+7-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"coverage": "rc-test --coverage",
3333
"lint": "eslint src/ docs/examples/ --ext .tsx,.ts,.jsx,.js",
3434
"now-build": "npm run build",
35-
"prepare": "husky install",
35+
"prepare": "husky install && dumi setup",
3636
"prepublishOnly": "npm run compile && np --no-cleanup --yolo --no-publish",
3737
"start": "dumi dev",
3838
"test": "rc-test"
@@ -58,9 +58,12 @@
5858
"@types/react": "^18.0.0",
5959
"@types/react-dom": "^18.0.0",
6060
"@types/warning": "^3.0.0",
61+
"@umijs/fabric": "^3.0.0",
6162
"cross-env": "^7.0.0",
62-
"dumi": "^1.1.38",
63+
"dumi": "^2.0.0",
64+
"eslint": "^7.18.0",
6365
"father": "^4.0.0",
66+
"glob": "^10.0.0",
6467
"husky": "^8.0.3",
6568
"jest-environment-jsdom": "^29.5.0",
6669
"jquery": "^3.3.1",
@@ -69,11 +72,12 @@
6972
"np": "^6.0.0",
7073
"prettier": "^2.8.7",
7174
"rc-menu": "^9.5.2",
75+
"rc-resize-observer": "^1.4.0",
7276
"rc-test": "^7.0.14",
7377
"react": "^18.0.0",
7478
"react-dom": "^18.0.0",
7579
"regenerator-runtime": "^0.13.9",
76-
"typescript": "^4.0.2"
80+
"typescript": "^5.0.0"
7781
},
7882
"peerDependencies": {
7983
"react": ">=16.11.0",

script/update-content.js

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
用于 dumi 改造使用,
3+
可用于将 examples 的文件批量修改为 demo 引入形式,
4+
其他项目根据具体情况使用。
5+
*/
6+
7+
const fs = require('fs');
8+
const glob = require('glob');
9+
10+
const paths = glob.sync('./docs/examples/*.jsx');
11+
12+
paths.forEach((path) => {
13+
const name = path.split('/').pop().split('.')[0];
14+
fs.writeFile(
15+
`./docs/demo/${name}.md`,
16+
`---
17+
title: ${name}
18+
nav:
19+
title: Demo
20+
path: /demo
21+
---
22+
23+
<code src="../examples/${name}.jsx"></code>
24+
`,
25+
'utf8',
26+
function (error) {
27+
if (error) {
28+
console.log(error);
29+
return false;
30+
}
31+
console.log(`${name} 更新成功~`);
32+
},
33+
);
34+
});

tsconfig.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
{
22
"compilerOptions": {
33
"allowSyntheticDefaultImports": true,
4+
"baseUrl": "./",
45
"declaration": true,
56
"module": "esnext",
67
"target": "esnext",
78
"moduleResolution": "node",
89
"jsx": "react",
9-
"skipLibCheck": true
10+
"skipLibCheck": true,
11+
"paths": {
12+
"@@/*": [".dumi/tmp/*"]
13+
}
1014
},
1115
"include": ["./src", "./tests", "./typings/"],
1216
"typings": "./typings/index.d.ts",

0 commit comments

Comments
 (0)