Comparing version 4.0.0 to 4.0.1
@@ -5,2 +5,9 @@ # Releases | ||
## v4.0.1 | ||
* FIX: Corrected an issue introduced in 4.0.0 where Grunt transforms were not running on `out`, `outDir`, `reference`, `mapRoot`, or `sourceRoot`. (#220 - thanks to paulgambrell and JoeFirebaugh for the report.) | ||
* FIX: An empty compile step was getting called once per project file if `vs` was used; this has been corrected. | ||
* FIX: Ignored a dev-only directory for npm. | ||
* FIX: Comments will now be preserved when using `vs` unless RemoveComments is explicitly set in the Visual Studio project. | ||
* DOCS: Clarified that Compile on Save is not necessarily disabled if you follow the instructions to disable the Visual Studio TypeScript build (but it can be disabled if desired). | ||
## v4.0.0 | ||
@@ -7,0 +14,0 @@ * FEAT: Now supports parsing and compiling directly against the TypeScript files and configuration specified in a Visual Studio project file - .csproj or .vbproj. Visual Studio *not* required and files list/config override-able, ignorable and extend-able. (https://github.com/TypeStrong/grunt-ts/pull/215) |
@@ -31,5 +31,2 @@ # How to disable the Visual Studio TypeScript Build | ||
* Finally, press Ctrl+Shift+B to initiate a build. If the build succeeds, you've successfully disabled the TypeScript compilation in Visual Studio. Run Grunt to build your project and it should fail. Fix the error and Grunt should then succeed (assuming it was prior to you making these changes). | ||
* Note that "Compile on Save" *will still work* with the Visual Studio TypeScript Build disabled. If you don't want Visual Studio to *ever* write TypeScript-emitted JavaScript files to disk, you will also need to disable "Compile on Save" in each project and configuration via the TypeScript Build pane. |
@@ -5,3 +5,3 @@ { | ||
"description": "Compile and manage your TypeScript project", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"homepage": "https://github.com/grunt-ts/grunt-ts", | ||
@@ -8,0 +8,0 @@ "repository": { |
@@ -143,2 +143,5 @@ /// <reference path="../defs/tsd.d.ts"/> | ||
} | ||
else { | ||
options.comments = true; | ||
} | ||
options.sourceMap = utils.firstElementWithValue([vsProjectTypeScriptSettings.SourceMap, options.sourceMap]); | ||
@@ -157,9 +160,9 @@ options.sourceRoot = utils.firstElementWithValue([vsProjectTypeScriptSettings.SourceRoot, options.sourceRoot]); | ||
var relativePathToFile = path.relative(path.resolve('.'), absolutePathToFile).replace(new RegExp('\\' + path.sep, 'g'), '/'); | ||
if (srcFromVS_RelativePathsFromGruntFile.indexOf(relativePathToFile) === -1) { | ||
if (srcFromVS_RelativePathsFromGruntFile.indexOf(relativePathToFile) === -1 && currenttask.filesSrc.indexOf(relativePathToFile) === -1) { | ||
srcFromVS_RelativePathsFromGruntFile.push(relativePathToFile); | ||
} | ||
if (currenttask.files.indexOf(relativePathToFile) === -1) { | ||
currenttask.files.push(relativePathToFile); | ||
} | ||
}); | ||
if (srcFromVS_RelativePathsFromGruntFile.length > 0) { | ||
currenttask.files.push({ src: srcFromVS_RelativePathsFromGruntFile }); | ||
} | ||
} | ||
@@ -244,5 +247,5 @@ if (!vs.ignoreSettings) { | ||
} | ||
function getTargetOutOrElseTryTargetDest(target) { | ||
var o = target.out; | ||
if (!o) { | ||
function fetchTargetOutOrElseTryTargetDest(target) { | ||
var targetout = target.out; | ||
if (!targetout) { | ||
if (target.dest) { | ||
@@ -253,18 +256,17 @@ if (Array.isArray(target.dest)) { | ||
// the first one. | ||
return target.dest[0]; | ||
targetout = target.dest[0]; | ||
} | ||
} | ||
else if (utils.isJavaScriptFile(target.dest)) { | ||
o = target.dest; | ||
targetout = target.dest; | ||
} | ||
} | ||
} | ||
return o; | ||
return targetout; | ||
} | ||
// Create an output file? | ||
var out = getTargetOutOrElseTryTargetDest(rawTargetConfig); | ||
var outFile; | ||
var outFile = fetchTargetOutOrElseTryTargetDest(rawTargetConfig); | ||
var outFile_d_ts; | ||
if (!!out) { | ||
outFile = path.resolve(out); | ||
if (!!outFile) { | ||
outFile = path.resolve(rawTargetConfig.out); | ||
outFile_d_ts = outFile.replace('.js', '.d.ts'); | ||
@@ -293,2 +295,3 @@ } | ||
} | ||
processAllTemplates(rawTargetConfig, rawTargetOptions); | ||
// Compiles all the files | ||
@@ -588,2 +591,15 @@ // Uses the blind tsc compile task | ||
} | ||
function processAllTemplates(targetCfg, targetOpt) { | ||
targetCfg.out = processTemplate(targetCfg.out); | ||
targetCfg.outDir = processTemplate(targetCfg.outDir); | ||
targetCfg.reference = processTemplate(targetCfg.reference); | ||
targetOpt.mapRoot = processTemplate(targetOpt.mapRoot); | ||
targetOpt.sourceRoot = processTemplate(targetOpt.sourceRoot); | ||
} | ||
function processTemplate(template) { | ||
if (template) { | ||
return grunt.template.process(template, {}); | ||
} | ||
return template; | ||
} | ||
function getVSSettings(rawTargetOptions) { | ||
@@ -590,0 +606,0 @@ var vs = null; |
@@ -151,3 +151,3 @@ /// <reference path="../defs/tsd.d.ts"/> | ||
function proceed(vsProjectTypeScriptSettings? : csproj2ts.TypeScriptSettings) { | ||
function proceed(vsProjectTypeScriptSettings?: csproj2ts.TypeScriptSettings) { | ||
@@ -183,2 +183,4 @@ if (vsProjectTypeScriptSettings && !vs.ignoreSettings) { | ||
options.comments = null; | ||
} else { | ||
options.comments = true; | ||
} | ||
@@ -207,9 +209,13 @@ | ||
var relativePathToFile = path.relative(path.resolve('.'), absolutePathToFile).replace(new RegExp('\\' + path.sep, 'g'), '/'); | ||
if (srcFromVS_RelativePathsFromGruntFile.indexOf(relativePathToFile) === -1) { | ||
if (srcFromVS_RelativePathsFromGruntFile.indexOf(relativePathToFile) === -1 && | ||
currenttask.filesSrc.indexOf(relativePathToFile) === -1) { | ||
srcFromVS_RelativePathsFromGruntFile.push(relativePathToFile); | ||
} | ||
if (currenttask.files.indexOf(relativePathToFile) === -1) { | ||
currenttask.files.push(relativePathToFile); | ||
} | ||
}); | ||
if (srcFromVS_RelativePathsFromGruntFile.length > 0) { | ||
currenttask.files.push({ src: srcFromVS_RelativePathsFromGruntFile }); | ||
} | ||
} | ||
@@ -313,5 +319,5 @@ | ||
function getTargetOutOrElseTryTargetDest(target: ITargetOptions) { | ||
var o = target.out; | ||
if (!o) { | ||
function fetchTargetOutOrElseTryTargetDest(target: ITargetOptions) { | ||
var targetout = target.out; | ||
if (!targetout) { | ||
if (target.dest) { | ||
@@ -322,19 +328,18 @@ if (Array.isArray(target.dest)) { | ||
// the first one. | ||
return (<string[]><any>target.dest)[0]; | ||
targetout = (<string[]><any>target.dest)[0]; | ||
} | ||
} else if (utils.isJavaScriptFile(target.dest)) { | ||
o = target.dest; | ||
targetout = target.dest; | ||
} | ||
} | ||
} | ||
return o; | ||
return targetout; | ||
} | ||
// Create an output file? | ||
var out = getTargetOutOrElseTryTargetDest(rawTargetConfig); | ||
var outFile = fetchTargetOutOrElseTryTargetDest(rawTargetConfig); | ||
var outFile_d_ts: string; | ||
var outFile; | ||
var outFile_d_ts; | ||
if (!!out) { | ||
outFile = path.resolve(out); | ||
if (!!outFile) { | ||
outFile = path.resolve(rawTargetConfig.out); | ||
outFile_d_ts = outFile.replace('.js', '.d.ts'); | ||
@@ -368,2 +373,4 @@ } | ||
processAllTemplates(rawTargetConfig, rawTargetOptions); | ||
// Compiles all the files | ||
@@ -697,4 +704,4 @@ // Uses the blind tsc compile task | ||
function logBadConfigWithFiles(config: ITargetOptions, | ||
task: grunt.task.IMultiTask<ITargetOptions>, | ||
targetOpt: ITaskOptions) { | ||
task: grunt.task.IMultiTask<ITargetOptions>, | ||
targetOpt: ITaskOptions) { | ||
if (config.files) { | ||
@@ -733,2 +740,16 @@ if (config.vs) { | ||
function processAllTemplates(targetCfg: ITargetOptions, targetOpt: ITaskOptions) { | ||
targetCfg.out = processTemplate(targetCfg.out); | ||
targetCfg.outDir = processTemplate(targetCfg.outDir); | ||
targetCfg.reference = processTemplate(targetCfg.reference); | ||
targetOpt.mapRoot = processTemplate(targetOpt.mapRoot); | ||
targetOpt.sourceRoot = processTemplate(targetOpt.sourceRoot); | ||
} | ||
function processTemplate(template: string) { | ||
if (template) { | ||
return grunt.template.process(template, {}); | ||
} | ||
return template; | ||
} | ||
function getVSSettings(rawTargetOptions: ITargetOptions) { | ||
@@ -735,0 +756,0 @@ var vs: IVisualStudioProjectSupport = null; |
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
327973
3866
39