Skip to content

Commit ada363f

Browse files
committed
🎨 chore: add tmpm sync script
1 parent 3aa1942 commit ada363f

File tree

3 files changed

+27
-7
lines changed

3 files changed

+27
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
这里放置了 pro 系列组件,用于支撑重型组件
44

5-
![coverage CI](https://github.com/ant-design/pro-components/workflows/coverage%20CI/badge.svg) ![Node CI](https://github.com/ant-design/pro-components/workflows/Node%20CI/badge.svg) ![Deploy CI](https://github.com/ant-design/pro-components/workflows/Deploy%20CI/badge.svg) [![](https://codecov.io/gh/ant-design/pro-components/branch/master/graph/badge.svg)](https://codecov.io/gh/ant-design/pro-components) [![Build With dumi](https://img.shields.io/badge/build%20with-dumi-blue)](https://d.umijs.org/) [![](https://badgen.net/badge/icon/Ant%20Design?icon=https://gw.alipayobjects.com/zos/antfincdn/Pp4WPgVDB3/KDpgvguMpGfqaHPjicRK.svg&label)](https://ant.design)
5+
![coverage CI](https://github.com/ant-design/pro-components/workflows/coverage%20CI/badge.svg) ![Node CI](https://github.com/ant-design/pro-components/workflows/Node%20CI/badge.svg) ![Deploy CI](https://github.com/ant-design/pro-components/workflows/Deploy%20CI/badge.svg) [![](https://codecov.io/gh/ant-design/pro-components/branch/master/graph/badge.svg)](https://codecov.io/gh/ant-design/pro-components) [![ docs by dumi](https://img.shields.io/badge/docs%20by-dumi-blue)](https://d.umijs.org/) [![Build With father](https://img.shields.io/badge/build%20with-father-028fe4.svg)](https://github.com/umijs/father/) [![](https://badgen.net/badge/icon/Ant%20Design?icon=https://gw.alipayobjects.com/zos/antfincdn/Pp4WPgVDB3/KDpgvguMpGfqaHPjicRK.svg&label)](https://ant.design)
66

77
## 🖥 浏览器兼容性
88

package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,18 @@
1515
"site": "dumi build",
1616
"size": "npm run build && size-limit",
1717
"start": "dumi dev",
18+
"sync:tnpm": "node -e 'require(\"./scripts/syncTNPM\")()'",
1819
"test": "umi-test",
1920
"test:coverage": "umi-test --coverage",
2021
"test:update": "umi-test --updateSnapshot",
2122
"update:deps": "yarn upgrade-interactive --latest"
2223
},
24+
"browserslist": [
25+
"last 2 versions",
26+
"Firefox ESR",
27+
"> 1%",
28+
"ie >= 11"
29+
],
2330
"devDependencies": {
2431
"@ant-design/compatible": "^1.0.4",
2532
"@babel/core": "^7.8.3",
@@ -109,12 +116,6 @@
109116
"pre-commit": "pretty-quick --staged",
110117
"commit-msg": "node scripts/verifyCommit.js"
111118
},
112-
"browserslist": [
113-
"last 2 versions",
114-
"Firefox ESR",
115-
"> 1%",
116-
"ie >= 11"
117-
],
118119
"size-limit": [
119120
{
120121
"path": "packages/card/lib/**/*.js",

scripts/syncTNPM.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/* eslint-disable global-require */
2+
const { execa } = require('@umijs/utils');
3+
const { join } = require('path');
4+
const getPackages = require('./utils/getPackages');
5+
6+
process.setMaxListeners(Infinity);
7+
8+
module.exports = (publishPkgList) => {
9+
const pkgList = (publishPkgList || getPackages()).map((name) => {
10+
// eslint-disable-next-line import/no-dynamic-require
11+
return require(join(__dirname, '../packages', name, 'package.json')).name;
12+
});
13+
const commands = pkgList.map((pkg) => {
14+
const subprocess = execa('tnpm', ['sync', pkg]);
15+
subprocess.stdout.pipe(process.stdout);
16+
return subprocess;
17+
});
18+
Promise.all(commands);
19+
};

0 commit comments

Comments
 (0)