Skip to content

Commit

Permalink
chore: bump dumi@2.x.x && father 4.x.x (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
DBSDs authored Nov 17, 2023
1 parent 6367809 commit 2602936
Show file tree
Hide file tree
Showing 11 changed files with 81 additions and 33 deletions.
22 changes: 22 additions & 0 deletions .dumirc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// more config: https://d.umijs.org/config
import { defineConfig } from 'dumi';

export default defineConfig({
favicons: ['https://avatars0.githubusercontent.com/u/9441414?s=200&v=4'],
themeConfig: {
name: 'mutate-observer',
logo: 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4',
},
outputPath: '.doc',
exportStatic: {},
styles: [
`
section.dumi-default-header-left {
width: 240px;
}
.markdown table {
width: auto !important;
}
`,
],
});
File renamed without changes.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 4 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.storybook
*.iml
*.log
.idea
Expand Down Expand Up @@ -29,8 +28,8 @@ yarn.lock
package-lock.json
.doc

# umi
.umi
.umi-production
.umi-test
# dumi
.dumi/tmp
.dumi/tmp-test
.dumi/tmp-production
.env.local
17 changes: 0 additions & 17 deletions .umirc.ts

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ open http://localhost:8000

## Usage

```tsx
```tsx | pure
import React from 'react';
import MutateObserver from './src';

Expand Down
9 changes: 7 additions & 2 deletions docs/demo/basic.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## basic
---
title: basic
nav:
title: Demo
path: /demo
---

<code src="../examples/basic.tsx" />
<code src="../examples/basic.tsx"></code>
4 changes: 3 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
title: rc-mutate-observer
hero:
title: rc-mutate-observer
description: React Mutate Observer Component
---

<embed src="../README.md"></embed>
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
],
"scripts": {
"compile": "father build",
"prepare": "dumi setup",
"deploy": "npm run docs:build && npm run docs:deploy",
"docs:build": "dumi build",
"docs:deploy": "gh-pages -d docs-dist",
Expand All @@ -50,18 +51,20 @@
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.0.0",
"@types/jest": "^26.0.20",
"@types/node": "^20.9.0",
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"@umijs/fabric": "^2.5.2",
"dumi": "^1.1.0",
"@umijs/fabric": "^3.0.0",
"dumi": "^2.0.0",
"eslint": "^7.18.0",
"father": "^4.0.0-rc.8",
"father": "^4.0.0",
"gh-pages": "^3.1.0",
"glob": "^10.0.0",
"np": "^5.0.3",
"prettier": "^2.1.2",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"typescript": "^4.6.3",
"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/*.tsx');

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}.tsx"></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-component/mutate-observer": ["src/index.tsx"]
}
}
Expand Down

0 comments on commit 2602936

Please sign in to comment.