@@ -13,8 +13,7 @@ const path = require("path");
1313const fs = require ( "fs" ) ;
1414const es = require ( "event-stream" ) ;
1515const runSequence = require ( "run-sequence" ) ;
16- // const iconLoader = require("@peretz/icon-loader");
17- // const through = require("through2");
16+
1817//
1918// Variables
2019// =================================
@@ -25,8 +24,6 @@ const dirs = {
2524 "!src/**/*.stories.ts"
2625 ] ,
2726 i18n : "src/i18n/**/*.json" ,
28- FONTS : "node_modules/@peretz/matter/fonts/**/*" ,
29- DEMO : "demo" ,
3027 DIST : "dist"
3128} ;
3229
@@ -57,7 +54,6 @@ const licenseTemplate = `/*!
5754gulp . task ( "build:angular" , _ =>
5855 gulp . src ( dirs . TS )
5956 . pipe ( replaceTemplates ( ) )
60- // .pipe(replaceIcons())
6157 . pipe ( gulp . dest ( `${ dirs . DIST } /src` ) )
6258) ;
6359
@@ -83,7 +79,6 @@ gulp.task("build:license", _ =>
8379
8480gulp . task ( "build:package" , _ =>
8581 gulp . src ( "package.json" )
86- . pipe ( version ( ) )
8782 . pipe ( gulp . dest ( dirs . DIST ) )
8883) ;
8984
@@ -97,14 +92,6 @@ gulp.task("build:changelog", _ =>
9792 . pipe ( gulp . dest ( dirs . DIST ) )
9893) ;
9994
100- //
101- // Demo tasks
102- // =================================
103- gulp . task ( "demo:font" , _ =>
104- gulp . src ( dirs . FONTS )
105- . pipe ( gulp . dest ( `${ dirs . DEMO } /fonts` ) )
106- ) ;
107-
10895//
10996// Running tasks
11097// =================================
@@ -114,8 +101,6 @@ gulp.task("build:meta", _ =>
114101 runSequence ( "build:package" , [ "build:license" , "build:readme" , "build:changelog" ] )
115102) ;
116103
117- gulp . task ( "demo" , [ "demo:font" ] ) ;
118-
119104//
120105// Functions
121106// =================================
@@ -130,48 +115,6 @@ function licenseHeaders() {
130115 } ) ;
131116}
132117
133- function version ( ) {
134- return tap ( function ( file ) {
135- let packageJSON = JSON . parse ( file . contents . toString ( "utf-8" ) ) ;
136- if ( process . env . TRAVIS ) {
137- // assume beta release on cron
138- if ( process . env . TRAVIS_EVENT_TYPE === "cron" ) {
139- const build = process . env . TRAVIS_BUILD_NUMBER ; // we'll use the build number so we dont have to think about versions
140- packageJSON . version = `${ packageJSON . version } -beta.${ build } ` ;
141- // release to alpha unless it's building from a tag
142- } else if ( ! process . env . TRAVIS_TAG ) {
143- const commit = process . env . TRAVIS_COMMIT ; // we'll just slice up the commit a bit
144- packageJSON . version = `${ packageJSON . version } -alpha.${ commit . slice ( 0 , 5 ) } ` ;
145- }
146- }
147- // otherwise we'll do a standard release with whatever version is in the package.json
148- file . contents = new Buffer ( JSON . stringify ( packageJSON ) ) ;
149- } ) ;
150- }
151-
152- // custom gulp plugin
153- // TODO: add to icon-loader
154- // function replaceIcons() {
155- // return through.obj(function (file, enc, cb) {
156- // if (file.isNull()) {
157- // return cb(null, file);
158- // }
159- // let asyncTrue = false;
160- // iconLoader.prototype.async = function () {
161- // asyncTrue = true;
162- // };
163- // iconLoader.prototype.callback = function (error, result) {
164- // file.contents = new Buffer(result);
165- // cb(null, file);
166- // };
167- // new iconLoader(file.contents.toString());
168- // // no async means no processing, means return the file!
169- // if (!asyncTrue) {
170- // cb(null, file);
171- // }
172- // });
173- // }
174-
175118function replaceTemplates ( ) {
176119 // regex borrwed from https://github.com/TheLarkInn/angular2-template-loader/blob/1403302e985bf689ee49e9dd8bb953225f32737b/index.js#L5-L7
177120 const templateUrlRegex = / t e m p l a t e U r l \s * : ( \s * [ ' " ` ] ( .* ?) [ ' " ` ] ) / g;
0 commit comments