Merge branch 'lephyrus-master'

This commit is contained in:
Eugene Zolenko 2018-03-28 10:57:36 -06:00
commit a3b71f0a18
10 changed files with 206 additions and 181 deletions

4
dist/index.d.ts vendored
View File

@ -1,5 +1,5 @@
import { IRollupContext } from "./context";
import { ICode } from "./tscache";
import { IRollupCode } from "./tscache";
import { IRollupOptions } from "./irollup-options";
import { IOptions } from "./ioptions";
import { Partial } from "./partial";
@ -8,7 +8,7 @@ export default function typescript(options?: Partial<IOptions>): {
options(config: IRollupOptions): void;
resolveId(importee: string, importer: string): string | null;
load(id: string): string | undefined;
transform(this: IRollupContext, code: string, id: string): ICode | undefined;
transform(this: IRollupContext, code: string, id: string): IRollupCode | undefined;
ongenerate(): void;
onwrite({ dest, file }: IRollupOptions): void;
};

1
dist/ioptions.d.ts vendored
View File

@ -13,4 +13,5 @@ export interface IOptions {
typescript: typeof tsModule;
tsconfigOverride: any;
tsconfigDefaults: any;
sourceMapCallback: (id: string, map: string) => void;
}

View File

@ -23,6 +23,9 @@ MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/* global Reflect, Promise */
var __assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
@ -38,11 +41,21 @@ function commonjsRequire () {
throw new Error('Dynamic requires are not currently supported by rollup-plugin-commonjs');
}
function createCommonjsModule(fn, module) {
return module = { exports: {} }, fn(module, module.exports), module.exports;
}
var lodash = createCommonjsModule(function (module, exports) {
/**
* @license
* Lodash <https://lodash.com/>
* Copyright JS Foundation and other contributors <https://js.foundation/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/
(function() {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
@ -17120,6 +17133,7 @@ var lodash = createCommonjsModule(function (module, exports) {
}
}.call(commonjsGlobal));
});
var lodash_1 = lodash.get;
var lodash_2 = lodash.each;
var lodash_3 = lodash.isEqual;
@ -17300,25 +17314,25 @@ var LanguageServiceHost = /** @class */ (function () {
/* global window */
var lodash$1;
var lodash$2;
if (typeof commonjsRequire === "function") {
try {
lodash$1 = lodash;
lodash$2 = lodash;
} catch (e) {}
}
if (!lodash$1) {
lodash$1 = window._;
if (!lodash$2) {
lodash$2 = window._;
}
var lodash_1$1 = lodash$1;
var lodash_1$1 = lodash$2;
var graph = Graph;
var DEFAULT_EDGE_NAME = "\x00",
GRAPH_NODE = "\x00",
EDGE_KEY_DELIM = "\x01";
var DEFAULT_EDGE_NAME = "\x00";
var GRAPH_NODE = "\x00";
var EDGE_KEY_DELIM = "\x01";
// Implementation notes:
//
@ -18456,36 +18470,11 @@ var graphlib = {
alg: alg,
version: lib.version
};
var graphlib_1 = graphlib.Graph;
var graphlib_3 = graphlib.alg;
var objectHash_1 = createCommonjsModule(function (module, exports) {
/**
* Exported function
*
* Options:
*
* - `algorithm` hash algo to be used by this instance: *'sha1', 'md5'
* - `excludeValues` {true|*false} hash object keys, values ignored
* - `encoding` hash encoding, supports 'buffer', '*hex', 'binary', 'base64'
* - `ignoreUnknown` {true|*false} ignore unknown object types
* - `replacer` optional function that replaces values before hashing
* - `respectFunctionProperties` {*true|false} consider function properties when hashing
* - `respectFunctionNames` {*true|false} consider 'name' property of functions for hashing
* - `respectType` {*true|false} Respect special properties (prototype, constructor)
* when hashing to distinguish between types
* - `unorderedArrays` {true|*false} Sort all arrays before hashing
* - `unorderedSets` {*true|false} Sort `Set` and `Map` instances before hashing
* * = default
*
* @param {object} object value to hash
* @param {object} options hashing options
* @return {string} hash value
* @api public
*/
exports = module.exports = objectHash;
function objectHash(object, options){
@ -18897,6 +18886,7 @@ function PassThrough() {
};
}
});
var objectHash_2 = objectHash_1.sha1;
var objectHash_3 = objectHash_1.keys;
var objectHash_4 = objectHash_1.MD5;
@ -19514,6 +19504,7 @@ var safe = createCommonjsModule(function (module) {
module['exports'] = colors_1;
});
var safe_1 = safe.green;
var safe_2 = safe.white;
var safe_3 = safe.red;
@ -19962,7 +19953,7 @@ function typescript(options) {
var dts = lodash_11(output.outputFiles, function (entry) { return lodash_6(entry.name, ".d.ts"); });
return {
code: transpiled ? transpiled.text : undefined,
map: map ? JSON.parse(map.text) : { mappings: "" },
map: map ? map.text : undefined,
dts: dts,
};
});
@ -19976,13 +19967,21 @@ function typescript(options) {
noErrors = false;
printDiagnostics(contextWrapper, diagnostics, parsedConfig.options.pretty === true);
}
if (result && result.dts) {
var key_1 = normalize(id);
declarations[key_1] = result.dts;
context.debug(function () { return safe_5("generated declarations") + " for '" + key_1 + "'"; });
result.dts = undefined;
if (result) {
if (result.dts) {
var key_1 = normalize(id);
declarations[key_1] = result.dts;
context.debug(function () { return safe_5("generated declarations") + " for '" + key_1 + "'"; });
}
var transformResult = { code: result.code, map: { mappings: "" } };
if (result.map) {
if (pluginOptions.sourceMapCallback)
pluginOptions.sourceMapCallback(id, result.map);
transformResult.map = JSON.parse(result.map);
}
return transformResult;
}
return result;
return undefined;
},
ongenerate: function () {
context.debug(function () { return "generating target " + (generateRound + 1); });

File diff suppressed because one or more lines are too long

View File

@ -19,6 +19,9 @@ MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/* global Reflect, Promise */
var __assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
@ -34,11 +37,21 @@ function commonjsRequire () {
throw new Error('Dynamic requires are not currently supported by rollup-plugin-commonjs');
}
function createCommonjsModule(fn, module) {
return module = { exports: {} }, fn(module, module.exports), module.exports;
}
var lodash = createCommonjsModule(function (module, exports) {
/**
* @license
* Lodash <https://lodash.com/>
* Copyright JS Foundation and other contributors <https://js.foundation/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/
(function() {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
@ -3069,14 +3082,14 @@ var lodash = createCommonjsModule(function (module, exports) {
* @param {Array|string} path The path of the property to get.
* @returns {*} Returns the resolved value.
*/
function baseGet(object, path) {
path = castPath(path, object);
function baseGet(object, path$$1) {
path$$1 = castPath(path$$1, object);
var index = 0,
length = path.length;
length = path$$1.length;
while (object != null && index < length) {
object = object[toKey(path[index++])];
object = object[toKey(path$$1[index++])];
}
return (index && index == length) ? object : undefined;
}
@ -3254,10 +3267,10 @@ var lodash = createCommonjsModule(function (module, exports) {
* @param {Array} args The arguments to invoke the method with.
* @returns {*} Returns the result of the invoked method.
*/
function baseInvoke(object, path, args) {
path = castPath(path, object);
object = parent(object, path);
var func = object == null ? object : object[toKey(last(path))];
function baseInvoke(object, path$$1, args) {
path$$1 = castPath(path$$1, object);
object = parent(object, path$$1);
var func = object == null ? object : object[toKey(last(path$$1))];
return func == null ? undefined : apply(func, object, args);
}
@ -3614,14 +3627,14 @@ var lodash = createCommonjsModule(function (module, exports) {
* @param {*} srcValue The value to match.
* @returns {Function} Returns the new spec function.
*/
function baseMatchesProperty(path, srcValue) {
if (isKey(path) && isStrictComparable(srcValue)) {
return matchesStrictComparable(toKey(path), srcValue);
function baseMatchesProperty(path$$1, srcValue) {
if (isKey(path$$1) && isStrictComparable(srcValue)) {
return matchesStrictComparable(toKey(path$$1), srcValue);
}
return function(object) {
var objValue = get(object, path);
var objValue = get(object, path$$1);
return (objValue === undefined && objValue === srcValue)
? hasIn(object, path)
? hasIn(object, path$$1)
: baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
};
}
@ -3788,8 +3801,8 @@ var lodash = createCommonjsModule(function (module, exports) {
* @returns {Object} Returns the new object.
*/
function basePick(object, paths) {
return basePickBy(object, paths, function(value, path) {
return hasIn(object, path);
return basePickBy(object, paths, function(value, path$$1) {
return hasIn(object, path$$1);
});
}
@ -3808,11 +3821,11 @@ var lodash = createCommonjsModule(function (module, exports) {
result = {};
while (++index < length) {
var path = paths[index],
value = baseGet(object, path);
var path$$1 = paths[index],
value = baseGet(object, path$$1);
if (predicate(value, path)) {
baseSet(result, castPath(path, object), value);
if (predicate(value, path$$1)) {
baseSet(result, castPath(path$$1, object), value);
}
}
return result;
@ -3825,9 +3838,9 @@ var lodash = createCommonjsModule(function (module, exports) {
* @param {Array|string} path The path of the property to get.
* @returns {Function} Returns the new accessor function.
*/
function basePropertyDeep(path) {
function basePropertyDeep(path$$1) {
return function(object) {
return baseGet(object, path);
return baseGet(object, path$$1);
};
}
@ -4006,19 +4019,19 @@ var lodash = createCommonjsModule(function (module, exports) {
* @param {Function} [customizer] The function to customize path creation.
* @returns {Object} Returns `object`.
*/
function baseSet(object, path, value, customizer) {
function baseSet(object, path$$1, value, customizer) {
if (!isObject(object)) {
return object;
}
path = castPath(path, object);
path$$1 = castPath(path$$1, object);
var index = -1,
length = path.length,
length = path$$1.length,
lastIndex = length - 1,
nested = object;
while (nested != null && ++index < length) {
var key = toKey(path[index]),
var key = toKey(path$$1[index]),
newValue = value;
if (index != lastIndex) {
@ -4027,7 +4040,7 @@ var lodash = createCommonjsModule(function (module, exports) {
if (newValue === undefined) {
newValue = isObject(objValue)
? objValue
: (isIndex(path[index + 1]) ? [] : {});
: (isIndex(path$$1[index + 1]) ? [] : {});
}
}
assignValue(nested, key, newValue);
@ -4350,10 +4363,10 @@ var lodash = createCommonjsModule(function (module, exports) {
* @param {Array|string} path The property path to unset.
* @returns {boolean} Returns `true` if the property is deleted, else `false`.
*/
function baseUnset(object, path) {
path = castPath(path, object);
object = parent(object, path);
return object == null || delete object[toKey(last(path))];
function baseUnset(object, path$$1) {
path$$1 = castPath(path$$1, object);
object = parent(object, path$$1);
return object == null || delete object[toKey(last(path$$1))];
}
/**
@ -4366,8 +4379,8 @@ var lodash = createCommonjsModule(function (module, exports) {
* @param {Function} [customizer] The function to customize path creation.
* @returns {Object} Returns `object`.
*/
function baseUpdate(object, path, updater, customizer) {
return baseSet(object, path, updater(baseGet(object, path)), customizer);
function baseUpdate(object, path$$1, updater, customizer) {
return baseSet(object, path$$1, updater(baseGet(object, path$$1)), customizer);
}
/**
@ -6188,15 +6201,15 @@ var lodash = createCommonjsModule(function (module, exports) {
* @param {Function} hasFunc The function to check properties.
* @returns {boolean} Returns `true` if `path` exists, else `false`.
*/
function hasPath(object, path, hasFunc) {
path = castPath(path, object);
function hasPath(object, path$$1, hasFunc) {
path$$1 = castPath(path$$1, object);
var index = -1,
length = path.length,
length = path$$1.length,
result = false;
while (++index < length) {
var key = toKey(path[index]);
var key = toKey(path$$1[index]);
if (!(result = object != null && hasFunc(object, key))) {
break;
}
@ -6642,8 +6655,8 @@ var lodash = createCommonjsModule(function (module, exports) {
* @param {Array} path The path to get the parent value of.
* @returns {*} Returns the parent value.
*/
function parent(object, path) {
return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
function parent(object, path$$1) {
return path$$1.length < 2 ? object : baseGet(object, baseSlice(path$$1, 0, -1));
}
/**
@ -9514,13 +9527,13 @@ var lodash = createCommonjsModule(function (module, exports) {
* _.invokeMap([123, 456], String.prototype.split, '');
* // => [['1', '2', '3'], ['4', '5', '6']]
*/
var invokeMap = baseRest(function(collection, path, args) {
var invokeMap = baseRest(function(collection, path$$1, args) {
var index = -1,
isFunc = typeof path == 'function',
isFunc = typeof path$$1 == 'function',
result = isArrayLike(collection) ? Array(collection.length) : [];
baseEach(collection, function(value) {
result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
result[++index] = isFunc ? apply(path$$1, value, args) : baseInvoke(value, path$$1, args);
});
return result;
});
@ -13144,8 +13157,8 @@ var lodash = createCommonjsModule(function (module, exports) {
* _.get(object, 'a.b.c', 'default');
* // => 'default'
*/
function get(object, path, defaultValue) {
var result = object == null ? undefined : baseGet(object, path);
function get(object, path$$1, defaultValue) {
var result = object == null ? undefined : baseGet(object, path$$1);
return result === undefined ? defaultValue : result;
}
@ -13176,8 +13189,8 @@ var lodash = createCommonjsModule(function (module, exports) {
* _.has(other, 'a');
* // => false
*/
function has(object, path) {
return object != null && hasPath(object, path, baseHas);
function has(object, path$$1) {
return object != null && hasPath(object, path$$1, baseHas);
}
/**
@ -13206,8 +13219,8 @@ var lodash = createCommonjsModule(function (module, exports) {
* _.hasIn(object, 'b');
* // => false
*/
function hasIn(object, path) {
return object != null && hasPath(object, path, baseHasIn);
function hasIn(object, path$$1) {
return object != null && hasPath(object, path$$1, baseHasIn);
}
/**
@ -13510,10 +13523,10 @@ var lodash = createCommonjsModule(function (module, exports) {
return result;
}
var isDeep = false;
paths = arrayMap(paths, function(path) {
path = castPath(path, object);
isDeep || (isDeep = path.length > 1);
return path;
paths = arrayMap(paths, function(path$$1) {
path$$1 = castPath(path$$1, object);
isDeep || (isDeep = path$$1.length > 1);
return path$$1;
});
copyObject(object, getAllKeysIn(object), result);
if (isDeep) {
@ -13597,8 +13610,8 @@ var lodash = createCommonjsModule(function (module, exports) {
return [prop];
});
predicate = getIteratee(predicate);
return basePickBy(object, props, function(value, path) {
return predicate(value, path[0]);
return basePickBy(object, props, function(value, path$$1) {
return predicate(value, path$$1[0]);
});
}
@ -13631,11 +13644,11 @@ var lodash = createCommonjsModule(function (module, exports) {
* _.result(object, 'a[0].b.c3', _.constant('default'));
* // => 'default'
*/
function result(object, path, defaultValue) {
path = castPath(path, object);
function result(object, path$$1, defaultValue) {
path$$1 = castPath(path$$1, object);
var index = -1,
length = path.length;
length = path$$1.length;
// Ensure the loop is entered when path is empty.
if (!length) {
@ -13643,7 +13656,7 @@ var lodash = createCommonjsModule(function (module, exports) {
object = undefined;
}
while (++index < length) {
var value = object == null ? undefined : object[toKey(path[index])];
var value = object == null ? undefined : object[toKey(path$$1[index])];
if (value === undefined) {
index = length;
value = defaultValue;
@ -13681,8 +13694,8 @@ var lodash = createCommonjsModule(function (module, exports) {
* console.log(object.x[0].y.z);
* // => 5
*/
function set(object, path, value) {
return object == null ? object : baseSet(object, path, value);
function set(object, path$$1, value) {
return object == null ? object : baseSet(object, path$$1, value);
}
/**
@ -13709,9 +13722,9 @@ var lodash = createCommonjsModule(function (module, exports) {
* _.setWith(object, '[0][1]', 'a', Object);
* // => { '0': { '1': 'a' } }
*/
function setWith(object, path, value, customizer) {
function setWith(object, path$$1, value, customizer) {
customizer = typeof customizer == 'function' ? customizer : undefined;
return object == null ? object : baseSet(object, path, value, customizer);
return object == null ? object : baseSet(object, path$$1, value, customizer);
}
/**
@ -13846,8 +13859,8 @@ var lodash = createCommonjsModule(function (module, exports) {
* console.log(object);
* // => { 'a': [{ 'b': {} }] };
*/
function unset(object, path) {
return object == null ? true : baseUnset(object, path);
function unset(object, path$$1) {
return object == null ? true : baseUnset(object, path$$1);
}
/**
@ -13877,8 +13890,8 @@ var lodash = createCommonjsModule(function (module, exports) {
* console.log(object.x[0].y.z);
* // => 0
*/
function update(object, path, updater) {
return object == null ? object : baseUpdate(object, path, castFunction(updater));
function update(object, path$$1, updater) {
return object == null ? object : baseUpdate(object, path$$1, castFunction(updater));
}
/**
@ -13905,9 +13918,9 @@ var lodash = createCommonjsModule(function (module, exports) {
* _.updateWith(object, '[0][1]', _.constant('a'), Object);
* // => { '0': { '1': 'a' } }
*/
function updateWith(object, path, updater, customizer) {
function updateWith(object, path$$1, updater, customizer) {
customizer = typeof customizer == 'function' ? customizer : undefined;
return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
return object == null ? object : baseUpdate(object, path$$1, castFunction(updater), customizer);
}
/**
@ -15596,8 +15609,8 @@ var lodash = createCommonjsModule(function (module, exports) {
* _.find(objects, _.matchesProperty('a', 4));
* // => { 'a': 4, 'b': 5, 'c': 6 }
*/
function matchesProperty(path, srcValue) {
return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
function matchesProperty(path$$1, srcValue) {
return baseMatchesProperty(path$$1, baseClone(srcValue, CLONE_DEEP_FLAG));
}
/**
@ -15624,9 +15637,9 @@ var lodash = createCommonjsModule(function (module, exports) {
* _.map(objects, _.method(['a', 'b']));
* // => [2, 1]
*/
var method = baseRest(function(path, args) {
var method = baseRest(function(path$$1, args) {
return function(object) {
return baseInvoke(object, path, args);
return baseInvoke(object, path$$1, args);
};
});
@ -15654,8 +15667,8 @@ var lodash = createCommonjsModule(function (module, exports) {
* // => [2, 0]
*/
var methodOf = baseRest(function(object, args) {
return function(path) {
return baseInvoke(object, path, args);
return function(path$$1) {
return baseInvoke(object, path$$1, args);
};
});
@ -15888,8 +15901,8 @@ var lodash = createCommonjsModule(function (module, exports) {
* _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
* // => [1, 2]
*/
function property(path) {
return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
function property(path$$1) {
return isKey(path$$1) ? baseProperty(toKey(path$$1)) : basePropertyDeep(path$$1);
}
/**
@ -15914,8 +15927,8 @@ var lodash = createCommonjsModule(function (module, exports) {
* // => [2, 0]
*/
function propertyOf(object) {
return function(path) {
return object == null ? undefined : baseGet(object, path);
return function(path$$1) {
return object == null ? undefined : baseGet(object, path$$1);
};
}
@ -16942,12 +16955,12 @@ var lodash = createCommonjsModule(function (module, exports) {
return this.reverse().find(predicate);
};
LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
if (typeof path == 'function') {
LazyWrapper.prototype.invokeMap = baseRest(function(path$$1, args) {
if (typeof path$$1 == 'function') {
return new LazyWrapper(this);
}
return this.map(function(value) {
return baseInvoke(value, path, args);
return baseInvoke(value, path$$1, args);
});
});
@ -17116,6 +17129,7 @@ var lodash = createCommonjsModule(function (module, exports) {
}
}.call(commonjsGlobal));
});
var lodash_1 = lodash.get;
var lodash_2 = lodash.each;
var lodash_3 = lodash.isEqual;
@ -17273,14 +17287,14 @@ var LanguageServiceHost = /** @class */ (function () {
LanguageServiceHost.prototype.useCaseSensitiveFileNames = function () {
return tsModule.sys.useCaseSensitiveFileNames;
};
LanguageServiceHost.prototype.readDirectory = function (path, extensions, exclude, include) {
return tsModule.sys.readDirectory(path, extensions, exclude, include);
LanguageServiceHost.prototype.readDirectory = function (path$$1, extensions, exclude, include) {
return tsModule.sys.readDirectory(path$$1, extensions, exclude, include);
};
LanguageServiceHost.prototype.readFile = function (path, encoding) {
return tsModule.sys.readFile(path, encoding);
LanguageServiceHost.prototype.readFile = function (path$$1, encoding) {
return tsModule.sys.readFile(path$$1, encoding);
};
LanguageServiceHost.prototype.fileExists = function (path) {
return tsModule.sys.fileExists(path);
LanguageServiceHost.prototype.fileExists = function (path$$1) {
return tsModule.sys.fileExists(path$$1);
};
LanguageServiceHost.prototype.getTypeRootsVersion = function () {
return 0;
@ -17296,25 +17310,25 @@ var LanguageServiceHost = /** @class */ (function () {
/* global window */
var lodash$1;
var lodash$2;
if (typeof commonjsRequire === "function") {
try {
lodash$1 = lodash;
lodash$2 = lodash;
} catch (e) {}
}
if (!lodash$1) {
lodash$1 = window._;
if (!lodash$2) {
lodash$2 = window._;
}
var lodash_1$1 = lodash$1;
var lodash_1$1 = lodash$2;
var graph = Graph;
var DEFAULT_EDGE_NAME = "\x00",
GRAPH_NODE = "\x00",
EDGE_KEY_DELIM = "\x01";
var DEFAULT_EDGE_NAME = "\x00";
var GRAPH_NODE = "\x00";
var EDGE_KEY_DELIM = "\x01";
// Implementation notes:
//
@ -18452,36 +18466,11 @@ var graphlib = {
alg: alg,
version: lib.version
};
var graphlib_1 = graphlib.Graph;
var graphlib_3 = graphlib.alg;
var objectHash_1 = createCommonjsModule(function (module, exports) {
/**
* Exported function
*
* Options:
*
* - `algorithm` hash algo to be used by this instance: *'sha1', 'md5'
* - `excludeValues` {true|*false} hash object keys, values ignored
* - `encoding` hash encoding, supports 'buffer', '*hex', 'binary', 'base64'
* - `ignoreUnknown` {true|*false} ignore unknown object types
* - `replacer` optional function that replaces values before hashing
* - `respectFunctionProperties` {*true|false} consider function properties when hashing
* - `respectFunctionNames` {*true|false} consider 'name' property of functions for hashing
* - `respectType` {*true|false} Respect special properties (prototype, constructor)
* when hashing to distinguish between types
* - `unorderedArrays` {true|*false} Sort all arrays before hashing
* - `unorderedSets` {*true|false} Sort `Set` and `Map` instances before hashing
* * = default
*
* @param {object} object value to hash
* @param {object} options hashing options
* @return {string} hash value
* @api public
*/
exports = module.exports = objectHash;
function objectHash(object, options){
@ -18893,6 +18882,7 @@ function PassThrough() {
};
}
});
var objectHash_2 = objectHash_1.sha1;
var objectHash_3 = objectHash_1.keys;
var objectHash_4 = objectHash_1.MD5;
@ -19510,6 +19500,7 @@ var safe = createCommonjsModule(function (module) {
module['exports'] = colors_1;
});
var safe_1 = safe.green;
var safe_2 = safe.white;
var safe_3 = safe.red;
@ -19958,7 +19949,7 @@ function typescript(options) {
var dts = lodash_11(output.outputFiles, function (entry) { return lodash_6(entry.name, ".d.ts"); });
return {
code: transpiled ? transpiled.text : undefined,
map: map ? JSON.parse(map.text) : { mappings: "" },
map: map ? map.text : undefined,
dts: dts,
};
});
@ -19972,13 +19963,21 @@ function typescript(options) {
noErrors = false;
printDiagnostics(contextWrapper, diagnostics, parsedConfig.options.pretty === true);
}
if (result && result.dts) {
var key_1 = normalize$1(id);
declarations[key_1] = result.dts;
context.debug(function () { return safe_5("generated declarations") + " for '" + key_1 + "'"; });
result.dts = undefined;
if (result) {
if (result.dts) {
var key_1 = normalize$1(id);
declarations[key_1] = result.dts;
context.debug(function () { return safe_5("generated declarations") + " for '" + key_1 + "'"; });
}
var transformResult = { code: result.code, map: { mappings: "" } };
if (result.map) {
if (pluginOptions.sourceMapCallback)
pluginOptions.sourceMapCallback(id, result.map);
transformResult.map = JSON.parse(result.map);
}
return transformResult;
}
return result;
return undefined;
},
ongenerate: function () {
context.debug(function () { return "generating target " + (generateRound + 1); });

File diff suppressed because one or more lines are too long

6
dist/tscache.d.ts vendored
View File

@ -5,6 +5,12 @@ export interface ICode {
map: string | undefined;
dts?: tsTypes.OutputFile | undefined;
}
export interface IRollupCode {
code: string | undefined;
map: {
mappings: string;
};
}
export interface IDiagnostics {
flatMessage: string;
formatted: string;

View File

@ -1,7 +1,7 @@
import { RollupContext } from "./rollupcontext";
import { ConsoleContext, IRollupContext, VerbosityLevel } from "./context";
import { LanguageServiceHost } from "./host";
import { TsCache, convertDiagnostic, ICode } from "./tscache";
import { TsCache, convertDiagnostic, IRollupCode } from "./tscache";
import { tsModule, setTypescriptModule } from "./tsproxy";
import * as tsTypes from "typescript";
import * as resolve from "resolve";
@ -173,7 +173,7 @@ export default function typescript(options?: Partial<IOptions>)
return undefined;
},
transform(this: IRollupContext, code: string, id: string): ICode | undefined
transform(this: IRollupContext, code: string, id: string): IRollupCode | undefined
{
generateRound = 0; // in watch mode transform call resets generate count (used to avoid printing too many copies of the same error messages)
@ -218,7 +218,7 @@ export default function typescript(options?: Partial<IOptions>)
return {
code: transpiled ? transpiled.text : undefined,
map: map ? JSON.parse(map.text) : { mappings: "" },
map: map ? map.text : undefined,
dts,
};
});
@ -242,15 +242,28 @@ export default function typescript(options?: Partial<IOptions>)
printDiagnostics(contextWrapper, diagnostics, parsedConfig.options.pretty === true);
}
if (result && result.dts)
if (result)
{
const key = normalize(id);
declarations[key] = result.dts;
context.debug(() => `${blue("generated declarations")} for '${key}'`);
result.dts = undefined;
if (result.dts)
{
const key = normalize(id);
declarations[key] = result.dts;
context.debug(() => `${blue("generated declarations")} for '${key}'`);
}
const transformResult = { code: result.code, map: { mappings: "" } };
if (result.map)
{
if (pluginOptions.sourceMapCallback)
pluginOptions.sourceMapCallback(id, result.map);
transformResult.map = JSON.parse(result.map);
}
return transformResult;
}
return result;
return undefined;
},
ongenerate(): void

View File

@ -15,4 +15,5 @@ export interface IOptions
typescript: typeof tsModule;
tsconfigOverride: any;
tsconfigDefaults: any;
sourceMapCallback: (id: string, map: string) => void;
}

View File

@ -17,6 +17,12 @@ export interface ICode
dts?: tsTypes.OutputFile | undefined;
}
export interface IRollupCode
{
code: string | undefined;
map: { mappings: string };
}
interface INodeLabel
{
dirty: boolean;