Socket
Socket
Sign inDemoInstall

grunt-ts

Package Overview
Dependencies
Maintainers
5
Versions
149
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-ts - npm Package Compare versions

Comparing version 5.0.0-beta.2 to 5.0.0-beta.3

2

package.json

@@ -5,3 +5,3 @@ {

"description": "Compile and manage your TypeScript project",
"version": "5.0.0-beta.2",
"version": "5.0.0-beta.3",
"homepage": "https://github.com/grunt-ts/grunt-ts",

@@ -8,0 +8,0 @@ "repository": {

@@ -130,109 +130,112 @@ /// <reference path="../../defs/tsd.d.ts"/>

var args = files.slice(0);
// boolean options
if (options.sourceMap) {
args.push('--sourcemap');
var tsconfig = options.tsconfig;
if (tsconfig && tsconfig.passThrough) {
args.push('--project', tsconfig.tsconfig);
}
if (options.emitDecoratorMetadata) {
args.push('--emitDecoratorMetadata');
}
if (options.declaration) {
args.push('--declaration');
}
if (options.removeComments) {
args.push('--removeComments');
}
if (options.noImplicitAny) {
args.push('--noImplicitAny');
}
if (options.noResolve) {
args.push('--noResolve');
}
if (options.noEmitOnError) {
args.push('--noEmitOnError');
}
if (options.preserveConstEnums) {
args.push('--preserveConstEnums');
}
if (options.suppressImplicitAnyIndexErrors) {
args.push('--suppressImplicitAnyIndexErrors');
}
if (options.noEmit) {
args.push('--noEmit');
}
if (options.inlineSources) {
args.push('--inlineSources');
}
if (options.inlineSourceMap) {
args.push('--inlineSourceMap');
}
if (options.newLine && !utils.newLineIsRedundant(options.newLine)) {
args.push('--newLine', options.newLine);
}
if (options.isolatedModules) {
args.push('--isolatedModules');
}
if (options.noEmitHelpers) {
args.push('--noEmitHelpers');
}
if (options.experimentalDecorators) {
args.push('--experimentalDecorators');
}
// string options
args.push('--target', options.target.toUpperCase());
// check the module compile option
if (options.module) {
var moduleOptionString = ('' + options.module).toLowerCase();
if ('amd|commonjs|system|umd'.indexOf(moduleOptionString) > -1) {
args.push('--module', moduleOptionString);
else {
if (options.sourceMap) {
args.push('--sourcemap');
}
else {
console.warn('WARNING: Option "module" only supports "amd" | "commonjs" | "system" | "umd" '.magenta);
if (options.emitDecoratorMetadata) {
args.push('--emitDecoratorMetadata');
}
}
if (compilationInfo.outDir) {
if (compilationInfo.out) {
console.warn('WARNING: Option "out" and "outDir" should not be used together'.magenta);
if (options.declaration) {
args.push('--declaration');
}
args.push('--outDir', compilationInfo.outDir);
}
if (compilationInfo.out) {
args.push('--out', compilationInfo.out);
}
if (compilationInfo.dest && (!compilationInfo.out) && (!compilationInfo.outDir)) {
if (utils.isJavaScriptFile(compilationInfo.dest)) {
args.push('--out', compilationInfo.dest);
if (options.removeComments) {
args.push('--removeComments');
}
else {
if (compilationInfo.dest === 'src') {
console.warn(('WARNING: Destination for target "' + options.targetName + '" is "src", which is the default. If you have' +
' forgotten to specify a "dest" parameter, please add it. If this is correct, you may wish' +
' to change the "dest" parameter to "src/" or just ignore this warning.').magenta);
if (options.noImplicitAny) {
args.push('--noImplicitAny');
}
if (options.noResolve) {
args.push('--noResolve');
}
if (options.noEmitOnError) {
args.push('--noEmitOnError');
}
if (options.preserveConstEnums) {
args.push('--preserveConstEnums');
}
if (options.suppressImplicitAnyIndexErrors) {
args.push('--suppressImplicitAnyIndexErrors');
}
if (options.noEmit) {
args.push('--noEmit');
}
if (options.inlineSources) {
args.push('--inlineSources');
}
if (options.inlineSourceMap) {
args.push('--inlineSourceMap');
}
if (options.newLine && !utils.newLineIsRedundant(options.newLine)) {
args.push('--newLine', options.newLine);
}
if (options.isolatedModules) {
args.push('--isolatedModules');
}
if (options.noEmitHelpers) {
args.push('--noEmitHelpers');
}
if (options.experimentalDecorators) {
args.push('--experimentalDecorators');
}
args.push('--target', options.target.toUpperCase());
if (options.module) {
var moduleOptionString = ('' + options.module).toLowerCase();
if ('amd|commonjs|system|umd'.indexOf(moduleOptionString) > -1) {
args.push('--module', moduleOptionString);
}
if (Array.isArray(compilationInfo.dest)) {
if (compilationInfo.dest.length === 0) {
else {
console.warn('WARNING: Option "module" only supports "amd" | "commonjs" | "system" | "umd" '.magenta);
}
}
if (compilationInfo.outDir) {
if (compilationInfo.out) {
console.warn('WARNING: Option "out" and "outDir" should not be used together'.magenta);
}
args.push('--outDir', compilationInfo.outDir);
}
if (compilationInfo.out) {
args.push('--out', compilationInfo.out);
}
if (compilationInfo.dest && (!compilationInfo.out) && (!compilationInfo.outDir)) {
if (utils.isJavaScriptFile(compilationInfo.dest)) {
args.push('--out', compilationInfo.dest);
}
else {
if (compilationInfo.dest === 'src') {
console.warn(('WARNING: Destination for target "' + options.targetName + '" is "src", which is the default. If you have' +
' forgotten to specify a "dest" parameter, please add it. If this is correct, you may wish' +
' to change the "dest" parameter to "src/" or just ignore this warning.').magenta);
}
else if (compilationInfo.dest.length > 0) {
console.warn((('WARNING: "dest" for target "' + options.targetName + '" is an array. This is not supported by the' +
' TypeScript compiler or grunt-ts.' +
((compilationInfo.dest.length > 1) ? ' Only the first "dest" will be used. The' +
' remaining items will be truncated.' : ''))).magenta);
args.push('--outDir', compilationInfo.dest[0]);
if (Array.isArray(compilationInfo.dest)) {
if (compilationInfo.dest.length === 0) {
}
else if (compilationInfo.dest.length > 0) {
console.warn((('WARNING: "dest" for target "' + options.targetName + '" is an array. This is not supported by the' +
' TypeScript compiler or grunt-ts.' +
((compilationInfo.dest.length > 1) ? ' Only the first "dest" will be used. The' +
' remaining items will be truncated.' : ''))).magenta);
args.push('--outDir', compilationInfo.dest[0]);
}
}
else {
args.push('--outDir', compilationInfo.dest);
}
}
else {
args.push('--outDir', compilationInfo.dest);
}
}
if (args.indexOf('--out') > -1 && args.indexOf('--module') > -1) {
console.warn(('WARNING: TypeScript does not allow external modules to be concatenated with' +
' --out. Any exported code may be truncated. See TypeScript issue #1544 for' +
' more details.').magenta);
}
if (options.sourceRoot) {
args.push('--sourceRoot', options.sourceRoot);
}
if (options.mapRoot) {
args.push('--mapRoot', options.mapRoot);
}
}
if (args.indexOf('--out') > -1 && args.indexOf('--module') > -1) {
console.warn(('WARNING: TypeScript does not allow external modules to be concatenated with' +
' --out. Any exported code may be truncated. See TypeScript issue #1544 for' +
' more details.').magenta);
}
if (options.sourceRoot) {
args.push('--sourceRoot', options.sourceRoot);
}
if (options.mapRoot) {
args.push('--mapRoot', options.mapRoot);
}
if (options.additionalFlags) {

@@ -239,0 +242,0 @@ args.push(options.additionalFlags);

@@ -162,116 +162,117 @@ /// <reference path="../../defs/tsd.d.ts"/>

var args: string[] = files.slice(0);
const tsconfig: ITSConfigSupport = options.tsconfig;
// boolean options
if (options.sourceMap) {
args.push('--sourcemap');
}
if (options.emitDecoratorMetadata) {
args.push('--emitDecoratorMetadata');
}
if (options.declaration) {
args.push('--declaration');
}
if (options.removeComments) {
args.push('--removeComments');
}
if (options.noImplicitAny) {
args.push('--noImplicitAny');
}
if (options.noResolve) {
args.push('--noResolve');
}
if (options.noEmitOnError) {
args.push('--noEmitOnError');
}
if (options.preserveConstEnums) {
args.push('--preserveConstEnums');
}
if (options.suppressImplicitAnyIndexErrors) {
args.push('--suppressImplicitAnyIndexErrors');
}
if (options.noEmit) {
args.push('--noEmit');
}
if (options.inlineSources) {
args.push('--inlineSources');
}
if (options.inlineSourceMap) {
args.push('--inlineSourceMap');
}
if (options.newLine && !utils.newLineIsRedundant(options.newLine)) {
args.push('--newLine', options.newLine);
}
if (options.isolatedModules) {
args.push('--isolatedModules');
}
if (options.noEmitHelpers) {
args.push('--noEmitHelpers');
}
if (options.experimentalDecorators) {
args.push('--experimentalDecorators');
}
if (tsconfig && tsconfig.passThrough) {
args.push('--project', tsconfig.tsconfig);
} else {
if (options.sourceMap) {
args.push('--sourcemap');
}
if (options.emitDecoratorMetadata) {
args.push('--emitDecoratorMetadata');
}
if (options.declaration) {
args.push('--declaration');
}
if (options.removeComments) {
args.push('--removeComments');
}
if (options.noImplicitAny) {
args.push('--noImplicitAny');
}
if (options.noResolve) {
args.push('--noResolve');
}
if (options.noEmitOnError) {
args.push('--noEmitOnError');
}
if (options.preserveConstEnums) {
args.push('--preserveConstEnums');
}
if (options.suppressImplicitAnyIndexErrors) {
args.push('--suppressImplicitAnyIndexErrors');
}
if (options.noEmit) {
args.push('--noEmit');
}
if (options.inlineSources) {
args.push('--inlineSources');
}
if (options.inlineSourceMap) {
args.push('--inlineSourceMap');
}
if (options.newLine && !utils.newLineIsRedundant(options.newLine)) {
args.push('--newLine', options.newLine);
}
if (options.isolatedModules) {
args.push('--isolatedModules');
}
if (options.noEmitHelpers) {
args.push('--noEmitHelpers');
}
if (options.experimentalDecorators) {
args.push('--experimentalDecorators');
}
// string options
args.push('--target', options.target.toUpperCase());
args.push('--target', options.target.toUpperCase());
// check the module compile option
if (options.module) {
let moduleOptionString: string = ('' + options.module).toLowerCase();
if ('amd|commonjs|system|umd'.indexOf(moduleOptionString) > -1) {
args.push('--module', moduleOptionString);
} else {
console.warn('WARNING: Option "module" only supports "amd" | "commonjs" | "system" | "umd" '.magenta);
}
}
if (options.module) {
let moduleOptionString: string = ('' + options.module).toLowerCase();
if ('amd|commonjs|system|umd'.indexOf(moduleOptionString) > -1) {
args.push('--module', moduleOptionString);
} else {
console.warn('WARNING: Option "module" only supports "amd" | "commonjs" | "system" | "umd" '.magenta);
}
}
if (compilationInfo.outDir) {
if (compilationInfo.out) {
console.warn('WARNING: Option "out" and "outDir" should not be used together'.magenta);
}
if (compilationInfo.outDir) {
if (compilationInfo.out) {
console.warn('WARNING: Option "out" and "outDir" should not be used together'.magenta);
}
args.push('--outDir', compilationInfo.outDir);
}
args.push('--outDir', compilationInfo.outDir);
}
if (compilationInfo.out) {
args.push('--out', compilationInfo.out);
}
if (compilationInfo.out) {
args.push('--out', compilationInfo.out);
}
if (compilationInfo.dest && (!compilationInfo.out) && (!compilationInfo.outDir)) {
if (utils.isJavaScriptFile(compilationInfo.dest)) {
args.push('--out', compilationInfo.dest);
} else {
if (compilationInfo.dest === 'src') {
console.warn(('WARNING: Destination for target "' + options.targetName + '" is "src", which is the default. If you have' +
' forgotten to specify a "dest" parameter, please add it. If this is correct, you may wish' +
' to change the "dest" parameter to "src/" or just ignore this warning.').magenta);
}
if (Array.isArray(compilationInfo.dest)) {
if ((<string[]><any>compilationInfo.dest).length === 0) {
// ignore it and do nothing.
} else if ((<string[]><any>compilationInfo.dest).length > 0) {
console.warn((('WARNING: "dest" for target "' + options.targetName + '" is an array. This is not supported by the' +
' TypeScript compiler or grunt-ts.' +
(((<string[]><any>compilationInfo.dest).length > 1) ? ' Only the first "dest" will be used. The' +
' remaining items will be truncated.' : ''))).magenta);
args.push('--outDir', (<string[]><any>compilationInfo.dest)[0]);
}
} else {
args.push('--outDir', compilationInfo.dest);
}
}
}
if (compilationInfo.dest && (!compilationInfo.out) && (!compilationInfo.outDir)) {
if (utils.isJavaScriptFile(compilationInfo.dest)) {
args.push('--out', compilationInfo.dest);
} else {
if (compilationInfo.dest === 'src') {
console.warn(('WARNING: Destination for target "' + options.targetName + '" is "src", which is the default. If you have' +
' forgotten to specify a "dest" parameter, please add it. If this is correct, you may wish' +
' to change the "dest" parameter to "src/" or just ignore this warning.').magenta);
}
if (Array.isArray(compilationInfo.dest)) {
if ((<string[]><any>compilationInfo.dest).length === 0) {
// ignore it and do nothing.
} else if ((<string[]><any>compilationInfo.dest).length > 0) {
console.warn((('WARNING: "dest" for target "' + options.targetName + '" is an array. This is not supported by the' +
' TypeScript compiler or grunt-ts.' +
(((<string[]><any>compilationInfo.dest).length > 1) ? ' Only the first "dest" will be used. The' +
' remaining items will be truncated.' : ''))).magenta);
args.push('--outDir', (<string[]><any>compilationInfo.dest)[0]);
}
} else {
args.push('--outDir', compilationInfo.dest);
}
}
}
if (args.indexOf('--out') > -1 && args.indexOf('--module') > -1) {
console.warn(('WARNING: TypeScript does not allow external modules to be concatenated with' +
' --out. Any exported code may be truncated. See TypeScript issue #1544 for' +
' more details.').magenta);
}
if (args.indexOf('--out') > -1 && args.indexOf('--module') > -1) {
console.warn(('WARNING: TypeScript does not allow external modules to be concatenated with' +
' --out. Any exported code may be truncated. See TypeScript issue #1544 for' +
' more details.').magenta);
if (options.sourceRoot) {
args.push('--sourceRoot', options.sourceRoot);
}
if (options.mapRoot) {
args.push('--mapRoot', options.mapRoot);
}
}
if (options.sourceRoot) {
args.push('--sourceRoot', options.sourceRoot);
}
if (options.mapRoot) {
args.push('--mapRoot', options.mapRoot);
}
if (options.additionalFlags) {

@@ -278,0 +279,0 @@ args.push(options.additionalFlags);

@@ -48,11 +48,8 @@ /// <reference path="../../defs/tsd.d.ts"/>

}
resolve(result);
return;
return resolve(result);
}).catch(function (error) {
reject(error);
return;
return reject(error);
});
}).catch(function (error) {
reject(error);
return;
return reject(error);
});

@@ -59,0 +56,0 @@ var _b, _c;

@@ -66,11 +66,8 @@ /// <reference path="../../defs/tsd.d.ts"/>

resolve(result);
return;
return resolve(result);
}).catch((error) => {
reject(error);
return;
return reject(error);
});
}).catch((error) => {
reject(error);
return;
return reject(error);
});

@@ -77,0 +74,0 @@ });

@@ -41,37 +41,40 @@ 'use strict';

catch (ex) {
reject(ex);
return;
return reject(ex);
}
if (!applyTo.tsconfig) {
resolve(applyTo);
return;
return resolve(applyTo);
}
var projectFile = applyTo.tsconfig.tsconfig;
try {
var projectFileTextContent = fs.readFileSync(projectFile, 'utf8');
if (applyTo.tsconfig.passThrough) {
if (applyTo.CompilationTasks.length === 0) {
applyTo.CompilationTasks.push({ src: [] });
}
if (!applyTo.tsconfig.tsconfig) {
applyTo.tsconfig.tsconfig = '.';
}
}
catch (ex) {
if (ex && ex.code === 'ENOENT') {
reject('Could not find file "' + projectFile + '".');
return;
else {
var projectFile = applyTo.tsconfig.tsconfig;
try {
var projectFileTextContent = fs.readFileSync(projectFile, 'utf8');
}
else if (ex && ex.errno) {
reject('Error ' + ex.errno + ' reading "' + projectFile + '".');
return;
catch (ex) {
if (ex && ex.code === 'ENOENT') {
return reject('Could not find file "' + projectFile + '".');
}
else if (ex && ex.errno) {
return reject('Error ' + ex.errno + ' reading "' + projectFile + '".');
}
else {
return reject('Error reading "' + projectFile + '": ' + JSON.stringify(ex));
}
return reject(ex);
}
else {
reject('Error reading "' + projectFile + '": ' + JSON.stringify(ex));
return;
try {
var projectSpec = JSON.parse(stripBom(projectFileTextContent));
}
reject(ex);
return;
catch (ex) {
return reject('Error parsing "' + projectFile + '". It may not be valid JSON in UTF-8.');
}
applyTo = applyCompilerOptions(applyTo, projectSpec);
}
try {
var projectSpec = JSON.parse(stripBom(projectFileTextContent));
}
catch (ex) {
reject('Error parsing "' + projectFile + '". It may not be valid JSON in UTF-8.');
return;
}
applyTo = applyCompilerOptions(applyTo, projectSpec);
resolve(applyTo);

@@ -78,0 +81,0 @@ });

@@ -54,38 +54,40 @@ 'use strict';

} catch (ex) {
reject(ex);
return;
return reject(ex);
}
if (!applyTo.tsconfig) {
resolve(applyTo);
return;
return resolve(applyTo);
}
let projectFile = (<ITSConfigSupport>applyTo.tsconfig).tsconfig;
try {
var projectFileTextContent = fs.readFileSync(projectFile, 'utf8');
} catch (ex) {
if (ex && ex.code === 'ENOENT') {
reject('Could not find file "' + projectFile + '".');
return;
} else if (ex && ex.errno) {
reject('Error ' + ex.errno + ' reading "' + projectFile + '".');
return;
} else {
reject('Error reading "' + projectFile + '": ' + JSON.stringify(ex));
return;
if ((<ITSConfigSupport>applyTo.tsconfig).passThrough) {
if (applyTo.CompilationTasks.length === 0) {
applyTo.CompilationTasks.push({src: []});
}
reject(ex);
return;
}
if (!(<ITSConfigSupport>applyTo.tsconfig).tsconfig) {
(<ITSConfigSupport>applyTo.tsconfig).tsconfig = '.';
}
} else {
let projectFile = (<ITSConfigSupport>applyTo.tsconfig).tsconfig;
try {
var projectFileTextContent = fs.readFileSync(projectFile, 'utf8');
} catch (ex) {
if (ex && ex.code === 'ENOENT') {
return reject('Could not find file "' + projectFile + '".');
} else if (ex && ex.errno) {
return reject('Error ' + ex.errno + ' reading "' + projectFile + '".');
} else {
return reject('Error reading "' + projectFile + '": ' + JSON.stringify(ex));
}
return reject(ex);
}
try {
var projectSpec: ITSConfigFile = JSON.parse(stripBom(projectFileTextContent));
} catch (ex) {
reject('Error parsing "' + projectFile + '". It may not be valid JSON in UTF-8.');
return;
try {
var projectSpec: ITSConfigFile = JSON.parse(stripBom(projectFileTextContent));
} catch (ex) {
return reject('Error parsing "' + projectFile + '". It may not be valid JSON in UTF-8.');
}
applyTo = applyCompilerOptions(applyTo, projectSpec);
}
applyTo = applyCompilerOptions(applyTo, projectSpec);
resolve(applyTo);

@@ -92,0 +94,0 @@ });

@@ -45,3 +45,3 @@ 'use strict';

if (applyTo.vs) {
csproj2ts.getTypeScriptSettings({
return csproj2ts.getTypeScriptSettings({
ProjectFileName: applyTo.vs.project,

@@ -53,8 +53,6 @@ ActiveConfiguration: applyTo.vs.config || undefined

applyTo = resolve_out_and_outDir(applyTo, taskOptions, targetOptions);
resolve(applyTo);
return;
return resolve(applyTo);
}
catch (ex) {
reject(ex);
return;
return reject(ex);
}

@@ -68,8 +66,6 @@ }).catch(function (error) {

}
reject(error);
return;
return reject(error);
});
return;
}
resolve(applyTo);
return resolve(applyTo);
});

@@ -76,0 +72,0 @@ }

@@ -57,3 +57,3 @@ 'use strict';

if (applyTo.vs) {
csproj2ts.getTypeScriptSettings({
return csproj2ts.getTypeScriptSettings({
ProjectFileName: (<IVisualStudioProjectSupport>applyTo.vs).project,

@@ -65,7 +65,5 @@ ActiveConfiguration: (<IVisualStudioProjectSupport>applyTo.vs).config || undefined

applyTo = resolve_out_and_outDir(applyTo, taskOptions, targetOptions);
resolve(applyTo);
return;
return resolve(applyTo);
} catch (ex) {
reject(ex);
return;
return reject(ex);
}

@@ -78,8 +76,6 @@ }).catch((error) => {

}
reject(error);
return;
return reject(error);
});
return;
}
resolve(applyTo);
return resolve(applyTo);
});

@@ -86,0 +82,0 @@ }

@@ -44,2 +44,5 @@ /// <reference path="../defs/tsd.d.ts"/>

proceed();
}).catch(function (error) {
grunt.log.writeln((error + '').red);
done(false);
});

@@ -357,4 +360,4 @@ }

if (!options.watch) {
if (res.some(function (succes) {
return !succes;
if (res.some(function (success) {
return !success;
})) {

@@ -361,0 +364,0 @@ done(false);

@@ -60,2 +60,5 @@ /// <reference path="../defs/tsd.d.ts"/>

proceed();
}).catch((error) => {
grunt.log.writeln((error + '').red);
done(false);
});

@@ -436,4 +439,4 @@

if (!options.watch) {
if (res.some((succes: boolean) => {
return !succes;
if (res.some((success: boolean) => {
return !success;
})) {

@@ -440,0 +443,0 @@ done(false);

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc