Skip to content

Commit 4fd0281

Browse files
committed
Merge pull request #193 from nycdotnet/master
Updates for 2.0.1
2 parents 836c961 + cbadc73 commit 4fd0281

File tree

6 files changed

+28
-7
lines changed

6 files changed

+28
-7
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
## Next
44

5+
## v2.0.1
6+
* FIX: Compatibility with TypeScript 1.3 exit codes (#189).
7+
* FIX: Show issue count in red if failOnTypeError option is set and there are non-emit preventing errors (#189).
8+
* FIX: Fixed bad `failontypeerror` test. (Used incorrect location for parameter in Gruntfile.js).
9+
510
## v2.0.0
611
* DOCS: Major documentation overhaul (https://github.com/TypeStrong/grunt-ts/pull/185)
712
* DOCS: More sample config for gruntfile (https://github.com/TypeStrong/grunt-ts/pull/166)

Gruntfile.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,14 @@ module.exports = function (grunt) {
321321
compiler: './customcompiler/tsc'
322322
}
323323
},
324+
continueIfTypeErrorAndNoFailOnTypeErrors: {
325+
test: true,
326+
src: ['test/failontypeerror/**/*.ts'],
327+
outDir: 'test/failontypeerror/js',
328+
options: {
329+
failOnTypeErrors: false
330+
}
331+
},
324332
fail: {
325333
fail: true, // a designed to fail target
326334
src: ['test/fail/**/*.ts'],
@@ -331,11 +339,13 @@ module.exports = function (grunt) {
331339
sourcemap: false
332340
}
333341
},
334-
failontypeerror: {
342+
failOnTypeErrors: {
335343
fail: true,
336-
failOnTypeError: true,
337344
src: ['test/failontypeerror/**/*.ts'],
338345
outDir: 'test/failontypeerror/js',
346+
options: {
347+
failOnTypeErrors: true
348+
}
339349
},
340350
files_testfailedcompilation: {
341351
fail: true, // a designed to fail target

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -795,6 +795,7 @@ $ grunt upgrade
795795

796796
### Publishing Checklist
797797

798+
* Run `grunt release` and ensure it comes back clean (should finish but with warnings).
798799
* Update the version in package.json.
799800
* Update CHANGELOG.md.
800801
* Commit to master.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"author": "basarat",
33
"name": "grunt-ts",
44
"description": "Compile and manage your TypeScript project",
5-
"version": "2.0.0",
5+
"version": "2.0.1",
66
"homepage": "https://github.com/grunt-ts/grunt-ts",
77
"repository": {
88
"type": "git",

tasks/ts.js

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tasks/ts.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,9 @@ function pluginFn(grunt: IGrunt) {
302302
return false;
303303
}
304304

305+
// In TypeScript 1.3 and above, the result code corresponds to the ExitCode enum in
306+
// TypeScript/src/compiler/sys.ts
307+
305308
var isError = (result.code !== 0);
306309

307310
// If the compilation errors contain only type errors, JS files are still
@@ -333,7 +336,7 @@ function pluginFn(grunt: IGrunt) {
333336

334337
// Log error summary
335338
if (level1ErrorCount + level5ErrorCount + nonEmitPreventingWarningCount > 0) {
336-
if (level1ErrorCount + level5ErrorCount > 0) {
339+
if ((level1ErrorCount + level5ErrorCount > 0) || options.failOnTypeErrors) {
337340
grunt.log.write(('>> ').red);
338341
} else {
339342
grunt.log.write(('>> ').green);
@@ -355,7 +358,7 @@ function pluginFn(grunt: IGrunt) {
355358

356359
grunt.log.writeln('');
357360

358-
if (isOnlyTypeErrors) {
361+
if (isOnlyTypeErrors && !options.failOnTypeErrors) {
359362
grunt.log.write(('>> ').green);
360363
grunt.log.writeln('Type errors only.');
361364
}

0 commit comments

Comments
 (0)