Skip to content

Commit 7e69a82

Browse files
committed
chore(grunt): add grunt release and update changelog
1 parent a01f56b commit 7e69a82

File tree

3 files changed

+58
-4
lines changed

3 files changed

+58
-4
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
## ChangeLog
22

3+
### 1.10.1
4+
5+
- revert: feat: update escape to false
6+
- feat: add `checkInvert` method
7+
- feat: add `bootstrap-table-he-IL.js`
8+
- bug: update grunt to development dependency
9+
- bug: press on toolbar elements, the key-events it will not run
10+
- bug: remove bogus conditions that will always be true
11+
- bug: refactor filter control select input initialization
12+
- bug: typo in Slovak translation
13+
314
### 1.10.0
415

516
- [bug] Fixed #1619: sub-table checkbox selects all the table.

Gruntfile.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
'use strict';
22

3+
var fs = require('fs');
4+
35
module.exports = function(grunt) {
46

57
// Project configuration.
@@ -77,14 +79,54 @@ module.exports = function(grunt) {
7779
dest: 'docs/dist', // destination folder
7880
expand: true // required when using cwd
7981
}
82+
},
83+
release: {
84+
options: {
85+
additionalFiles: ['bootstrap-table.jquery.json'],
86+
beforeRelease: ['docs', 'default']
87+
}
8088
}
8189
});
8290

91+
var bumpVersion = function (path, version, startWith) {
92+
var lines = fs.readFileSync(path, 'utf8').split('\n');
93+
lines.forEach(function (line, i) {
94+
if (line.indexOf(startWith) === 0) {
95+
lines[i] = startWith + version;
96+
}
97+
});
98+
fs.writeFileSync(path, lines.join('\n'), 'utf8');
99+
100+
grunt.log.ok('bumped version of ' + path + ' to ' + version);
101+
};
102+
103+
grunt.registerTask('docs', 'build the docs', function () {
104+
var version = require('./package.json').version;
105+
bumpVersion('./_config.yml', version, 'current_version: ');
106+
bumpVersion('./src/bootstrap-table.js', version, ' * version: ');
107+
bumpVersion('./src/bootstrap-table.css', version, ' * version: ');
108+
109+
var changeLog = fs.readFileSync('./CHANGELOG.md', 'utf8');
110+
var latestLogs = changeLog.split('### ')[1];
111+
var date = new Date();
112+
113+
var lines = [
114+
'### Latest release (' +
115+
[date.getFullYear(), date.getMonth() + 1, date.getDate()].join('-') + ')',
116+
'',
117+
'#### v' + latestLogs
118+
];
119+
fs.writeFileSync('./docs/_includes/latest-release.md', lines.join('\n'), 'utf8');
120+
121+
grunt.log.ok('updated the latest-release.md to ' + version);
122+
});
123+
83124
grunt.loadNpmTasks('grunt-contrib-clean');
84125
grunt.loadNpmTasks('grunt-contrib-concat');
85126
grunt.loadNpmTasks('grunt-contrib-uglify');
86127
grunt.loadNpmTasks('grunt-contrib-cssmin');
87128
grunt.loadNpmTasks('grunt-contrib-copy');
129+
grunt.loadNpmTasks('grunt-release');
88130

89131
grunt.registerTask('default', ['clean', 'concat', 'uglify', 'cssmin', 'copy']);
90132
};

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@
88
},
99
"devDependencies": {
1010
"cz-conventional-changelog": "^1.1.5",
11-
"grunt-contrib-copy": "^0.8.0",
12-
"grunt-contrib-concat": "^0.5.1",
11+
"grunt": "^0.4.5",
1312
"grunt-contrib-clean": "^0.6.0",
13+
"grunt-contrib-concat": "^0.5.1",
14+
"grunt-contrib-copy": "^0.8.0",
1415
"grunt-contrib-cssmin": "^0.12.2",
15-
"grunt-contrib-uglify": "^0.8.0",
1616
"grunt-contrib-jshint": "^0.10.0",
17-
"grunt": "^0.4.5"
17+
"grunt-contrib-uglify": "^0.8.0",
18+
"grunt-release": "^0.13.0"
1819
},
1920
"repository": {
2021
"type": "git",

0 commit comments

Comments
 (0)