Skip to content

Commit a281a2f

Browse files
committed
feat: nutui 2.2.14
1 parent 13a95b9 commit a281a2f

File tree

5 files changed

+99
-2
lines changed

5 files changed

+99
-2
lines changed

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
registry=https://registry.npmjs.org
2+
engine-strict=true

.versionrc.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"header": "",
3+
"types": [
4+
{ "type": "feat", "section": "feat" },
5+
{ "type": "fix", "section": "fix" },
6+
{ "type": "chore", "section": "chore" },
7+
{ "type": "docs", "section": "docs" },
8+
{ "type": "style", "section": "style" },
9+
{ "type": "refactor", "section": "refactor" },
10+
{ "type": "perf", "section": "perf" },
11+
{ "type": "test", "section": "test" }
12+
]
13+
}

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
## 2.2.14
2+
3+
`2020-02-08`
4+
5+
* :sparkles: feat(luckcard):增加支持刮开系数,支持清空蒙层 #365 @guoxiao158
6+
* :sparkles: feat(swiper):支持异步切换指定页数 #380 @ZXHHHH123@jacob-zch@richard1015
7+
* :sparkles: feat(calendar):添加 choose-click事件 #363 @richard1015
8+
* :bug: fix(tab):修复默认值def-index设置后不能自动将对应标题居中 #362 @zhenyulei
9+
* :bug: fix(collapse):优化折叠面板change回调方法 @Ymm0008
10+
* :bug: fix(upload):修复Android手机多次点击重复调用相机、相册兼容问题 #379 @Drjingfubo
11+
* :bug: fix(circleprogress):修复环形进度条渲染高亮问题 #373 @Drjingfubo@layman666
12+
* :bug: fix(popup):修复挂载节点api无效的问题 #382 @yangkaixuan
13+
* :zap: calendar 文档修改 isOpenRangeSelect、endDate参数修改 @Drjingfubo
14+
* :zap: actionsheet 文档修改 @click.native demo使用方法 @Drjingfubo
15+
116
## 2.2.13
217

318
`2020-12-18`

package.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nutui/nutui",
3-
"version": "2.2.13",
3+
"version": "2.2.14",
44
"description": "一套轻量级移动端Vue组件库",
55
"typings": "dist/types/index.d.ts",
66
"main": "dist/nutui.js",
@@ -14,6 +14,7 @@
1414
"scripts": {
1515
"dev": "nutui-cli dev",
1616
"build": "nutui-cli build",
17+
"release": "standard-version -a",
1718
"build:site": "nutui-cli build-site",
1819
"clean": "nutui-cli clean",
1920
"add": "nutui-cli add",
@@ -34,6 +35,11 @@
3435
"type": "git",
3536
"url": "https://github.com/jdf2e/nutui.git"
3637
},
38+
"standard-version": {
39+
"scripts": {
40+
"postchangelog": "node ./scripts/updateChangelog.js"
41+
}
42+
},
3743
"keywords": [
3844
"nutui",
3945
"nutui2",
@@ -56,6 +62,7 @@
5662
"babel-plugin-istanbul": "^6.0.0",
5763
"gsap": "^3.2.6",
5864
"hammerjs": "^2.0.8",
65+
"standard-version": "^9.1.0",
5966
"vue-lazyload": "^1.3.3",
6067
"vue-qr": "^2.2.1"
6168
},
@@ -71,8 +78,8 @@
7178
"babel-plugin-transform-object-rest-spread": "^6.26.0",
7279
"eslint-plugin-import": "^2.20.0",
7380
"eslint-plugin-vue": "^6.1.2",
74-
"lint-staged": "^10.2.11",
7581
"husky": "^3.0.0",
82+
"lint-staged": "^10.2.11",
7683
"stylelint-config-standard": "^19.0.0"
7784
},
7885
"nyc": {

scripts/updateChangelog.js

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
const fs = require('fs');
2+
const path = require('path');
3+
const changelog = fs.readFileSync(path.join(__dirname, '../CHANGELOG.md'), 'utf8');
4+
const typeList = [
5+
{ type: 'fix', icon: '🐛' },
6+
{ type: 'feat', icon: '✨' },
7+
{ type: 'chore', icon: '👷' },
8+
{ type: 'docs', icon: '📝 ' },
9+
{ type: 'style', icon: '💄' },
10+
{ type: 'refactor', icon: '🎨' },
11+
{ type: 'perf', icon: '⚡' },
12+
{ type: 'test', icon: '✅ ' }
13+
];
14+
const replaceMd = {
15+
content: '',
16+
setContent(content) {
17+
replaceMd.content = content;
18+
return replaceMd;
19+
},
20+
getContent() {
21+
return replaceMd.content;
22+
},
23+
//版本号改成二级标题
24+
changeTitle() {
25+
replaceMd.content = replaceMd.content.replace(/### (?=\[\d\.\d\.\d\])/g, '## ');
26+
return replaceMd;
27+
},
28+
//修改日期位置
29+
changeDate() {
30+
replaceMd.content = replaceMd.content.replace(/(?<=\[\d\.\d\.\d\]\([\s\S]+\)) \((\d\d\d\d\-\d\d\-\d\d)\)(?=\n)/g, '\n`$1`');
31+
return replaceMd;
32+
},
33+
//增加type内容
34+
changeType() {
35+
function replaceType(type, icon) {
36+
replaceMd.content = replaceMd.content.replace(new RegExp(`(?<=### ${type}\\n\\n)\\* ([\\s\\S]+?)\\n+(?=[###|##])`, 'g'), function(match) {
37+
return match.replace(new RegExp(`\\* ([\\s\\S]+?)(?=\\n)`, 'g'), `* ${icon} ${type}: $1`);
38+
});
39+
}
40+
typeList.forEach(e => {
41+
replaceType(e.type, e.icon);
42+
});
43+
return replaceMd;
44+
},
45+
//删除type标题
46+
deleteType() {
47+
typeList.forEach(e => {
48+
replaceMd.content = replaceMd.content.replace(new RegExp(`### ${e.type}\\n+`, 'g'), '');
49+
});
50+
return replaceMd;
51+
}
52+
};
53+
54+
const newChangelog = replaceMd
55+
.setContent(changelog)
56+
.changeTitle()
57+
.changeDate()
58+
.changeType()
59+
.deleteType();
60+
fs.writeFileSync(path.join(__dirname, '../CHANGELOG.md'), newChangelog.getContent(), 'utf8');

0 commit comments

Comments
 (0)