mirror of
https://github.com/tabler/tabler-icons.git
synced 2025-08-17 19:36:29 +02:00
gulp changelog generate, new icons
This commit is contained in:
41
gulpfile.js
41
gulpfile.js
@@ -217,10 +217,7 @@ gulp.task('icons-sprite', function (cb) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('icons-preview', function (cb) {
|
gulp.task('icons-preview', function (cb) {
|
||||||
|
glob("icons/*.svg", {}, function (er, files) {
|
||||||
glob("_site/icons/*.svg", {}, function (er, files) {
|
|
||||||
console.log('files', files);
|
|
||||||
|
|
||||||
generateIconsPreview(files, '.github/icons.svg', cb);
|
generateIconsPreview(files, '.github/icons.svg', cb);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -311,9 +308,10 @@ gulp.task('changelog-commit', function (cb) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('changelog-diff', function (cb) {
|
gulp.task('changelog', function (cb) {
|
||||||
const version = argv['latest-tag'] || `v${p.version}`;
|
const version = argv['latest-tag'] || `v${p.version}`;
|
||||||
|
|
||||||
|
if(version) {
|
||||||
cp.exec(`git diff ${version} HEAD --name-status`, function (err, ret) {
|
cp.exec(`git diff ${version} HEAD --name-status`, function (err, ret) {
|
||||||
|
|
||||||
let newIcons = [], modifiedIcons = [], renamedIcons = [];
|
let newIcons = [], modifiedIcons = [], renamedIcons = [];
|
||||||
@@ -338,11 +336,40 @@ gulp.task('changelog-diff', function (cb) {
|
|||||||
|
|
||||||
cb();
|
cb();
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('changelog-image', function (cb) {
|
||||||
|
const version = argv['latest-version'] || `${p.version}`,
|
||||||
|
newVersion = argv['new-version'] || `${p.version}`;
|
||||||
|
|
||||||
|
if(version) {
|
||||||
|
cp.exec(`git diff v${version} HEAD --name-status`, function (err, ret) {
|
||||||
|
|
||||||
|
let newIcons = [];
|
||||||
|
|
||||||
|
ret.replace(/[AD]\s+src\/_icons\/([a-z1-9-]+)\.svg/g, function (m, fileName) {
|
||||||
|
newIcons.push(fileName);
|
||||||
|
});
|
||||||
|
|
||||||
|
newIcons = newIcons.map(function(icon){
|
||||||
|
return `./icons/${icon}.svg`;
|
||||||
|
});
|
||||||
|
|
||||||
|
if(newIcons.length > 0) {
|
||||||
|
generateIconsPreview(newIcons, `packages/tabler-icons-${newVersion}.svg`, cb, 6);
|
||||||
|
} else {
|
||||||
|
cb();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
cb();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
gulp.task('svg-to-png', gulp.series('build-jekyll', 'clean-png', async (cb) => {
|
gulp.task('svg-to-png', gulp.series('build-jekyll', 'clean-png', async (cb) => {
|
||||||
let files = glob.sync("_site/icons/*.svg");
|
let files = glob.sync("./icons/*.svg");
|
||||||
|
|
||||||
await asyncForEach(files, async function (file, i) {
|
await asyncForEach(files, async function (file, i) {
|
||||||
let name = path.basename(file, '.svg');
|
let name = path.basename(file, '.svg');
|
||||||
@@ -355,4 +382,4 @@ gulp.task('svg-to-png', gulp.series('build-jekyll', 'clean-png', async (cb) => {
|
|||||||
cb();
|
cb();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
gulp.task('build', gulp.series('optimize', 'build-jekyll', 'build-copy', 'icons-sprite', 'icons-preview', 'svg-to-png', 'build-zip'));
|
gulp.task('build', gulp.series('optimize', 'build-jekyll', 'build-copy', 'icons-sprite', 'icons-preview', 'svg-to-png', 'changelog-image', 'build-zip'));
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "tabler-icons",
|
"name": "tabler-icons",
|
||||||
"version": "1.0.3",
|
"version": "1.0.4",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/tabler/tabler-icons.git"
|
"url": "git+https://github.com/tabler/tabler-icons.git"
|
||||||
@@ -41,11 +41,11 @@
|
|||||||
},
|
},
|
||||||
"release-it": {
|
"release-it": {
|
||||||
"hooks": {
|
"hooks": {
|
||||||
"after:bump": "npm run build",
|
"after:bump": "npm run build --latest-version ${latestVersion} --new-version ${version}",
|
||||||
"after:release": "echo Successfully released ${name} v${version} to ${repo.repository}."
|
"after:release": "echo Successfully released ${name} v${latestVersion} to ${repo.repository}."
|
||||||
},
|
},
|
||||||
"git": {
|
"git": {
|
||||||
"changelog": "gulp changelog-diff --silent --latest-tag ${latestTag}",
|
"changelog": "gulp changelog --silent --latest-tag ${latestTag}",
|
||||||
"tagName": "v${version}",
|
"tagName": "v${version}",
|
||||||
"requireBranch": "master",
|
"requireBranch": "master",
|
||||||
"requireCommits": true
|
"requireCommits": true
|
||||||
|
Reference in New Issue
Block a user