Skip to content

Commit

Permalink
chore: bump dumi@2.x.x && father 4.x.x (#334)
Browse files Browse the repository at this point in the history
  • Loading branch information
DBSDs authored Nov 17, 2023
1 parent 1df83b4 commit b65fd88
Show file tree
Hide file tree
Showing 23 changed files with 185 additions and 44 deletions.
8 changes: 5 additions & 3 deletions .umirc.ts → .dumirc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
import { defineConfig } from 'dumi';

export default defineConfig({
title: 'rc-steps',
favicon: 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4',
logo: 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4',
favicons: ['https://avatars0.githubusercontent.com/u/9441414?s=200&v=4'],
themeConfig: {
name: 'rc-steps',
logo: 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4',
},
outputPath: '.doc',
exportStatic: {},
base: '/rc-steps',
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: CI

on:
push:
branches: [ master ]
branches: [master]
pull_request:
branches: [ master ]
branches: [master]

jobs:
setup:
Expand All @@ -15,7 +15,7 @@ jobs:

- uses: actions/setup-node@v1
with:
node-version: '12'
node-version: '18'

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

- name: create package-lock.json
run: npm i --package-lock-only
run: npm i --package-lock-only --ignore-scripts

- name: hack for singe file
run: |
Expand Down
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.storybook
.iml
*.log
.idea/
Expand Down Expand Up @@ -32,3 +31,9 @@ yarn.lock
.doc
.umi
.npmrc

# dumi
.dumi/tmp
.dumi/tmp-test
.dumi/tmp-production
.env.local
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ React steps component.
npm install rc-steps
```

<br>

```jsx | pure
<Steps current={1}>
<Steps.Step title="first" />
Expand Down Expand Up @@ -179,7 +181,7 @@ https://react-component.github.io/steps/

## Development

```
```bash
npm install
npm start
```
Expand Down
10 changes: 8 additions & 2 deletions docs/demo/alternativeLabel.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
## alternativeLabel
<code src="../examples/alternativeLabel.jsx">
---
title: alternativeLabel
nav:
title: Demo
path: /demo
---

<code src="../examples/alternativeLabel.jsx"></code>
10 changes: 8 additions & 2 deletions docs/demo/composable.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
## composable
<code src="../examples/composable.jsx">
---
title: composable
nav:
title: Demo
path: /demo
---

<code src="../examples/composable.jsx"></code>
10 changes: 8 additions & 2 deletions docs/demo/custom-svg-icon.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
## custom-svg-icon
<code src="../examples/custom-svg-icon.jsx">
---
title: custom-svg-icon
nav:
title: Demo
path: /demo
---

<code src="../examples/custom-svg-icon.jsx"></code>
10 changes: 8 additions & 2 deletions docs/demo/customIcon.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
## customIcon
<code src="../examples/customIcon.jsx">
---
title: customIcon
nav:
title: Demo
path: /demo
---

<code src="../examples/customIcon.jsx"></code>
10 changes: 8 additions & 2 deletions docs/demo/dynamic.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
## dynamic
<code src="../examples/dynamic.jsx">
---
title: dynamic
nav:
title: Demo
path: /demo
---

<code src="../examples/dynamic.jsx"></code>
10 changes: 8 additions & 2 deletions docs/demo/errorStep.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
## errorStep
<code src="../examples/errorStep.jsx">
---
title: errorStep
nav:
title: Demo
path: /demo
---

<code src="../examples/errorStep.jsx"></code>
10 changes: 8 additions & 2 deletions docs/demo/inline.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
## inline
<code src="../examples/inline.jsx">
---
title: inline
nav:
title: Demo
path: /demo
---

<code src="../examples/inline.jsx"></code>
10 changes: 8 additions & 2 deletions docs/demo/nav-base.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
## nav-base
<code src="../examples/nav-base.jsx">
---
title: nav-base
nav:
title: Demo
path: /demo
---

<code src="../examples/nav-base.jsx"></code>
10 changes: 8 additions & 2 deletions docs/demo/nextStep.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
## nextStep
<code src="../examples/nextStep.jsx">
---
title: nextStep
nav:
title: Demo
path: /demo
---

<code src="../examples/nextStep.jsx"></code>
10 changes: 8 additions & 2 deletions docs/demo/progressDot.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
## progressDot
<code src="../examples/progressDot.jsx">
---
title: progressDot
nav:
title: Demo
path: /demo
---

<code src="../examples/progressDot.jsx"></code>
10 changes: 8 additions & 2 deletions docs/demo/simple.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
## simple
<code src="../examples/simple.jsx">
---
title: simple
nav:
title: Demo
path: /demo
---

<code src="../examples/simple.jsx"></code>
10 changes: 8 additions & 2 deletions docs/demo/smallSize.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
## smallSize
<code src="../examples/smallSize.jsx">
---
title: smallSize
nav:
title: Demo
path: /demo
---

<code src="../examples/smallSize.jsx"></code>
10 changes: 8 additions & 2 deletions docs/demo/stepIcon.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
## stepIcon
<code src="../examples/stepIcon.jsx">
---
title: stepIcon
nav:
title: Demo
path: /demo
---

<code src="../examples/stepIcon.jsx"></code>
10 changes: 8 additions & 2 deletions docs/demo/vertical.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
## vertical
<code src="../examples/vertical.jsx">
---
title: vertical
nav:
title: Demo
path: /demo
---

<code src="../examples/vertical.jsx"></code>
10 changes: 8 additions & 2 deletions docs/demo/verticalSmall.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
## verticalSmall
<code src="../examples/verticalSmall.jsx">
---
title: verticalSmall
nav:
title: Demo
path: /demo
---

<code src="../examples/verticalSmall.jsx"></code>
7 changes: 7 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
hero:
title: rc-steps
description: React Steps Component
---

<embed src="../README.md"></embed>
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"docs:deploy": "gh-pages -d .doc",
"gh-pages": "npm run docs:build && npm run docs:deploy",
"lint": "eslint src/ --ext .ts,.tsx,.jsx,.js,.md",
"prepare": "husky install",
"prepare": "husky install && dumi setup",
"prepublishOnly": "npm run compile && np --yolo --no-publish",
"prettier": "prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"",
"postpublish": "npm run gh-pages",
Expand All @@ -62,15 +62,16 @@
"@types/jest": "^26.0.5",
"@types/react": "^16.9.2",
"@types/react-dom": "^16.9.0",
"@umijs/fabric": "^2.10.0",
"@umijs/fabric": "^3.0.0",
"cross-env": "^7.0.0",
"dumi": "^1.1.38",
"dumi": "^2.0.0",
"enzyme": "^3.1.0",
"enzyme-adapter-react-16": "^1.0.1",
"enzyme-to-json": "^3.1.2",
"eslint": "^7.1.0",
"father": "^4",
"gh-pages": "^4.0.0",
"glob": "^10.0.0",
"husky": "^8.0.1",
"less": "^3.11.2",
"lint-staged": "^13.0.3",
Expand All @@ -81,7 +82,7 @@
"rc-tools": "^9.6.1",
"react": "^16.0.0",
"react-dom": "^16.0.0",
"typescript": "^4.5.4",
"typescript": "^5.0.0",
"umi-test": "^1.9.7"
},
"peerDependencies": {
Expand Down
34 changes: 34 additions & 0 deletions script/update-content.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
用于 dumi 改造使用,
可用于将 examples 的文件批量修改为 demo 引入形式,
其他项目根据具体情况使用。
*/

const fs = require('fs');
const glob = require('glob');

const paths = glob.sync('./docs/examples/*.jsx');

paths.forEach(path => {
const name = path.split('/').pop().split('.')[0];
fs.writeFile(
`./docs/demo/${name}.md`,
`---
title: ${name}
nav:
title: Demo
path: /demo
---
<code src="../examples/${name}.jsx"></code>
`,
'utf8',
function(error) {
if(error){
console.log(error);
return false;
}
console.log(`${name} 更新成功~`);
}
)
});
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"esModuleInterop": true,
"paths": {
"@/*": ["src/*"],
"@@/*": ["src/.umi/*"],
"@@/*": ["dumi/tmp/*"],
"rc-steps": ["src/index.ts"]
}
}
Expand Down

0 comments on commit b65fd88

Please sign in to comment.