mirror of
https://github.com/tabler/tabler-icons.git
synced 2025-08-16 11:04:18 +02:00
gulp changelog generate, new icons
This commit is contained in:
79
gulpfile.js
79
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,38 +308,68 @@ 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}`;
|
||||||
|
|
||||||
cp.exec(`git diff ${version} HEAD --name-status`, function (err, ret) {
|
|
||||||
|
|
||||||
let newIcons = [], modifiedIcons = [], renamedIcons = [];
|
if(version) {
|
||||||
|
cp.exec(`git diff ${version} HEAD --name-status`, function (err, ret) {
|
||||||
|
|
||||||
ret.replace(/A\s+src\/_icons\/([a-z1-9-]+)\.svg/g, function (m, fileName) {
|
let newIcons = [], modifiedIcons = [], renamedIcons = [];
|
||||||
newIcons.push(fileName);
|
|
||||||
|
ret.replace(/A\s+src\/_icons\/([a-z1-9-]+)\.svg/g, function (m, fileName) {
|
||||||
|
newIcons.push(fileName);
|
||||||
|
});
|
||||||
|
|
||||||
|
ret.replace(/M\s+src\/_icons\/([a-z1-9-]+)\.svg/g, function (m, fileName) {
|
||||||
|
modifiedIcons.push(fileName);
|
||||||
|
});
|
||||||
|
|
||||||
|
ret.replace(/R[0-9]+\s+src\/_icons\/([a-z1-9-]+)\.svg\s+src\/_icons\/([a-z1-9-]+).svg/g, function (m, fileNameBefore, fileNameAfter) {
|
||||||
|
renamedIcons.push([fileNameBefore, fileNameAfter]);
|
||||||
|
});
|
||||||
|
|
||||||
|
modifiedIcons = modifiedIcons.filter(function (el) {
|
||||||
|
return newIcons.indexOf(el) < 0;
|
||||||
|
});
|
||||||
|
|
||||||
|
printChangelog(newIcons, modifiedIcons, renamedIcons);
|
||||||
|
|
||||||
|
cb();
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
ret.replace(/M\s+src\/_icons\/([a-z1-9-]+)\.svg/g, function (m, fileName) {
|
gulp.task('changelog-image', function (cb) {
|
||||||
modifiedIcons.push(fileName);
|
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 {
|
||||||
ret.replace(/R[0-9]+\s+src\/_icons\/([a-z1-9-]+)\.svg\s+src\/_icons\/([a-z1-9-]+).svg/g, function (m, fileNameBefore, fileNameAfter) {
|
|
||||||
renamedIcons.push([fileNameBefore, fileNameAfter]);
|
|
||||||
});
|
|
||||||
|
|
||||||
modifiedIcons = modifiedIcons.filter(function (el) {
|
|
||||||
return newIcons.indexOf(el) < 0;
|
|
||||||
});
|
|
||||||
|
|
||||||
printChangelog(newIcons, modifiedIcons, renamedIcons);
|
|
||||||
|
|
||||||
cb();
|
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