@nevware21/grunt-ts-plugin
Advanced tools
Comparing version 0.4.3 to 0.4.4
@@ -0,1 +1,9 @@ | ||
# v0.4.4 | ||
## Changelog | ||
- Update Dependencies | ||
- Consume @nevware21/ts-utils for common functions | ||
# v0.4.3 | ||
@@ -2,0 +10,0 @@ |
{ | ||
"name": "@nevware21/grunt-ts-plugin", | ||
"description": "TypeScript Compilation Plugin for GruntJS", | ||
"version": "0.4.3", | ||
"version": "0.4.4", | ||
"homepage": "https://github.com/nevware21/grunt-plugins", | ||
@@ -51,11 +51,12 @@ "license": "MIT", | ||
"@types/grunt": "^0.4.27", | ||
"@nevware21/grunt-plugins-shared-utils": "0.3.0", | ||
"@nevware21/ts-utils": "^0.1.0", | ||
"@nevware21/grunt-plugins-shared-utils": "0.3.1", | ||
"@nevware21/grunt-eslint-ts": "^0.2.1", | ||
"@nevware21/grunt-ts-plugin": "^0.4.2", | ||
"grunt": "^1.4.0", | ||
"grunt": "^1.5.3", | ||
"grunt-cli": "^1.4.3", | ||
"typescript": "^4.2.0", | ||
"rollup": "^2.51.2", | ||
"@rollup/plugin-commonjs": "^19.0.0", | ||
"@rollup/plugin-node-resolve": "^13.0.0" | ||
"typescript": "^4.7.2", | ||
"rollup": "^2.75.3", | ||
"@rollup/plugin-commonjs": "^22.0.0", | ||
"@rollup/plugin-node-resolve": "^13.3.0" | ||
}, | ||
@@ -62,0 +63,0 @@ "peerDependencies": { |
'use strict'; | ||
var tsUtils = require('@nevware21/ts-utils'); | ||
var fs = require('fs'); | ||
@@ -15,5 +16,3 @@ var path = require('path'); | ||
enumerable: true, | ||
get: function () { | ||
return e[k]; | ||
} | ||
get: function () { return e[k]; } | ||
}); | ||
@@ -23,3 +22,3 @@ } | ||
} | ||
n['default'] = e; | ||
n["default"] = e; | ||
return n; | ||
@@ -126,47 +125,2 @@ } | ||
function isUndefined(value) { | ||
return value == "undefined" || typeof value === "undefined"; | ||
} | ||
function isString(value) { | ||
return typeof value === "string"; | ||
} | ||
function getGruntMultiTaskOptions(grunt, theTask) { | ||
var taskOptions = theTask.data; | ||
if (!taskOptions) { | ||
taskOptions = (grunt.config.getRaw(theTask.name + "." + theTask.target) || {}); | ||
} | ||
return taskOptions; | ||
} | ||
function resolveValue(value1, value2, defaultValue) { | ||
var value = value1; | ||
if (isUndefined(value)) { | ||
value = value2; | ||
} | ||
if (isUndefined(value)) { | ||
value = defaultValue; | ||
} | ||
return value; | ||
} | ||
function dumpObj(object, format) { | ||
var objectTypeDump = Object.prototype.toString.call(object); | ||
var propertyValueDump = ""; | ||
if (objectTypeDump === "[object Error]") { | ||
propertyValueDump = "{ stack: '" + object.stack + "', message: '" + object.message + "', name: '" + object.name + "'"; | ||
} | ||
else { | ||
if (format) { | ||
if (typeof format === "number") { | ||
propertyValueDump = JSON.stringify(object, null, format); | ||
} | ||
else { | ||
propertyValueDump = JSON.stringify(object, null, format ? 4 : 0); | ||
} | ||
} | ||
else { | ||
propertyValueDump = JSON.stringify(object); | ||
} | ||
} | ||
return objectTypeDump + propertyValueDump; | ||
} | ||
function getTempFile(filename, thePath, extension) { | ||
@@ -226,3 +180,3 @@ if (thePath === void 0) { thePath = ""; } | ||
if (commonPath) { | ||
if (isUndefined(seperator)) { | ||
if (tsUtils.isUndefined(seperator)) { | ||
endIdx = Math.max(commonPath.lastIndexOf("/"), commonPath.lastIndexOf("\\")); | ||
@@ -565,3 +519,3 @@ } | ||
details.addFiles = function (tsFiles) { | ||
if (tsFiles && isString(tsFiles)) { | ||
if (tsFiles && tsUtils.isString(tsFiles)) { | ||
tsFiles = [tsFiles]; | ||
@@ -665,2 +619,20 @@ } | ||
function getGruntMultiTaskOptions(grunt, theTask) { | ||
var taskOptions = theTask.data; | ||
if (!taskOptions) { | ||
taskOptions = (grunt.config.getRaw(theTask.name + "." + theTask.target) || {}); | ||
} | ||
return taskOptions; | ||
} | ||
function resolveValue(value1, value2, defaultValue) { | ||
var value = value1; | ||
if (tsUtils.isUndefined(value)) { | ||
value = value2; | ||
} | ||
if (tsUtils.isUndefined(value)) { | ||
value = defaultValue; | ||
} | ||
return value; | ||
} | ||
var ErrorHandlerResponse; | ||
@@ -708,3 +680,3 @@ (function (ErrorHandlerResponse) { | ||
var _self = this; | ||
grunt.logVerbose((" TypeScript Options: [" + dumpObj(options) + "]").cyan); | ||
grunt.logVerbose((" TypeScript Options: [" + tsUtils.dumpObj(options) + "]").cyan); | ||
_self.compile = function (tsFiles) { return __awaiter(_this, void 0, void 0, function () { | ||
@@ -1082,3 +1054,3 @@ var startTime, args, showOverrides, tsc, tscVersion, tsPluginVersion, tsDetails, tsCommand, tsConfigFile, compilerOptions, outDirParam, outParam, outFile, outFile, outDir, theTsConfig, execResponse, endTime, chkResponse, totalErrors, ignoredErrors, isSuccess, response, message; | ||
if (src) { | ||
if (isString(src)) { | ||
if (tsUtils.isString(src)) { | ||
files.push(src); | ||
@@ -1101,4 +1073,4 @@ } | ||
if (grunt.isDebug) { | ||
grunt.logVerbose((" Options: [" + dumpObj(options) + "]").cyan); | ||
grunt.logVerbose((" Config : [" + dumpObj(taskOptions) + "]").cyan); | ||
grunt.logVerbose((" Options: [" + tsUtils.dumpObj(options) + "]").cyan); | ||
grunt.logVerbose((" Config : [" + tsUtils.dumpObj(taskOptions) + "]").cyan); | ||
} | ||
@@ -1178,3 +1150,3 @@ if (!taskOptions.tsconfig || !grunt.file.exists(taskOptions.tsconfig)) { | ||
})().catch(function (error) { | ||
grunt.logError(dumpObj(error)); | ||
grunt.logError(tsUtils.dumpObj(error)); | ||
done(error); | ||
@@ -1181,0 +1153,0 @@ }); |
Sorry, the diff of this file is not supported yet
176860
11
1130