Comparing version 5.0.0-beta.5 to 5.0.0-beta.6
@@ -5,3 +5,3 @@ { | ||
"description": "Compile and manage your TypeScript project", | ||
"version": "5.0.0-beta.5", | ||
"version": "5.0.0-beta.6", | ||
"homepage": "https://github.com/grunt-ts/grunt-ts", | ||
@@ -8,0 +8,0 @@ "repository": { |
@@ -85,3 +85,3 @@ /// <reference path="../../defs/tsd.d.ts"/> | ||
newFiles = getChangedFiles(files, options.targetName); | ||
if (newFiles.length !== 0 || options.testExecute) { | ||
if (newFiles.length !== 0 || options.testExecute || utils.shouldPassThrough(options)) { | ||
files = newFiles; | ||
@@ -88,0 +88,0 @@ // If outDir is specified but no baseDir is specified we need to determine one |
@@ -110,3 +110,3 @@ /// <reference path="../../defs/tsd.d.ts"/> | ||
if (newFiles.length !== 0 || options.testExecute) { | ||
if (newFiles.length !== 0 || options.testExecute || utils.shouldPassThrough(options)) { | ||
files = newFiles; | ||
@@ -113,0 +113,0 @@ |
@@ -209,11 +209,24 @@ 'use strict'; | ||
if (!globExpander.isStub) { | ||
// if files is not specified, default to including *.ts and *.tsx in folder and subfolders. | ||
var virtualGlob = [path.resolve(absolutePathToTSConfig, './**/*.ts'), | ||
path.resolve(absolutePathToTSConfig, './**/*.tsx')]; | ||
var virtualGlob = []; | ||
if (projectSpec.exclude && _.isArray(projectSpec.exclude)) { | ||
virtualGlob.push(path.resolve(absolutePathToTSConfig, './*.ts')); | ||
virtualGlob.push(path.resolve(absolutePathToTSConfig, './*.tsx')); | ||
var tsconfigExcludedDirectories = []; | ||
projectSpec.exclude.forEach(function (exc) { | ||
virtualGlob.push('!' + path.resolve(absolutePathToTSConfig, exc, './**/*.ts')); | ||
virtualGlob.push('!' + path.resolve(absolutePathToTSConfig, exc, './**/*.tsx')); | ||
tsconfigExcludedDirectories.push(path.normalize(path.join(absolutePathToTSConfig, exc))); | ||
}); | ||
fs.readdirSync(absolutePathToTSConfig).forEach(function (item) { | ||
var filePath = path.normalize(path.join(absolutePathToTSConfig, item)); | ||
if (fs.statSync(filePath).isDirectory()) { | ||
if (tsconfigExcludedDirectories.indexOf(filePath) === -1) { | ||
virtualGlob.push(path.resolve(absolutePathToTSConfig, item, './**/*.ts')); | ||
virtualGlob.push(path.resolve(absolutePathToTSConfig, item, './**/*.tsx')); | ||
} | ||
} | ||
}); | ||
} | ||
else { | ||
virtualGlob.push(path.resolve(absolutePathToTSConfig, './**/*.ts')); | ||
virtualGlob.push(path.resolve(absolutePathToTSConfig, './**/*.tsx')); | ||
} | ||
var files = globExpander(virtualGlob); | ||
@@ -220,0 +233,0 @@ // make files relative to the tsconfig.json file |
@@ -237,10 +237,25 @@ 'use strict'; | ||
if (!(<any>globExpander).isStub) { | ||
// if files is not specified, default to including *.ts and *.tsx in folder and subfolders. | ||
const virtualGlob = [path.resolve(absolutePathToTSConfig, './**/*.ts'), | ||
path.resolve(absolutePathToTSConfig, './**/*.tsx')]; | ||
const virtualGlob: string[] = []; | ||
if (projectSpec.exclude && _.isArray(projectSpec.exclude)) { | ||
projectSpec.exclude.forEach(exc => { | ||
virtualGlob.push('!' + path.resolve(absolutePathToTSConfig, exc, './**/*.ts')); | ||
virtualGlob.push('!' + path.resolve(absolutePathToTSConfig, exc, './**/*.tsx')); | ||
}); | ||
virtualGlob.push(path.resolve(absolutePathToTSConfig, './*.ts')); | ||
virtualGlob.push(path.resolve(absolutePathToTSConfig, './*.tsx')); | ||
const tsconfigExcludedDirectories: string[] = []; | ||
projectSpec.exclude.forEach(exc => { | ||
tsconfigExcludedDirectories.push(path.normalize(path.join(absolutePathToTSConfig, exc))); | ||
}); | ||
fs.readdirSync(absolutePathToTSConfig).forEach(item => { | ||
const filePath = path.normalize(path.join(absolutePathToTSConfig, item)); | ||
if (fs.statSync(filePath).isDirectory()) { | ||
if (tsconfigExcludedDirectories.indexOf(filePath) === -1) { | ||
virtualGlob.push(path.resolve(absolutePathToTSConfig, item, './**/*.ts')); | ||
virtualGlob.push(path.resolve(absolutePathToTSConfig, item, './**/*.tsx')); | ||
} | ||
} | ||
}); | ||
} else { | ||
virtualGlob.push(path.resolve(absolutePathToTSConfig, './**/*.ts')); | ||
virtualGlob.push(path.resolve(absolutePathToTSConfig, './**/*.tsx')); | ||
} | ||
@@ -247,0 +262,0 @@ |
@@ -368,2 +368,10 @@ /// <reference path="../../defs/tsd.d.ts"/> | ||
exports.readAndParseJSONFromFileSync = readAndParseJSONFromFileSync; | ||
function shouldCompile(options) { | ||
return !!options.compile; | ||
} | ||
exports.shouldCompile = shouldCompile; | ||
function shouldPassThrough(options) { | ||
return (options.tsconfig && options.tsconfig.passThrough); | ||
} | ||
exports.shouldPassThrough = shouldPassThrough; | ||
//# sourceMappingURL=utils.js.map |
@@ -390,1 +390,10 @@ /// <reference path="../../defs/tsd.d.ts"/> | ||
} | ||
export function shouldCompile(options: IGruntTSOptions) { | ||
return !!options.compile; | ||
} | ||
export function shouldPassThrough(options: IGruntTSOptions) { | ||
return (options.tsconfig && (<ITSConfigSupport>options.tsconfig).passThrough); | ||
} |
@@ -190,4 +190,10 @@ /// <reference path="../defs/tsd.d.ts"/> | ||
grunt.log.writeln(''); | ||
grunt.log.writeln(('TypeScript compilation complete: ' + time.toFixed(2) + | ||
's for ' + result.fileCount + ' typescript files').green); | ||
var message = 'TypeScript compilation complete: ' + time.toFixed(2) + 's'; | ||
if (utils.shouldPassThrough(options)) { | ||
message += ' for TypeScript pass-through.'; | ||
} | ||
else { | ||
message += ' for ' + result.fileCount + ' TypeScript files.'; | ||
} | ||
grunt.log.writeln(message.green); | ||
} | ||
@@ -287,4 +293,4 @@ else { | ||
// Return promise to compliation | ||
if (options.compile) { | ||
if (filesToCompile.length > 0 || options.testExecute) { | ||
if (utils.shouldCompile(options)) { | ||
if (filesToCompile.length > 0 || options.testExecute || utils.shouldPassThrough(options)) { | ||
return runCompilation(options, currentFiles).then(function (success) { | ||
@@ -291,0 +297,0 @@ return success; |
@@ -233,4 +233,9 @@ /// <reference path="../defs/tsd.d.ts"/> | ||
grunt.log.writeln(''); | ||
grunt.log.writeln(('TypeScript compilation complete: ' + time.toFixed(2) + | ||
's for ' + result.fileCount + ' typescript files').green); | ||
let message = 'TypeScript compilation complete: ' + time.toFixed(2) + 's'; | ||
if (utils.shouldPassThrough(options)) { | ||
message += ' for TypeScript pass-through.'; | ||
} else { | ||
message += ' for ' + result.fileCount + ' TypeScript files.'; | ||
} | ||
grunt.log.writeln(message.green); | ||
} else { | ||
@@ -353,4 +358,4 @@ // Report unsuccessful build. | ||
// Return promise to compliation | ||
if (options.compile) { | ||
if (filesToCompile.length > 0 || options.testExecute) { | ||
if (utils.shouldCompile(options)) { | ||
if (filesToCompile.length > 0 || options.testExecute || utils.shouldPassThrough(options)) { | ||
return runCompilation(options, currentFiles).then((success: boolean) => { | ||
@@ -357,0 +362,0 @@ return success; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
534302
5521