From 49e50e2ce48f75ebacd43a2c4578f6e6739547d6 Mon Sep 17 00:00:00 2001 From: codependent Date: Fri, 31 Jul 2015 09:52:20 +0200 Subject: [PATCH 1/3] added emitDecoratorMetadata option --- README.md | 8 ++++++++ lib/compiler.js | 4 +++- package.json | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b217bbb..c437e3f 100644 --- a/README.md +++ b/README.md @@ -280,6 +280,14 @@ By default, gulp-tsc ignores warnings from tsc command and emits compiled js fil If set this option to true, gulp-tsc never emits compiled files when tsc command returned warnings or errors. +#### options.emitDecoratorMetadata +Type: `Boolean` +Default: `false` + +`--emitDecoratorMetadata` option for `tsc` command. + +Emit decorator metadata. + ## Error handling If gulp-tsc fails to compile files, it emits `error` event with `gutil.PluginError` as the manner of gulp plugins. diff --git a/lib/compiler.js b/lib/compiler.js index 07a8dfe..225f8f1 100644 --- a/lib/compiler.js +++ b/lib/compiler.js @@ -43,7 +43,8 @@ function Compiler(sourceFiles, options) { noLib: false, keepTree: true, pathFilter: null, - safe: false + safe: false, + emitDecoratorMetadata: false, }, options); this.options.sourceMap = this.options.sourceMap || this.options.sourcemap; delete this.options.sourcemap; @@ -78,6 +79,7 @@ Compiler.prototype.buildTscArguments = function (version) { if (this.options.removeComments) args.push('--removeComments'); if (this.options.sourceMap) args.push('--sourcemap'); if (this.options.noLib) args.push('--noLib'); + if (this.options.emitDecoratorMetadata) args.push('--emitDecoratorMetadata'); if (this.tempDestination) { args.push('--outDir', this.tempDestination); diff --git a/package.json b/package.json index cd4d6b8..54b0093 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gulp-tsc", - "version": "1.0.0", + "version": "1.0.1", "author": "Kota Saito (https://github.com/kotas)", "copyright": "2014 Kota Saito", "contributors": [ From 7c8970e499826208d6e981990651a6a9bd2aedc7 Mon Sep 17 00:00:00 2001 From: codependent Date: Fri, 31 Jul 2015 10:28:03 +0200 Subject: [PATCH 2/3] back to 1.0.0 version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 54b0093..cd4d6b8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gulp-tsc", - "version": "1.0.1", + "version": "1.0.0", "author": "Kota Saito (https://github.com/kotas)", "copyright": "2014 Kota Saito", "contributors": [ From f3eff342102a7cfb72dfd31d8c75af9883e42d22 Mon Sep 17 00:00:00 2001 From: codependent Date: Fri, 31 Jul 2015 11:01:30 +0200 Subject: [PATCH 3/3] fixed test --- test-e2e/gulpfile.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/test-e2e/gulpfile.js b/test-e2e/gulpfile.js index e83db73..1bfc841 100644 --- a/test-e2e/gulpfile.js +++ b/test-e2e/gulpfile.js @@ -16,11 +16,8 @@ var abort = function (err) { throw err; }; var ignore = function (err) { }; var currentVersion = 'INVALID'; -var isVersion150 = function (version) { - var result = version === '1.5.0-alpha' - || version === '1.5.0-beta' - || version === '1.5.0'; - return result; +var isVersionGte150 = function (version) { + return version.indexOf('1.5.') === 0; } gulp.task('default', ['version', 'all']); @@ -94,7 +91,7 @@ gulp.task('test5', ['clean'], function () { return gulp.src('src-broken/error.ts') .pipe(typescript()).on('error', ignore) .pipe(gulp.dest('build/test5')) - .pipe(!isVersion150(currentVersion) + .pipe(!isVersionGte150(currentVersion) ? expect([]) : expect(['build/test5/error.js']) ); }); @@ -204,7 +201,7 @@ gulp.task('test15', ['clean'], function () { return gulp.src('src-broken/error.ts') .pipe(typescript({ emitError: false })) .pipe(gulp.dest('build/test15')) - .pipe(!isVersion150(currentVersion) + .pipe(!isVersionGte150(currentVersion) ? expect([]) : expect(['build/test15/error.js']) ); }); @@ -247,7 +244,7 @@ gulp.task('test17', ['clean'], function () { .pipe(gulp.dest('build/test17/s2')); return es.merge(one, two) - .pipe(!isVersion150(currentVersion) + .pipe(!isVersionGte150(currentVersion) ? expect(['build/test17/s2/b.js']) : expect(['build/test17/s1/error.js', 'build/test17/s2/b.js']) )