Skip to content

Commit

Permalink
chore: bump [email protected] && father 4.x.x (#56)
Browse files Browse the repository at this point in the history
* chore: bump [email protected] && father 4.x.x

* chore: use rc-test
  • Loading branch information
DBSDs authored Nov 23, 2023
1 parent ecaecb4 commit dd99426
Show file tree
Hide file tree
Showing 12 changed files with 92 additions and 42 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-footer',
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-footer',
logo: 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4',
},
outputPath: '.doc',
exportStatic: {},
base: '/footer/',
Expand Down
9 changes: 0 additions & 9 deletions .fatherrc.js

This file was deleted.

5 changes: 5 additions & 0 deletions .fatherrc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { defineConfig } from "father";

export default defineConfig({
plugins: ["@rc-component/father-plugin"],
});
14 changes: 7 additions & 7 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 All @@ -43,7 +43,7 @@ jobs:
- name: install
if: steps.node_modules_cache_id.outputs.cache-hit != 'true'
run: npm ci

lint:
runs-on: ubuntu-latest
steps:
Expand All @@ -66,7 +66,7 @@ jobs:
run: npm run lint

needs: setup

compile:
runs-on: ubuntu-latest
steps:
Expand All @@ -89,7 +89,7 @@ jobs:
run: npm run compile

needs: setup

coverage:
runs-on: ubuntu-latest
steps:
Expand Down
11 changes: 5 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.storybook
*.iml
*.log
.idea/
Expand Down Expand Up @@ -30,8 +29,8 @@ package-lock.json
coverage/
.doc

# umi
.umi
.umi-production
.umi-test
.env.local
# dumi
.dumi/tmp
.dumi/tmp-test
.dumi/tmp-production
.env.local
9 changes: 7 additions & 2 deletions docs/demo/rows.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## rows
---
title: rows
nav:
title: Demo
path: /demo
---

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

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

<code src="../examples/theme.tsx">
<code src="../examples/theme.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-footer
hero:
title: rc-footer
description: React Footer Component
---

<embed src="../README.md"></embed>
20 changes: 11 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,42 +33,44 @@
"docs:build": "dumi build",
"docs:deploy": "gh-pages -d .doc",
"compile": "father build && lessc assets/index.less assets/index.css",
"prepare": "husky install && dumi setup",
"gh-pages": "npm run docs:build && father doc deploy",
"prepublishOnly": "npm run compile && np --yolo --no-publish && npm run gh-pages",
"lint": "eslint src/ --ext .ts,.tsx,.jsx,.js,.md",
"prettier": "prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"",
"pretty-quick": "pretty-quick",
"test": "father test",
"coverage": "father test --coverage"
"test": "rc-test",
"coverage": "rc-test --coverage"
},
"dependencies": {
"@babel/runtime": "^7.11.1",
"classnames": "^2.2.1"
},
"devDependencies": {
"@rc-component/father-plugin": "^1.0.0",
"@types/classnames": "^2.2.9",
"@types/react": "^17.0.13",
"@types/react-dom": "^16.9.0",
"@umijs/fabric": "^2.0.8",
"coveralls": "^3.0.6",
"cross-env": "^7.0.2",
"dumi": "^1.1.0",
"dumi": "^2.0.0",
"enzyme": "^3.0.0",
"enzyme-adapter-react-16": "^1.0.1",
"enzyme-adapter-react-16": "^1.15.6",
"enzyme-to-json": "^3.4.0",
"eslint": "^7.0.0",
"father": "^2.13.4",
"father-build": "^1.18.6",
"father": "^4.0.0",
"gh-pages": "^3.1.0",
"husky": "^4.2.5",
"glob": "^10.0.0",
"husky": "^8.0.3",
"less": "^3.10.3",
"np": "^7.0.0",
"prettier": "^2.0.5",
"pretty-quick": "^3.0.0",
"rc-test": "^7.0.15",
"react": "^16.0.0",
"react-dom": "^16.0.0",
"react-test-renderer": "^16.0.0",
"typescript": "^4.0.5"
"typescript": "^5.0.0"
},
"peerDependencies": {
"react": ">=16.0.0",
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 @@ -14,7 +14,7 @@
"declaration": true,
"paths": {
"@/*": ["src/*"],
"@@/*": ["src/.umi/*"],
"@@/*": [".dumi/tmp/*"],
"rc-footer": ["src/index.tsx"]
}
}
Expand Down

0 comments on commit dd99426

Please sign in to comment.