Skip to content

Commit

Permalink
docs: use dumi2 & father4 (#255)
Browse files Browse the repository at this point in the history
* chore: deps

* chore: update

* docs: bump dumi

* chore: fix ts
  • Loading branch information
zombieJ authored Feb 1, 2024
1 parent 814be54 commit 2d4aef8
Show file tree
Hide file tree
Showing 13 changed files with 70 additions and 49 deletions.
14 changes: 5 additions & 9 deletions .fatherrc.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
export default {
cjs: 'babel',
esm: { type: 'babel', importLibToEs: true },
runtimeHelpers: true,
preCommit: {
eslint: true,
prettier: true,
},
};
import { defineConfig } from 'father';

export default defineConfig({
plugins: ['@rc-component/father-plugin'],
});
2 changes: 1 addition & 1 deletion .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 Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ package-lock.json
.umi-production
.umi-test
.env.local

.dumi
19 changes: 2 additions & 17 deletions .umirc.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,7 @@
// more config: https://d.umijs.org/config
import { defineConfig } from 'dumi';

export default defineConfig({
title: 'rc-virtual-list',
favicon:
'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4',
logo:
'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4',
outputPath: '.doc',
exportStatic: {},
resolve: {
examples: ['none'],
themeConfig: {
name: 'Tree',
},
styles: [
`
.markdown table {
width: auto !important;
}
`,
]
});
9 changes: 7 additions & 2 deletions docs/demo/animate.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## animate
---
title: Animate
nav:
title: Demo
path: /demo
---

<code src="../../examples/animate.tsx">
<code src="../../examples/animate.tsx"></code>
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>
9 changes: 7 additions & 2 deletions docs/demo/height.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## height
---
title: Height
nav:
title: Demo
path: /demo
---

<code src="../../examples/height.tsx">
<code src="../../examples/height.tsx"></code>
9 changes: 7 additions & 2 deletions docs/demo/horizontal-scroll.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## horizontal scroll
---
title: Horizontal Scroll
nav:
title: Demo
path: /demo
---

<code src="../../examples/horizontal-scroll.tsx">
<code src="../../examples/horizontal-scroll.tsx"></code>
9 changes: 7 additions & 2 deletions docs/demo/no-virtual.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## no-virtual
---
title: No Virtual
nav:
title: Demo
path: /demo
---

<code src="../../examples/no-virtual.tsx">
<code src="../../examples/no-virtual.tsx"></code>
9 changes: 7 additions & 2 deletions docs/demo/switch.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## switch
---
title: Switch
nav:
title: Demo
path: /demo
---

<code src="../../examples/switch.tsx">
<code src="../../examples/switch.tsx"></code>
2 changes: 1 addition & 1 deletion now.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
"src": "package.json",
"use": "@now/static-build",
"config": { "distDir": ".doc" }
"config": { "distDir": "dist" }
}
],
"routes": [
Expand Down
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,15 @@
"compile": "father build",
"prepublishOnly": "npm run compile && np --no-cleanup --yolo --no-publish",
"lint": "eslint src/ --ext .tsx,.ts",
"test": "father test",
"test": "rc-test",
"now-build": "npm run build"
},
"peerDependencies": {
"react": ">=16.9.0",
"react-dom": ">=16.9.0"
},
"devDependencies": {
"@rc-component/father-plugin": "^1.0.2",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^12.1.5",
"@types/classnames": "^2.2.10",
Expand All @@ -51,15 +52,16 @@
"@types/react-dom": "^18.0.3",
"@types/warning": "^3.0.0",
"cross-env": "^5.2.0",
"dumi": "^1.1.12",
"dumi": "^2.2.17",
"enzyme": "^3.1.0",
"enzyme-adapter-react-16": "^1.0.2",
"enzyme-adapter-react-16": "^1.15.6",
"enzyme-to-json": "^3.1.4",
"eslint": "^7.6.0",
"father": "^2.29.10",
"father": "^4.4.0",
"glob": "^7.1.6",
"np": "^5.0.3",
"rc-animate": "^2.9.1",
"rc-test": "^7.0.15",
"react": "^v16.9.0-alpha.0",
"react-dom": "^v16.9.0-alpha.0",
"typescript": "^4.0.0"
Expand Down
16 changes: 11 additions & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,20 @@
"target": "esnext",
"moduleResolution": "node",
"baseUrl": "./",
"jsx": "preserve",
"jsx": "react",
"declaration": true,
"skipLibCheck": true,
"esModuleInterop": true,
"paths": {
"@/*": ["src/*"],
"@@/*": ["src/.umi/*"],
"rc-virtual-list": ["src/index.ts"]
"@/*": [
"src/*"
],
"@@/*": [
"src/.umi/*"
],
"rc-virtual-list": [
"src/index.ts"
]
}
}
}
}

0 comments on commit 2d4aef8

Please sign in to comment.