chore: Add tasks

This commit is contained in:
Mattia Astorino 2017-02-04 14:56:29 +01:00
parent dcd9548d8f
commit e062daac58
6 changed files with 128 additions and 14 deletions

View file

@ -1,5 +1,7 @@
// import the tasks // import the tasks
import './tasks/icons'; import './tasks/icons';
import './tasks/changelog';
import './tasks/bump';
// export default script // export default script
export default ['build']; export default ['build'];

37
.gulp/tasks/bump.js Normal file
View file

@ -0,0 +1,37 @@
'use strict';
/*
* > Bump
*/
import gulp from 'gulp';
import runSequence from 'run-sequence';
import colors from 'colors';
import yrgv from 'yargs';
import bump from 'gulp-bump';
import gulpif from 'gulp-if';
var argv = yrgv.argv;
gulp.task('bump', (cb) => {
runSequence(
'bump-pkg-version',
(error) => {
if (error) {
console.log('[bump]'.bold.magenta + ' There was an issue bumping version:\n'.bold.red + error.message);
} else {
console.log('[bump]'.bold.magenta + ' Finished successfully'.bold.green);
}
cb(error);
}
);
});
gulp.task('bump-pkg-version', () => {
return gulp.src(['./package.json'])
.pipe(gulpif((Object.keys(argv).length === 2), bump()))
.pipe(gulpif(argv.patch, bump()))
.pipe(gulpif(argv.minor, bump({ type: 'minor' })))
.pipe(gulpif(argv.major, bump({ type: 'major' })))
.pipe(gulp.dest('./'));
});

18
.gulp/tasks/changelog.js Normal file
View file

@ -0,0 +1,18 @@
'use strict';
/*
* > Changelog
*/
import gulp from 'gulp';
import conventionalChangelog from 'gulp-conventional-changelog';
gulp.task('changelog', () => {
return gulp.src('CHANGELOG.md')
.pipe(conventionalChangelog({
preset: 'angular',
releaseCount: 0
}))
.pipe(gulp.dest('./'));
});

View file

@ -1,7 +0,0 @@
# Change Log
All notable changes to the "theme-material-theme-darker" extension will be documented in this file.
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
## [Unreleased]
- Initial release

View file

@ -43,12 +43,13 @@
"eslint": "^3.11.0", "eslint": "^3.11.0",
"eslint-plugin-standard": "^2.0.1", "eslint-plugin-standard": "^2.0.1",
"gulp": "^3.9.1", "gulp": "^3.9.1",
"gulp-bump": "^2.4.0", "gulp-bump": "^2.6.1",
"gulp-colorize-svgs": "git+https://git@github.com/unic/gulp-colorize-svgs.git", "gulp-colorize-svgs": "git+https://git@github.com/unic/gulp-colorize-svgs.git",
"gulp-conventional-changelog": "^1.1.0", "gulp-conventional-changelog": "^1.1.0",
"gulp-if": "^2.0.2",
"gulp-stats": "^0.0.4", "gulp-stats": "^0.0.4",
"gulp-watch": "^4.3.8", "gulp-watch": "^4.3.8",
"run-sequence": "^1.2.2", "run-sequence": "^1.2.2",
"yargs": "^6.0.0" "yargs": "^6.6.0"
} }
} }

View file

@ -1098,12 +1098,27 @@ duplexer2@0.0.2:
dependencies: dependencies:
readable-stream "~1.1.9" readable-stream "~1.1.9"
duplexify@^3.5.0:
version "3.5.0"
resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.5.0.tgz#1aa773002e1578457e9d9d4a50b0ccaaebcbd604"
dependencies:
end-of-stream "1.0.0"
inherits "^2.0.1"
readable-stream "^2.0.0"
stream-shift "^1.0.0"
ecc-jsbn@~0.1.1: ecc-jsbn@~0.1.1:
version "0.1.1" version "0.1.1"
resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz#0fc73a9ed5f0d53c38193398523ef7e543777505" resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz#0fc73a9ed5f0d53c38193398523ef7e543777505"
dependencies: dependencies:
jsbn "~0.1.0" jsbn "~0.1.0"
end-of-stream@1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.0.0.tgz#d4596e702734a93e40e9af864319eabd99ff2f0e"
dependencies:
once "~1.3.0"
end-of-stream@~0.1.5: end-of-stream@~0.1.5:
version "0.1.5" version "0.1.5"
resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-0.1.5.tgz#8e177206c3c80837d85632e8b9359dfe8b2f6eaf" resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-0.1.5.tgz#8e177206c3c80837d85632e8b9359dfe8b2f6eaf"
@ -1411,6 +1426,10 @@ forever-agent@~0.6.1:
version "0.6.1" version "0.6.1"
resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91"
fork-stream@^0.0.4:
version "0.0.4"
resolved "https://registry.yarnpkg.com/fork-stream/-/fork-stream-0.0.4.tgz#db849fce77f6708a5f8f386ae533a0907b54ae70"
form-data@~2.1.1: form-data@~2.1.1:
version "2.1.2" version "2.1.2"
resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.1.2.tgz#89c3534008b97eada4cbb157d58f6f5df025eae4" resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.1.2.tgz#89c3534008b97eada4cbb157d58f6f5df025eae4"
@ -1673,7 +1692,7 @@ graceful-fs@~1.2.0:
version "1.0.1" version "1.0.1"
resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725"
gulp-bump@^2.4.0: gulp-bump@^2.6.1:
version "2.6.1" version "2.6.1"
resolved "https://registry.yarnpkg.com/gulp-bump/-/gulp-bump-2.6.1.tgz#9d27a9ec0e1b8608c39bb41238a35e860281bb18" resolved "https://registry.yarnpkg.com/gulp-bump/-/gulp-bump-2.6.1.tgz#9d27a9ec0e1b8608c39bb41238a35e860281bb18"
dependencies: dependencies:
@ -1683,6 +1702,13 @@ gulp-bump@^2.4.0:
semver "^5.3.0" semver "^5.3.0"
through2 "^2.0.1" through2 "^2.0.1"
"gulp-colorize-svgs@git+https://git@github.com/unic/gulp-colorize-svgs.git":
version "0.1.0"
resolved "git+https://git@github.com/unic/gulp-colorize-svgs.git#c4fe69a9771f149a9ae720277246710470c2bd01"
dependencies:
gulp-util "^3.0.4"
lodash "^3.6.0"
gulp-conventional-changelog@^1.1.0: gulp-conventional-changelog@^1.1.0:
version "1.1.0" version "1.1.0"
resolved "https://registry.yarnpkg.com/gulp-conventional-changelog/-/gulp-conventional-changelog-1.1.0.tgz#0aae0c02da3ec45a7b4fe258295e491b47ffa202" resolved "https://registry.yarnpkg.com/gulp-conventional-changelog/-/gulp-conventional-changelog-1.1.0.tgz#0aae0c02da3ec45a7b4fe258295e491b47ffa202"
@ -1694,6 +1720,20 @@ gulp-conventional-changelog@^1.1.0:
object-assign "^4.0.1" object-assign "^4.0.1"
through2 "^2.0.0" through2 "^2.0.0"
gulp-if@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/gulp-if/-/gulp-if-2.0.2.tgz#a497b7e7573005041caa2bc8b7dda3c80444d629"
dependencies:
gulp-match "^1.0.3"
ternary-stream "^2.0.1"
through2 "^2.0.1"
gulp-match@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/gulp-match/-/gulp-match-1.0.3.tgz#91c7c0d7f29becd6606d57d80a7f8776a87aba8e"
dependencies:
minimatch "^3.0.3"
gulp-stats@^0.0.4: gulp-stats@^0.0.4:
version "0.0.4" version "0.0.4"
resolved "https://registry.yarnpkg.com/gulp-stats/-/gulp-stats-0.0.4.tgz#f216c2bc079cb890cebf5d6aaa3b1eb397d12bab" resolved "https://registry.yarnpkg.com/gulp-stats/-/gulp-stats-0.0.4.tgz#f216c2bc079cb890cebf5d6aaa3b1eb397d12bab"
@ -1702,7 +1742,7 @@ gulp-stats@^0.0.4:
pretty-hrtime "^1.0.0" pretty-hrtime "^1.0.0"
text-table "^0.2.0" text-table "^0.2.0"
gulp-util@*, gulp-util@^3.0.0, gulp-util@^3.0.6, gulp-util@^3.0.7: gulp-util@*, gulp-util@^3.0.0, gulp-util@^3.0.4, gulp-util@^3.0.6, gulp-util@^3.0.7:
version "3.0.8" version "3.0.8"
resolved "https://registry.yarnpkg.com/gulp-util/-/gulp-util-3.0.8.tgz#0054e1e744502e27c04c187c3ecc505dd54bbb4f" resolved "https://registry.yarnpkg.com/gulp-util/-/gulp-util-3.0.8.tgz#0054e1e744502e27c04c187c3ecc505dd54bbb4f"
dependencies: dependencies:
@ -2332,6 +2372,10 @@ lodash.templatesettings@^4.0.0:
dependencies: dependencies:
lodash._reinterpolate "~3.0.0" lodash._reinterpolate "~3.0.0"
lodash@^3.6.0:
version "3.10.1"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6"
lodash@^4.0.0, lodash@^4.2.0, lodash@^4.2.1, lodash@^4.3.0: lodash@^4.0.0, lodash@^4.2.0, lodash@^4.2.1, lodash@^4.3.0:
version "4.17.4" version "4.17.4"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"
@ -2384,6 +2428,12 @@ meow@^3.3.0:
redent "^1.0.0" redent "^1.0.0"
trim-newlines "^1.0.0" trim-newlines "^1.0.0"
merge-stream@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-1.0.1.tgz#4041202d508a342ba00174008df0c251b8c135e1"
dependencies:
readable-stream "^2.0.1"
micromatch@^2.1.5, micromatch@^2.3.7: micromatch@^2.1.5, micromatch@^2.3.7:
version "2.3.11" version "2.3.11"
resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565"
@ -2418,7 +2468,7 @@ minimatch@^2.0.1:
dependencies: dependencies:
brace-expansion "^1.0.0" brace-expansion "^1.0.0"
minimatch@^3.0.0, minimatch@^3.0.2: minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3:
version "3.0.3" version "3.0.3"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774"
dependencies: dependencies:
@ -2782,7 +2832,7 @@ read-pkg@^1.0.0, read-pkg@^1.1.0:
isarray "0.0.1" isarray "0.0.1"
string_decoder "~0.10.x" string_decoder "~0.10.x"
"readable-stream@^2.0.0 || ^1.1.13", readable-stream@^2.0.2, readable-stream@^2.1.5, readable-stream@^2.2.2: readable-stream@^2.0.0, "readable-stream@^2.0.0 || ^1.1.13", readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.1.5, readable-stream@^2.2.2:
version "2.2.2" version "2.2.2"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.2.tgz#a9e6fec3c7dda85f8bb1b3ba7028604556fc825e" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.2.tgz#a9e6fec3c7dda85f8bb1b3ba7028604556fc825e"
dependencies: dependencies:
@ -3114,6 +3164,10 @@ stream-consume@~0.1.0:
version "0.1.0" version "0.1.0"
resolved "https://registry.yarnpkg.com/stream-consume/-/stream-consume-0.1.0.tgz#a41ead1a6d6081ceb79f65b061901b6d8f3d1d0f" resolved "https://registry.yarnpkg.com/stream-consume/-/stream-consume-0.1.0.tgz#a41ead1a6d6081ceb79f65b061901b6d8f3d1d0f"
stream-shift@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.0.tgz#d5c752825e5367e786f78e18e445ea223a155952"
string-width@^1.0.1, string-width@^1.0.2: string-width@^1.0.1, string-width@^1.0.2:
version "1.0.2" version "1.0.2"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3"
@ -3227,6 +3281,15 @@ tar@~2.2.1:
fstream "^1.0.2" fstream "^1.0.2"
inherits "2" inherits "2"
ternary-stream@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/ternary-stream/-/ternary-stream-2.0.1.tgz#064e489b4b5bf60ba6a6b7bc7f2f5c274ecf8269"
dependencies:
duplexify "^3.5.0"
fork-stream "^0.0.4"
merge-stream "^1.0.0"
through2 "^2.0.1"
text-extensions@^1.0.0: text-extensions@^1.0.0:
version "1.4.0" version "1.4.0"
resolved "https://registry.yarnpkg.com/text-extensions/-/text-extensions-1.4.0.tgz#c385d2e80879fe6ef97893e1709d88d9453726e9" resolved "https://registry.yarnpkg.com/text-extensions/-/text-extensions-1.4.0.tgz#c385d2e80879fe6ef97893e1709d88d9453726e9"
@ -3475,7 +3538,7 @@ yargs-parser@^4.2.0:
dependencies: dependencies:
camelcase "^3.0.0" camelcase "^3.0.0"
yargs@^6.0.0: yargs@^6.6.0:
version "6.6.0" version "6.6.0"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-6.6.0.tgz#782ec21ef403345f830a808ca3d513af56065208" resolved "https://registry.yarnpkg.com/yargs/-/yargs-6.6.0.tgz#782ec21ef403345f830a808ca3d513af56065208"
dependencies: dependencies: