Browse Source

feat: nutui 2.2.14

richard1015 4 years ago
parent
commit
a281a2fda0
5 changed files with 99 additions and 2 deletions
  1. 2 0
      .npmrc
  2. 13 0
      .versionrc.json
  3. 15 0
      CHANGELOG.md
  4. 9 2
      package.json
  5. 60 0
      scripts/updateChangelog.js

+ 2 - 0
.npmrc

@@ -0,0 +1,2 @@
+registry=https://registry.npmjs.org
+engine-strict=true

+ 13 - 0
.versionrc.json

@@ -0,0 +1,13 @@
+{
+  "header": "",
+  "types": [
+    { "type": "feat", "section": "feat" },
+    { "type": "fix", "section": "fix" },
+    { "type": "chore", "section": "chore" },
+    { "type": "docs", "section": "docs" },
+    { "type": "style", "section": "style" },
+    { "type": "refactor", "section": "refactor" },
+    { "type": "perf", "section": "perf" },
+    { "type": "test", "section": "test" }
+  ]
+}

+ 15 - 0
CHANGELOG.md

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

+ 9 - 2
package.json

@@ -1,6 +1,6 @@
 {
   "name": "@nutui/nutui",
-  "version": "2.2.13",
+  "version": "2.2.14",
   "description": "一套轻量级移动端Vue组件库",
   "typings": "dist/types/index.d.ts",
   "main": "dist/nutui.js",
@@ -14,6 +14,7 @@
   "scripts": {
     "dev": "nutui-cli dev",
     "build": "nutui-cli build",
+    "release": "standard-version -a",
     "build:site": "nutui-cli build-site",
     "clean": "nutui-cli clean",
     "add": "nutui-cli add",
@@ -34,6 +35,11 @@
     "type": "git",
     "url": "https://github.com/jdf2e/nutui.git"
   },
+  "standard-version": {
+    "scripts": {
+      "postchangelog": "node ./scripts/updateChangelog.js"
+    }
+  },
   "keywords": [
     "nutui",
     "nutui2",
@@ -56,6 +62,7 @@
     "babel-plugin-istanbul": "^6.0.0",
     "gsap": "^3.2.6",
     "hammerjs": "^2.0.8",
+    "standard-version": "^9.1.0",
     "vue-lazyload": "^1.3.3",
     "vue-qr": "^2.2.1"
   },
@@ -71,8 +78,8 @@
     "babel-plugin-transform-object-rest-spread": "^6.26.0",
     "eslint-plugin-import": "^2.20.0",
     "eslint-plugin-vue": "^6.1.2",
-    "lint-staged": "^10.2.11",
     "husky": "^3.0.0",
+    "lint-staged": "^10.2.11",
     "stylelint-config-standard": "^19.0.0"
   },
   "nyc": {

+ 60 - 0
scripts/updateChangelog.js

@@ -0,0 +1,60 @@
+const fs = require('fs');
+const path = require('path');
+const changelog = fs.readFileSync(path.join(__dirname, '../CHANGELOG.md'), 'utf8');
+const typeList = [
+  { type: 'fix', icon: '🐛' },
+  { type: 'feat', icon: '✨' },
+  { type: 'chore', icon: '👷' },
+  { type: 'docs', icon: '📝 ' },
+  { type: 'style', icon: '💄' },
+  { type: 'refactor', icon: '🎨' },
+  { type: 'perf', icon: '⚡' },
+  { type: 'test', icon: '✅ ' }
+];
+const replaceMd = {
+  content: '',
+  setContent(content) {
+    replaceMd.content = content;
+    return replaceMd;
+  },
+  getContent() {
+    return replaceMd.content;
+  },
+  //版本号改成二级标题
+  changeTitle() {
+    replaceMd.content = replaceMd.content.replace(/### (?=\[\d\.\d\.\d\])/g, '## ');
+    return replaceMd;
+  },
+  //修改日期位置
+  changeDate() {
+    replaceMd.content = replaceMd.content.replace(/(?<=\[\d\.\d\.\d\]\([\s\S]+\)) \((\d\d\d\d\-\d\d\-\d\d)\)(?=\n)/g, '\n`$1`');
+    return replaceMd;
+  },
+  //增加type内容
+  changeType() {
+    function replaceType(type, icon) {
+      replaceMd.content = replaceMd.content.replace(new RegExp(`(?<=### ${type}\\n\\n)\\* ([\\s\\S]+?)\\n+(?=[###|##])`, 'g'), function(match) {
+        return match.replace(new RegExp(`\\* ([\\s\\S]+?)(?=\\n)`, 'g'), `* ${icon} ${type}: $1`);
+      });
+    }
+    typeList.forEach(e => {
+      replaceType(e.type, e.icon);
+    });
+    return replaceMd;
+  },
+  //删除type标题
+  deleteType() {
+    typeList.forEach(e => {
+      replaceMd.content = replaceMd.content.replace(new RegExp(`### ${e.type}\\n+`, 'g'), '');
+    });
+    return replaceMd;
+  }
+};
+
+const newChangelog = replaceMd
+  .setContent(changelog)
+  .changeTitle()
+  .changeDate()
+  .changeType()
+  .deleteType();
+fs.writeFileSync(path.join(__dirname, '../CHANGELOG.md'), newChangelog.getContent(), 'utf8');