- adding all imports to rollup watch #147, #7

This commit is contained in:
Eugene Zolenko 2019-03-25 16:25:03 -06:00
parent 518c8860b7
commit 2d33064031
15 changed files with 798 additions and 487 deletions

2
dist/index.d.ts.map vendored
View File

@ -1 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASpC,OAAO,EAAE,UAAU,EAAgG,MAAM,QAAQ,CAAC;AAGlI,QAAA,MAAM,UAAU,EAAE,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,CAiU7C,CAAC;AAEF,eAAe,UAAU,CAAC"}
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASpC,OAAO,EAAE,UAAU,EAAgG,MAAM,QAAQ,CAAC;AAGlI,QAAA,MAAM,UAAU,EAAE,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,CA8U7C,CAAC;AAEF,eAAe,UAAU,CAAC"}

View File

@ -1,5 +1,7 @@
import * as tsTypes from "typescript";
import { IContext } from "./context";
import { IOptions } from "./ioptions";
export declare function parseTsConfig(context: IContext, pluginOptions: IOptions): tsTypes.ParsedCommandLine;
export declare function parseTsConfig(context: IContext, pluginOptions: IOptions): {
parsedTsConfig: import("typescript").ParsedCommandLine;
fileName: string | undefined;
};
//# sourceMappingURL=parse-tsconfig.d.ts.map

View File

@ -1 +1 @@
{"version":3,"file":"parse-tsconfig.d.ts","sourceRoot":"","sources":["src/parse-tsconfig.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAKrC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAItC,wBAAgB,aAAa,CAAC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CA8CnG"}
{"version":3,"file":"parse-tsconfig.d.ts","sourceRoot":"","sources":["src/parse-tsconfig.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAKrC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAItC,wBAAgB,aAAa,CAAC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,QAAQ;;;EA8CvE"}

View File

@ -17108,22 +17108,23 @@ var lodash = createCommonjsModule(function (module, exports) {
}
}.call(commonjsGlobal));
});
var lodash_1 = lodash.get;
var lodash_2 = lodash.each;
var lodash_3 = lodash.isEqual;
var lodash_4 = lodash.some;
var lodash_5 = lodash.filter;
var lodash_6 = lodash.endsWith;
var lodash_7 = lodash.map;
var lodash_8 = lodash.has;
var lodash_9 = lodash.isFunction;
var lodash_10 = lodash.concat;
var lodash_11 = lodash.find;
var lodash_12 = lodash.defaults;
var lodash_13 = lodash.assign;
var lodash_14 = lodash.merge;
var lodash_15 = lodash.flatMap;
var lodash_16 = lodash.chain;
var lodash_1 = lodash.compact;
var lodash_2 = lodash.get;
var lodash_3 = lodash.each;
var lodash_4 = lodash.isEqual;
var lodash_5 = lodash.some;
var lodash_6 = lodash.filter;
var lodash_7 = lodash.endsWith;
var lodash_8 = lodash.map;
var lodash_9 = lodash.has;
var lodash_10 = lodash.isFunction;
var lodash_11 = lodash.concat;
var lodash_12 = lodash.find;
var lodash_13 = lodash.defaults;
var lodash_14 = lodash.assign;
var lodash_15 = lodash.merge;
var lodash_16 = lodash.flatMap;
var lodash_17 = lodash.chain;
var VerbosityLevel;
(function (VerbosityLevel) {
@ -17140,22 +17141,22 @@ class ConsoleContext {
warn(message) {
if (this.verbosity < VerbosityLevel.Warning)
return;
console.log(`${this.prefix}${lodash_9(message) ? message() : message}`);
console.log(`${this.prefix}${lodash_10(message) ? message() : message}`);
}
error(message) {
if (this.verbosity < VerbosityLevel.Error)
return;
console.log(`${this.prefix}${lodash_9(message) ? message() : message}`);
console.log(`${this.prefix}${lodash_10(message) ? message() : message}`);
}
info(message) {
if (this.verbosity < VerbosityLevel.Info)
return;
console.log(`${this.prefix}${lodash_9(message) ? message() : message}`);
console.log(`${this.prefix}${lodash_10(message) ? message() : message}`);
}
debug(message) {
if (this.verbosity < VerbosityLevel.Debug)
return;
console.log(`${this.prefix}${lodash_9(message) ? message() : message}`);
console.log(`${this.prefix}${lodash_10(message) ? message() : message}`);
}
}
@ -17166,12 +17167,12 @@ class RollupContext {
this.context = context;
this.prefix = prefix;
this.hasContext = true;
this.hasContext = lodash_9(this.context.warn) && lodash_9(this.context.error);
this.hasContext = lodash_10(this.context.warn) && lodash_10(this.context.error);
}
warn(message) {
if (this.verbosity < VerbosityLevel.Warning)
return;
const text = lodash_9(message) ? message() : message;
const text = lodash_10(message) ? message() : message;
if (this.hasContext)
this.context.warn(`${text}`);
else
@ -17180,7 +17181,7 @@ class RollupContext {
error(message) {
if (this.verbosity < VerbosityLevel.Error)
return;
const text = lodash_9(message) ? message() : message;
const text = lodash_10(message) ? message() : message;
if (this.hasContext) {
if (this.bail)
this.context.error(`${text}`);
@ -17193,13 +17194,13 @@ class RollupContext {
info(message) {
if (this.verbosity < VerbosityLevel.Info)
return;
const text = lodash_9(message) ? message() : message;
const text = lodash_10(message) ? message() : message;
console.log(`${this.prefix}${text}`);
}
debug(message) {
if (this.verbosity < VerbosityLevel.Debug)
return;
const text = lodash_9(message) ? message() : message;
const text = lodash_10(message) ? message() : message;
console.log(`${this.prefix}${text}`);
}
}
@ -17239,7 +17240,7 @@ class LanguageServiceHost {
}
getScriptSnapshot(fileName) {
fileName = normalize(fileName);
if (lodash_8(this.snapshots, fileName))
if (lodash_9(this.snapshots, fileName))
return this.snapshots[fileName];
if (fs.existsSync(fileName)) {
this.snapshots[fileName] = tsModule.ScriptSnapshot.fromString(tsModule.sys.readFile(fileName));
@ -17295,9 +17296,9 @@ class LanguageServiceHost {
for (const creator of this.transformers) {
const factory = creator(this.service);
if (factory.before)
transformer.before = lodash_10(transformer.before, factory.before);
transformer.before = lodash_11(transformer.before, factory.before);
if (factory.after)
transformer.after = lodash_10(transformer.after, factory.after);
transformer.after = lodash_11(transformer.after, factory.after);
}
return transformer;
}
@ -23957,7 +23958,7 @@ class RollingCache {
return false;
if (!fs.existsSync(this.oldCacheRoot))
return names.length === 0; // empty folder matches
return lodash_3(fs.readdirSync(this.oldCacheRoot).sort(), names.sort());
return lodash_4(fs.readdirSync(this.oldCacheRoot).sort(), names.sort());
}
/**
* @returns data for name, must exist in old cache (or either old of new cache if checkNewCache is true)
@ -24695,22 +24696,31 @@ class NoCache {
}
}
function convertEmitOutput(output) {
const out = { code: "" };
function convertEmitOutput(output, references) {
const out = { code: "", references };
output.outputFiles.forEach((e) => {
if (lodash_6(e.name, ".d.ts"))
if (lodash_7(e.name, ".d.ts"))
out.dts = e;
else if (lodash_6(e.name, ".d.ts.map"))
else if (lodash_7(e.name, ".d.ts.map"))
out.dtsmap = e;
else if (lodash_6(e.name, ".map"))
else if (lodash_7(e.name, ".map"))
out.map = e.text;
else
out.code = e.text;
});
return out;
}
function getAllReferences(importer, snapshot, options) {
if (!snapshot)
return [];
const info = tsModule.preProcessFile(snapshot.getText(0, snapshot.getLength()), true, true);
return lodash_1(lodash_11(info.referencedFiles, info.importedFiles).map((reference) => {
const resolved = tsModule.nodeModuleNameResolver(reference.fileName, importer, options, tsModule.sys);
return resolved.resolvedModule ? resolved.resolvedModule.resolvedFileName : undefined;
}));
}
function convertDiagnostic(type, data) {
return lodash_7(data, (diagnostic) => {
return lodash_8(data, (diagnostic) => {
const entry = {
flatMessage: tsModule.flattenDiagnosticMessageText(diagnostic.messageText, "\n"),
formatted: tsModule.formatDiagnosticsWithColorAndContext(data, formatHost),
@ -24733,7 +24743,7 @@ class TsCache {
this.options = options;
this.rollupConfig = rollupConfig;
this.context = context;
this.cacheVersion = "8";
this.cacheVersion = "9";
this.cachePrefix = "rpt2_";
this.ambientTypesDirty = false;
this.hashOptions = { algorithm: "sha1", ignoreUnknown: false };
@ -24749,10 +24759,10 @@ class TsCache {
}
this.dependencyTree = new graphlib_1({ directed: true });
this.dependencyTree.setDefaultNodeLabel((_node) => ({ dirty: false }));
const automaticTypes = lodash_7(tsModule.getAutomaticTypeDirectiveNames(options, tsModule.sys), (entry) => tsModule.resolveTypeReferenceDirective(entry, undefined, options, tsModule.sys))
const automaticTypes = lodash_8(tsModule.getAutomaticTypeDirectiveNames(options, tsModule.sys), (entry) => tsModule.resolveTypeReferenceDirective(entry, undefined, options, tsModule.sys))
.filter((entry) => entry.resolvedTypeReferenceDirective && entry.resolvedTypeReferenceDirective.resolvedFileName)
.map((entry) => entry.resolvedTypeReferenceDirective.resolvedFileName);
this.ambientTypes = lodash_5(rootFilenames, (file) => lodash_6(file, ".d.ts"))
this.ambientTypes = lodash_6(rootFilenames, (file) => lodash_7(file, ".d.ts"))
.concat(automaticTypes)
.map((id) => ({ id, snapshot: this.host.getScriptSnapshot(id) }));
this.init();
@ -24783,11 +24793,11 @@ class TsCache {
walkTree(cb) {
const acyclic = graphlib_3.isAcyclic(this.dependencyTree);
if (acyclic) {
lodash_2(graphlib_3.topsort(this.dependencyTree), (id) => cb(id));
lodash_3(graphlib_3.topsort(this.dependencyTree), (id) => cb(id));
return;
}
this.context.info(safe_4("import tree has cycles"));
lodash_2(this.dependencyTree.nodes(), (id) => cb(id));
lodash_3(this.dependencyTree.nodes(), (id) => cb(id));
}
done() {
this.context.info(safe_5("rolling caches"));
@ -24833,7 +24843,7 @@ class TsCache {
return;
}
this.context.debug(safe_5("Ambient types:"));
const typeNames = lodash_5(this.ambientTypes, (snapshot) => snapshot.snapshot !== undefined)
const typeNames = lodash_6(this.ambientTypes, (snapshot) => snapshot.snapshot !== undefined)
.map((snapshot) => {
this.context.debug(` ${snapshot.id}`);
return this.makeName(snapshot.id, snapshot.snapshot);
@ -24842,7 +24852,7 @@ class TsCache {
this.ambientTypesDirty = !this.typesCache.match(typeNames);
if (this.ambientTypesDirty)
this.context.info(safe_4("ambient types changed, redoing all semantic diagnostics"));
lodash_2(typeNames, (name) => this.typesCache.touch(name));
lodash_3(typeNames, (name) => this.typesCache.touch(name));
}
getDiagnostics(type, cache, id, snapshot, check) {
if (this.noCache) {
@ -24896,7 +24906,7 @@ class TsCache {
if (this.ambientTypesDirty)
return true;
const dependencies = graphlib_3.dijkstra(this.dependencyTree, id);
return lodash_4(dependencies, (dependency, node) => {
return lodash_5(dependencies, (dependency, node) => {
if (!node || dependency.distance === Infinity)
return false;
const l = this.dependencyTree.node(node);
@ -24913,7 +24923,7 @@ class TsCache {
}
function printDiagnostics(context, diagnostics, pretty) {
lodash_2(diagnostics, (diagnostic) => {
lodash_3(diagnostics, (diagnostic) => {
let print;
let color;
let category;
@ -24976,7 +24986,7 @@ function getOptionsOverrides({ useTsconfigDeclarationDir, cacheRoot }, preParsed
return overrides;
}
function expandIncludeWithDirs(include, dirs) {
return lodash_16(dirs)
return lodash_17(dirs)
.flatMap((root) => {
if (include instanceof Array)
return include.map((x) => path.join(root, x));
@ -24994,8 +25004,8 @@ function createFilter(context, pluginOptions, parsedConfig) {
excluded = expandIncludeWithDirs(excluded, parsedConfig.options.rootDirs);
}
if (parsedConfig.projectReferences) {
included = lodash_10(included, expandIncludeWithDirs(included, parsedConfig.projectReferences.map((x) => x.path)));
excluded = lodash_10(excluded, expandIncludeWithDirs(excluded, parsedConfig.projectReferences.map((x) => x.path)));
included = lodash_11(included, expandIncludeWithDirs(included, parsedConfig.projectReferences.map((x) => x.path)));
excluded = lodash_11(excluded, expandIncludeWithDirs(excluded, parsedConfig.projectReferences.map((x) => x.path)));
}
context.debug(() => `included:\n${JSON.stringify(included, undefined, 4)}`);
context.debug(() => `excluded:\n${JSON.stringify(excluded, undefined, 4)}`);
@ -25022,7 +25032,7 @@ function parseTsConfig(context, pluginOptions) {
if (text === undefined)
throw new Error(`failed to read '${fileName}'`);
const result = tsModule.parseConfigFileTextToJson(fileName, text);
pretty = lodash_1(result.config, "pretty", pretty);
pretty = lodash_2(result.config, "pretty", pretty);
if (result.error !== undefined) {
printDiagnostics(context, convertDiagnostic("config", [result.error]), pretty);
throw new Error(`failed to parse '${fileName}'`);
@ -25032,7 +25042,7 @@ function parseTsConfig(context, pluginOptions) {
configFileName = fileName;
}
const mergedConfig = {};
lodash_14(mergedConfig, pluginOptions.tsconfigDefaults, loadedConfig, pluginOptions.tsconfigOverride);
lodash_15(mergedConfig, pluginOptions.tsconfigDefaults, loadedConfig, pluginOptions.tsconfigOverride);
const preParsedTsConfig = tsModule.parseJsonConfigFileContent(mergedConfig, tsModule.sys, baseDir, getOptionsOverrides(pluginOptions), configFileName);
const compilerOptionsOverride = getOptionsOverrides(pluginOptions, preParsedTsConfig);
const parsedTsConfig = tsModule.parseJsonConfigFileContent(mergedConfig, tsModule.sys, baseDir, compilerOptionsOverride, configFileName);
@ -25040,7 +25050,7 @@ function parseTsConfig(context, pluginOptions) {
printDiagnostics(context, convertDiagnostic("config", parsedTsConfig.errors), pretty);
context.debug(`built-in options overrides: ${JSON.stringify(compilerOptionsOverride, undefined, 4)}`);
context.debug(`parsed tsconfig: ${JSON.stringify(parsedTsConfig, undefined, 4)}`);
return parsedTsConfig;
return { parsedTsConfig, fileName };
}
// The injected id for helpers.
@ -26460,6 +26470,7 @@ const typescript = (options) => {
let context;
let filter;
let parsedConfig;
let tsConfigPath;
let servicesHost;
let service;
let noErrors = true;
@ -26471,7 +26482,7 @@ const typescript = (options) => {
return _cache;
};
const pluginOptions = Object.assign({}, options);
lodash_12(pluginOptions, {
lodash_13(pluginOptions, {
check: true,
verbosity: VerbosityLevel.Warning,
clean: false,
@ -26496,19 +26507,22 @@ const typescript = (options) => {
options(config) {
rollupOptions = Object.assign({}, config);
context = new ConsoleContext(pluginOptions.verbosity, "rpt2: ");
context.info(`typescript version: ${tsModule.version}`);
context.info(`tslib version: ${tslibVersion}`);
if (this.meta)
context.info(`rollup version: ${this.meta.rollupVersion}`);
if (!semver_30(tsModule.version, ">=2.4.0", { includePrerelease: true }))
throw new Error(`Installed typescript version '${tsModule.version}' is outside of supported range '>=2.4.0'`);
context.info(`rollup-plugin-typescript2 version: 0.20.2`);
context.debug(() => `plugin options:\n${JSON.stringify(pluginOptions, (key, value) => key === "typescript" ? `version ${value.version}` : value, 4)}`);
context.debug(() => `rollup config:\n${JSON.stringify(rollupOptions, undefined, 4)}`);
watchMode = process.env.ROLLUP_WATCH === "true";
if (watchMode)
context.info(`running in watch mode`);
parsedConfig = parseTsConfig(context, pluginOptions);
({ parsedTsConfig: parsedConfig, fileName: tsConfigPath } = parseTsConfig(context, pluginOptions));
if (generateRound === 0) {
context.info(`typescript version: ${tsModule.version}`);
context.info(`tslib version: ${tslibVersion}`);
if (this.meta)
context.info(`rollup version: ${this.meta.rollupVersion}`);
if (!semver_30(tsModule.version, ">=2.4.0", { includePrerelease: true }))
throw new Error(`Installed typescript version '${tsModule.version}' is outside of supported range '>=2.4.0'`);
context.info(`rollup-plugin-typescript2 version: 0.20.2`);
context.debug(() => `plugin options:\n${JSON.stringify(pluginOptions, (key, value) => key === "typescript" ? `version ${value.version}` : value, 4)}`);
context.debug(() => `rollup config:\n${JSON.stringify(rollupOptions, undefined, 4)}`);
context.debug(() => `tsconfig path: ${tsConfigPath}`);
if (watchMode)
context.info(`running in watch mode`);
}
filter = createFilter(context, pluginOptions, parsedConfig);
servicesHost = new LanguageServiceHost(parsedConfig, pluginOptions.transformers);
service = tsModule.createLanguageService(servicesHost, tsModule.createDocumentRegistry());
@ -26530,7 +26544,7 @@ const typescript = (options) => {
if (result.resolvedModule && result.resolvedModule.resolvedFileName) {
if (filter(result.resolvedModule.resolvedFileName))
cache().setDependency(result.resolvedModule.resolvedFileName, importer);
if (lodash_6(result.resolvedModule.resolvedFileName, ".d.ts"))
if (lodash_7(result.resolvedModule.resolvedFileName, ".d.ts"))
return;
const resolved = pluginOptions.rollupCommonJSResolveHack
? resolve.sync(result.resolvedModule.resolvedFileName)
@ -26558,7 +26572,7 @@ const typescript = (options) => {
if (output.emitSkipped) {
noErrors = false;
// always checking on fatal errors, even if options.check is set to false
const diagnostics = lodash_10(cache().getSyntacticDiagnostics(id, snapshot, () => {
const diagnostics = lodash_11(cache().getSyntacticDiagnostics(id, snapshot, () => {
return service.getSyntacticDiagnostics(id);
}), cache().getSemanticDiagnostics(id, snapshot, () => {
return service.getSemanticDiagnostics(id);
@ -26566,13 +26580,14 @@ const typescript = (options) => {
printDiagnostics(contextWrapper, diagnostics, parsedConfig.options.pretty === true);
// since no output was generated, aborting compilation
cache().done();
if (lodash_9(this.error))
if (lodash_10(this.error))
this.error(safe_3(`failed to transpile '${id}'`));
}
return convertEmitOutput(output);
const references = getAllReferences(id, servicesHost.getScriptSnapshot(id), parsedConfig.options);
return convertEmitOutput(output, references);
});
if (pluginOptions.check) {
const diagnostics = lodash_10(cache().getSyntacticDiagnostics(id, snapshot, () => {
const diagnostics = lodash_11(cache().getSyntacticDiagnostics(id, snapshot, () => {
return service.getSyntacticDiagnostics(id);
}), cache().getSemanticDiagnostics(id, snapshot, () => {
return service.getSemanticDiagnostics(id);
@ -26582,6 +26597,12 @@ const typescript = (options) => {
printDiagnostics(contextWrapper, diagnostics, parsedConfig.options.pretty === true);
}
if (result) {
if (watchMode && this.addWatchFile && result.references) {
if (tsConfigPath)
this.addWatchFile(tsConfigPath);
result.references.map(this.addWatchFile, this);
context.debug(() => `${safe_1(" watching")}: ${result.references.join("\nrpt2: ")}`);
}
if (result.dts) {
const key = normalize(id);
declarations[key] = { type: result.dts, map: result.dtsmap };
@ -26612,7 +26633,7 @@ const typescript = (options) => {
const snapshot = servicesHost.getScriptSnapshot(id);
if (!snapshot)
return;
const diagnostics = lodash_10(cache().getSyntacticDiagnostics(id, snapshot, () => {
const diagnostics = lodash_11(cache().getSyntacticDiagnostics(id, snapshot, () => {
return service.getSyntacticDiagnostics(id);
}), cache().getSemanticDiagnostics(id, snapshot, () => {
return service.getSemanticDiagnostics(id);
@ -26627,9 +26648,9 @@ const typescript = (options) => {
},
_onwrite({ file, dir }) {
if (parsedConfig.options.declaration) {
lodash_2(parsedConfig.fileNames, (name) => {
lodash_3(parsedConfig.fileNames, (name) => {
const key = normalize(name);
if (lodash_8(declarations, key) || !filter(key))
if (lodash_9(declarations, key) || !filter(key))
return;
context.debug(() => `generating missed declarations for '${key}'`);
const output = service.getEmitOutput(key, true);
@ -26660,7 +26681,7 @@ const typescript = (options) => {
// Write the declaration file to disk.
tsModule.sys.writeFile(writeToPath, entry.text, entry.writeByteOrderMark);
};
lodash_2(declarations, ({ type, map }, key) => {
lodash_3(declarations, ({ type, map }, key) => {
writeDeclaration(key, ".d.ts", type);
writeDeclaration(key, ".d.ts.map", map);
});

File diff suppressed because one or more lines are too long

View File

@ -17104,22 +17104,23 @@ var lodash = createCommonjsModule(function (module, exports) {
}
}.call(commonjsGlobal));
});
var lodash_1 = lodash.get;
var lodash_2 = lodash.each;
var lodash_3 = lodash.isEqual;
var lodash_4 = lodash.some;
var lodash_5 = lodash.filter;
var lodash_6 = lodash.endsWith;
var lodash_7 = lodash.map;
var lodash_8 = lodash.has;
var lodash_9 = lodash.isFunction;
var lodash_10 = lodash.concat;
var lodash_11 = lodash.find;
var lodash_12 = lodash.defaults;
var lodash_13 = lodash.assign;
var lodash_14 = lodash.merge;
var lodash_15 = lodash.flatMap;
var lodash_16 = lodash.chain;
var lodash_1 = lodash.compact;
var lodash_2 = lodash.get;
var lodash_3 = lodash.each;
var lodash_4 = lodash.isEqual;
var lodash_5 = lodash.some;
var lodash_6 = lodash.filter;
var lodash_7 = lodash.endsWith;
var lodash_8 = lodash.map;
var lodash_9 = lodash.has;
var lodash_10 = lodash.isFunction;
var lodash_11 = lodash.concat;
var lodash_12 = lodash.find;
var lodash_13 = lodash.defaults;
var lodash_14 = lodash.assign;
var lodash_15 = lodash.merge;
var lodash_16 = lodash.flatMap;
var lodash_17 = lodash.chain;
var VerbosityLevel;
(function (VerbosityLevel) {
@ -17136,22 +17137,22 @@ class ConsoleContext {
warn(message) {
if (this.verbosity < VerbosityLevel.Warning)
return;
console.log(`${this.prefix}${lodash_9(message) ? message() : message}`);
console.log(`${this.prefix}${lodash_10(message) ? message() : message}`);
}
error(message) {
if (this.verbosity < VerbosityLevel.Error)
return;
console.log(`${this.prefix}${lodash_9(message) ? message() : message}`);
console.log(`${this.prefix}${lodash_10(message) ? message() : message}`);
}
info(message) {
if (this.verbosity < VerbosityLevel.Info)
return;
console.log(`${this.prefix}${lodash_9(message) ? message() : message}`);
console.log(`${this.prefix}${lodash_10(message) ? message() : message}`);
}
debug(message) {
if (this.verbosity < VerbosityLevel.Debug)
return;
console.log(`${this.prefix}${lodash_9(message) ? message() : message}`);
console.log(`${this.prefix}${lodash_10(message) ? message() : message}`);
}
}
@ -17162,12 +17163,12 @@ class RollupContext {
this.context = context;
this.prefix = prefix;
this.hasContext = true;
this.hasContext = lodash_9(this.context.warn) && lodash_9(this.context.error);
this.hasContext = lodash_10(this.context.warn) && lodash_10(this.context.error);
}
warn(message) {
if (this.verbosity < VerbosityLevel.Warning)
return;
const text = lodash_9(message) ? message() : message;
const text = lodash_10(message) ? message() : message;
if (this.hasContext)
this.context.warn(`${text}`);
else
@ -17176,7 +17177,7 @@ class RollupContext {
error(message) {
if (this.verbosity < VerbosityLevel.Error)
return;
const text = lodash_9(message) ? message() : message;
const text = lodash_10(message) ? message() : message;
if (this.hasContext) {
if (this.bail)
this.context.error(`${text}`);
@ -17189,13 +17190,13 @@ class RollupContext {
info(message) {
if (this.verbosity < VerbosityLevel.Info)
return;
const text = lodash_9(message) ? message() : message;
const text = lodash_10(message) ? message() : message;
console.log(`${this.prefix}${text}`);
}
debug(message) {
if (this.verbosity < VerbosityLevel.Debug)
return;
const text = lodash_9(message) ? message() : message;
const text = lodash_10(message) ? message() : message;
console.log(`${this.prefix}${text}`);
}
}
@ -17235,7 +17236,7 @@ class LanguageServiceHost {
}
getScriptSnapshot(fileName) {
fileName = normalize(fileName);
if (lodash_8(this.snapshots, fileName))
if (lodash_9(this.snapshots, fileName))
return this.snapshots[fileName];
if (existsSync(fileName)) {
this.snapshots[fileName] = tsModule.ScriptSnapshot.fromString(tsModule.sys.readFile(fileName));
@ -17291,9 +17292,9 @@ class LanguageServiceHost {
for (const creator of this.transformers) {
const factory = creator(this.service);
if (factory.before)
transformer.before = lodash_10(transformer.before, factory.before);
transformer.before = lodash_11(transformer.before, factory.before);
if (factory.after)
transformer.after = lodash_10(transformer.after, factory.after);
transformer.after = lodash_11(transformer.after, factory.after);
}
return transformer;
}
@ -23953,7 +23954,7 @@ class RollingCache {
return false;
if (!existsSync(this.oldCacheRoot))
return names.length === 0; // empty folder matches
return lodash_3(readdirSync(this.oldCacheRoot).sort(), names.sort());
return lodash_4(readdirSync(this.oldCacheRoot).sort(), names.sort());
}
/**
* @returns data for name, must exist in old cache (or either old of new cache if checkNewCache is true)
@ -24691,22 +24692,31 @@ class NoCache {
}
}
function convertEmitOutput(output) {
const out = { code: "" };
function convertEmitOutput(output, references) {
const out = { code: "", references };
output.outputFiles.forEach((e) => {
if (lodash_6(e.name, ".d.ts"))
if (lodash_7(e.name, ".d.ts"))
out.dts = e;
else if (lodash_6(e.name, ".d.ts.map"))
else if (lodash_7(e.name, ".d.ts.map"))
out.dtsmap = e;
else if (lodash_6(e.name, ".map"))
else if (lodash_7(e.name, ".map"))
out.map = e.text;
else
out.code = e.text;
});
return out;
}
function getAllReferences(importer, snapshot, options) {
if (!snapshot)
return [];
const info = tsModule.preProcessFile(snapshot.getText(0, snapshot.getLength()), true, true);
return lodash_1(lodash_11(info.referencedFiles, info.importedFiles).map((reference) => {
const resolved = tsModule.nodeModuleNameResolver(reference.fileName, importer, options, tsModule.sys);
return resolved.resolvedModule ? resolved.resolvedModule.resolvedFileName : undefined;
}));
}
function convertDiagnostic(type, data) {
return lodash_7(data, (diagnostic) => {
return lodash_8(data, (diagnostic) => {
const entry = {
flatMessage: tsModule.flattenDiagnosticMessageText(diagnostic.messageText, "\n"),
formatted: tsModule.formatDiagnosticsWithColorAndContext(data, formatHost),
@ -24729,7 +24739,7 @@ class TsCache {
this.options = options;
this.rollupConfig = rollupConfig;
this.context = context;
this.cacheVersion = "8";
this.cacheVersion = "9";
this.cachePrefix = "rpt2_";
this.ambientTypesDirty = false;
this.hashOptions = { algorithm: "sha1", ignoreUnknown: false };
@ -24745,10 +24755,10 @@ class TsCache {
}
this.dependencyTree = new graphlib_1({ directed: true });
this.dependencyTree.setDefaultNodeLabel((_node) => ({ dirty: false }));
const automaticTypes = lodash_7(tsModule.getAutomaticTypeDirectiveNames(options, tsModule.sys), (entry) => tsModule.resolveTypeReferenceDirective(entry, undefined, options, tsModule.sys))
const automaticTypes = lodash_8(tsModule.getAutomaticTypeDirectiveNames(options, tsModule.sys), (entry) => tsModule.resolveTypeReferenceDirective(entry, undefined, options, tsModule.sys))
.filter((entry) => entry.resolvedTypeReferenceDirective && entry.resolvedTypeReferenceDirective.resolvedFileName)
.map((entry) => entry.resolvedTypeReferenceDirective.resolvedFileName);
this.ambientTypes = lodash_5(rootFilenames, (file) => lodash_6(file, ".d.ts"))
this.ambientTypes = lodash_6(rootFilenames, (file) => lodash_7(file, ".d.ts"))
.concat(automaticTypes)
.map((id) => ({ id, snapshot: this.host.getScriptSnapshot(id) }));
this.init();
@ -24779,11 +24789,11 @@ class TsCache {
walkTree(cb) {
const acyclic = graphlib_3.isAcyclic(this.dependencyTree);
if (acyclic) {
lodash_2(graphlib_3.topsort(this.dependencyTree), (id) => cb(id));
lodash_3(graphlib_3.topsort(this.dependencyTree), (id) => cb(id));
return;
}
this.context.info(safe_4("import tree has cycles"));
lodash_2(this.dependencyTree.nodes(), (id) => cb(id));
lodash_3(this.dependencyTree.nodes(), (id) => cb(id));
}
done() {
this.context.info(safe_5("rolling caches"));
@ -24829,7 +24839,7 @@ class TsCache {
return;
}
this.context.debug(safe_5("Ambient types:"));
const typeNames = lodash_5(this.ambientTypes, (snapshot) => snapshot.snapshot !== undefined)
const typeNames = lodash_6(this.ambientTypes, (snapshot) => snapshot.snapshot !== undefined)
.map((snapshot) => {
this.context.debug(` ${snapshot.id}`);
return this.makeName(snapshot.id, snapshot.snapshot);
@ -24838,7 +24848,7 @@ class TsCache {
this.ambientTypesDirty = !this.typesCache.match(typeNames);
if (this.ambientTypesDirty)
this.context.info(safe_4("ambient types changed, redoing all semantic diagnostics"));
lodash_2(typeNames, (name) => this.typesCache.touch(name));
lodash_3(typeNames, (name) => this.typesCache.touch(name));
}
getDiagnostics(type, cache, id, snapshot, check) {
if (this.noCache) {
@ -24892,7 +24902,7 @@ class TsCache {
if (this.ambientTypesDirty)
return true;
const dependencies = graphlib_3.dijkstra(this.dependencyTree, id);
return lodash_4(dependencies, (dependency, node) => {
return lodash_5(dependencies, (dependency, node) => {
if (!node || dependency.distance === Infinity)
return false;
const l = this.dependencyTree.node(node);
@ -24909,7 +24919,7 @@ class TsCache {
}
function printDiagnostics(context, diagnostics, pretty) {
lodash_2(diagnostics, (diagnostic) => {
lodash_3(diagnostics, (diagnostic) => {
let print;
let color;
let category;
@ -24972,7 +24982,7 @@ function getOptionsOverrides({ useTsconfigDeclarationDir, cacheRoot }, preParsed
return overrides;
}
function expandIncludeWithDirs(include, dirs) {
return lodash_16(dirs)
return lodash_17(dirs)
.flatMap((root) => {
if (include instanceof Array)
return include.map((x) => join(root, x));
@ -24990,8 +25000,8 @@ function createFilter(context, pluginOptions, parsedConfig) {
excluded = expandIncludeWithDirs(excluded, parsedConfig.options.rootDirs);
}
if (parsedConfig.projectReferences) {
included = lodash_10(included, expandIncludeWithDirs(included, parsedConfig.projectReferences.map((x) => x.path)));
excluded = lodash_10(excluded, expandIncludeWithDirs(excluded, parsedConfig.projectReferences.map((x) => x.path)));
included = lodash_11(included, expandIncludeWithDirs(included, parsedConfig.projectReferences.map((x) => x.path)));
excluded = lodash_11(excluded, expandIncludeWithDirs(excluded, parsedConfig.projectReferences.map((x) => x.path)));
}
context.debug(() => `included:\n${JSON.stringify(included, undefined, 4)}`);
context.debug(() => `excluded:\n${JSON.stringify(excluded, undefined, 4)}`);
@ -25018,7 +25028,7 @@ function parseTsConfig(context, pluginOptions) {
if (text === undefined)
throw new Error(`failed to read '${fileName}'`);
const result = tsModule.parseConfigFileTextToJson(fileName, text);
pretty = lodash_1(result.config, "pretty", pretty);
pretty = lodash_2(result.config, "pretty", pretty);
if (result.error !== undefined) {
printDiagnostics(context, convertDiagnostic("config", [result.error]), pretty);
throw new Error(`failed to parse '${fileName}'`);
@ -25028,7 +25038,7 @@ function parseTsConfig(context, pluginOptions) {
configFileName = fileName;
}
const mergedConfig = {};
lodash_14(mergedConfig, pluginOptions.tsconfigDefaults, loadedConfig, pluginOptions.tsconfigOverride);
lodash_15(mergedConfig, pluginOptions.tsconfigDefaults, loadedConfig, pluginOptions.tsconfigOverride);
const preParsedTsConfig = tsModule.parseJsonConfigFileContent(mergedConfig, tsModule.sys, baseDir, getOptionsOverrides(pluginOptions), configFileName);
const compilerOptionsOverride = getOptionsOverrides(pluginOptions, preParsedTsConfig);
const parsedTsConfig = tsModule.parseJsonConfigFileContent(mergedConfig, tsModule.sys, baseDir, compilerOptionsOverride, configFileName);
@ -25036,7 +25046,7 @@ function parseTsConfig(context, pluginOptions) {
printDiagnostics(context, convertDiagnostic("config", parsedTsConfig.errors), pretty);
context.debug(`built-in options overrides: ${JSON.stringify(compilerOptionsOverride, undefined, 4)}`);
context.debug(`parsed tsconfig: ${JSON.stringify(parsedTsConfig, undefined, 4)}`);
return parsedTsConfig;
return { parsedTsConfig, fileName };
}
// The injected id for helpers.
@ -26456,6 +26466,7 @@ const typescript = (options) => {
let context;
let filter;
let parsedConfig;
let tsConfigPath;
let servicesHost;
let service;
let noErrors = true;
@ -26467,7 +26478,7 @@ const typescript = (options) => {
return _cache;
};
const pluginOptions = Object.assign({}, options);
lodash_12(pluginOptions, {
lodash_13(pluginOptions, {
check: true,
verbosity: VerbosityLevel.Warning,
clean: false,
@ -26492,19 +26503,22 @@ const typescript = (options) => {
options(config) {
rollupOptions = Object.assign({}, config);
context = new ConsoleContext(pluginOptions.verbosity, "rpt2: ");
context.info(`typescript version: ${tsModule.version}`);
context.info(`tslib version: ${tslibVersion}`);
if (this.meta)
context.info(`rollup version: ${this.meta.rollupVersion}`);
if (!semver_30(tsModule.version, ">=2.4.0", { includePrerelease: true }))
throw new Error(`Installed typescript version '${tsModule.version}' is outside of supported range '>=2.4.0'`);
context.info(`rollup-plugin-typescript2 version: 0.20.2`);
context.debug(() => `plugin options:\n${JSON.stringify(pluginOptions, (key, value) => key === "typescript" ? `version ${value.version}` : value, 4)}`);
context.debug(() => `rollup config:\n${JSON.stringify(rollupOptions, undefined, 4)}`);
watchMode = process.env.ROLLUP_WATCH === "true";
if (watchMode)
context.info(`running in watch mode`);
parsedConfig = parseTsConfig(context, pluginOptions);
({ parsedTsConfig: parsedConfig, fileName: tsConfigPath } = parseTsConfig(context, pluginOptions));
if (generateRound === 0) {
context.info(`typescript version: ${tsModule.version}`);
context.info(`tslib version: ${tslibVersion}`);
if (this.meta)
context.info(`rollup version: ${this.meta.rollupVersion}`);
if (!semver_30(tsModule.version, ">=2.4.0", { includePrerelease: true }))
throw new Error(`Installed typescript version '${tsModule.version}' is outside of supported range '>=2.4.0'`);
context.info(`rollup-plugin-typescript2 version: 0.20.2`);
context.debug(() => `plugin options:\n${JSON.stringify(pluginOptions, (key, value) => key === "typescript" ? `version ${value.version}` : value, 4)}`);
context.debug(() => `rollup config:\n${JSON.stringify(rollupOptions, undefined, 4)}`);
context.debug(() => `tsconfig path: ${tsConfigPath}`);
if (watchMode)
context.info(`running in watch mode`);
}
filter = createFilter(context, pluginOptions, parsedConfig);
servicesHost = new LanguageServiceHost(parsedConfig, pluginOptions.transformers);
service = tsModule.createLanguageService(servicesHost, tsModule.createDocumentRegistry());
@ -26526,7 +26540,7 @@ const typescript = (options) => {
if (result.resolvedModule && result.resolvedModule.resolvedFileName) {
if (filter(result.resolvedModule.resolvedFileName))
cache().setDependency(result.resolvedModule.resolvedFileName, importer);
if (lodash_6(result.resolvedModule.resolvedFileName, ".d.ts"))
if (lodash_7(result.resolvedModule.resolvedFileName, ".d.ts"))
return;
const resolved = pluginOptions.rollupCommonJSResolveHack
? sync(result.resolvedModule.resolvedFileName)
@ -26554,7 +26568,7 @@ const typescript = (options) => {
if (output.emitSkipped) {
noErrors = false;
// always checking on fatal errors, even if options.check is set to false
const diagnostics = lodash_10(cache().getSyntacticDiagnostics(id, snapshot, () => {
const diagnostics = lodash_11(cache().getSyntacticDiagnostics(id, snapshot, () => {
return service.getSyntacticDiagnostics(id);
}), cache().getSemanticDiagnostics(id, snapshot, () => {
return service.getSemanticDiagnostics(id);
@ -26562,13 +26576,14 @@ const typescript = (options) => {
printDiagnostics(contextWrapper, diagnostics, parsedConfig.options.pretty === true);
// since no output was generated, aborting compilation
cache().done();
if (lodash_9(this.error))
if (lodash_10(this.error))
this.error(safe_3(`failed to transpile '${id}'`));
}
return convertEmitOutput(output);
const references = getAllReferences(id, servicesHost.getScriptSnapshot(id), parsedConfig.options);
return convertEmitOutput(output, references);
});
if (pluginOptions.check) {
const diagnostics = lodash_10(cache().getSyntacticDiagnostics(id, snapshot, () => {
const diagnostics = lodash_11(cache().getSyntacticDiagnostics(id, snapshot, () => {
return service.getSyntacticDiagnostics(id);
}), cache().getSemanticDiagnostics(id, snapshot, () => {
return service.getSemanticDiagnostics(id);
@ -26578,6 +26593,12 @@ const typescript = (options) => {
printDiagnostics(contextWrapper, diagnostics, parsedConfig.options.pretty === true);
}
if (result) {
if (watchMode && this.addWatchFile && result.references) {
if (tsConfigPath)
this.addWatchFile(tsConfigPath);
result.references.map(this.addWatchFile, this);
context.debug(() => `${safe_1(" watching")}: ${result.references.join("\nrpt2: ")}`);
}
if (result.dts) {
const key = normalize(id);
declarations[key] = { type: result.dts, map: result.dtsmap };
@ -26608,7 +26629,7 @@ const typescript = (options) => {
const snapshot = servicesHost.getScriptSnapshot(id);
if (!snapshot)
return;
const diagnostics = lodash_10(cache().getSyntacticDiagnostics(id, snapshot, () => {
const diagnostics = lodash_11(cache().getSyntacticDiagnostics(id, snapshot, () => {
return service.getSyntacticDiagnostics(id);
}), cache().getSemanticDiagnostics(id, snapshot, () => {
return service.getSemanticDiagnostics(id);
@ -26623,9 +26644,9 @@ const typescript = (options) => {
},
_onwrite({ file, dir }) {
if (parsedConfig.options.declaration) {
lodash_2(parsedConfig.fileNames, (name) => {
lodash_3(parsedConfig.fileNames, (name) => {
const key = normalize(name);
if (lodash_8(declarations, key) || !filter(key))
if (lodash_9(declarations, key) || !filter(key))
return;
context.debug(() => `generating missed declarations for '${key}'`);
const output = service.getEmitOutput(key, true);
@ -26656,7 +26677,7 @@ const typescript = (options) => {
// Write the declaration file to disk.
tsModule.sys.writeFile(writeToPath, entry.text, entry.writeByteOrderMark);
};
lodash_2(declarations, ({ type, map }, key) => {
lodash_3(declarations, ({ type, map }, key) => {
writeDeclaration(key, ".d.ts", type);
writeDeclaration(key, ".d.ts.map", map);
});

File diff suppressed because one or more lines are too long

4
dist/tscache.d.ts vendored
View File

@ -5,6 +5,7 @@ export interface ICode {
map?: string;
dts?: tsTypes.OutputFile;
dtsmap?: tsTypes.OutputFile;
references?: string[];
}
export interface IDiagnostics {
flatMessage: string;
@ -14,7 +15,8 @@ export interface IDiagnostics {
code: number;
type: string;
}
export declare function convertEmitOutput(output: tsTypes.EmitOutput): ICode;
export declare function convertEmitOutput(output: tsTypes.EmitOutput, references?: string[]): ICode;
export declare function getAllReferences(importer: string, snapshot: tsTypes.IScriptSnapshot | undefined, options: tsTypes.CompilerOptions): string[];
export declare function convertDiagnostic(type: string, data: tsTypes.Diagnostic[]): IDiagnostics[];
export declare class TsCache {
private noCache;

View File

@ -1 +1 @@
{"version":3,"file":"tscache.d.ts","sourceRoot":"","sources":["src/tscache.ts"],"names":[],"mappings":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43,7 @@
"@types/node": {
"version": "8.0.47",
"resolved": "https://registry.npmjs.org/@types/node/-/node-8.0.47.tgz",
"integrity": "sha1-lo5Zb5Gs1ZBpBUVYoAcIxEXKMMI=",
"integrity": "sha512-kOwL746WVvt/9Phf6/JgX/bsGQvbrK5iUgzyfwZNcKVFcjAUVSpF9HxevLTld2SG9aywYHOILj38arDdY1r/iQ==",
"dev": true
},
"@types/object-hash": {
@ -481,57 +481,6 @@
}
}
},
"expand-range": {
"version": "1.8.2",
"resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz",
"integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=",
"dev": true,
"requires": {
"fill-range": "2.2.4"
},
"dependencies": {
"fill-range": {
"version": "2.2.4",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz",
"integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==",
"dev": true,
"requires": {
"is-number": "2.1.0",
"isobject": "2.1.0",
"randomatic": "3.1.1",
"repeat-element": "1.1.3",
"repeat-string": "1.6.1"
}
},
"is-number": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz",
"integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=",
"dev": true,
"requires": {
"kind-of": "3.2.2"
}
},
"isobject": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz",
"integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=",
"dev": true,
"requires": {
"isarray": "1.0.0"
}
},
"kind-of": {
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
"integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
"dev": true,
"requires": {
"is-buffer": "1.1.6"
}
}
}
},
"extend-shallow": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz",
@ -610,12 +559,6 @@
}
}
},
"filename-regex": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz",
"integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=",
"dev": true
},
"fill-range": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz",
@ -642,15 +585,6 @@
"resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz",
"integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA="
},
"for-own": {
"version": "0.1.5",
"resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz",
"integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=",
"dev": true,
"requires": {
"for-in": "1.0.2"
}
},
"fragment-cache": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz",
@ -675,6 +609,535 @@
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
"dev": true
},
"fsevents": {
"version": "1.2.7",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.7.tgz",
"integrity": "sha512-Pxm6sI2MeBD7RdD12RYsqaP0nMiwx8eZBXCa6z2L+mRHm2DYrOYwihmhjpkdjUHwQhslWQjRpEgNq4XvBmaAuw==",
"dev": true,
"optional": true,
"requires": {
"nan": "2.13.2",
"node-pre-gyp": "0.10.3"
},
"dependencies": {
"abbrev": {
"version": "1.1.1",
"bundled": true,
"dev": true,
"optional": true
},
"ansi-regex": {
"version": "2.1.1",
"bundled": true,
"dev": true
},
"aproba": {
"version": "1.2.0",
"bundled": true,
"dev": true,
"optional": true
},
"are-we-there-yet": {
"version": "1.1.5",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"delegates": "1.0.0",
"readable-stream": "2.3.6"
}
},
"balanced-match": {
"version": "1.0.0",
"bundled": true,
"dev": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"dev": true,
"requires": {
"balanced-match": "1.0.0",
"concat-map": "0.0.1"
}
},
"chownr": {
"version": "1.1.1",
"bundled": true,
"dev": true,
"optional": true
},
"code-point-at": {
"version": "1.1.0",
"bundled": true,
"dev": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true,
"dev": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
"dev": true
},
"core-util-is": {
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true
},
"debug": {
"version": "2.6.9",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"ms": "2.0.0"
}
},
"deep-extend": {
"version": "0.6.0",
"bundled": true,
"dev": true,
"optional": true
},
"delegates": {
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true
},
"detect-libc": {
"version": "1.0.3",
"bundled": true,
"dev": true,
"optional": true
},
"fs-minipass": {
"version": "1.2.5",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"minipass": "2.3.5"
}
},
"fs.realpath": {
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true
},
"gauge": {
"version": "2.7.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"aproba": "1.2.0",
"console-control-strings": "1.1.0",
"has-unicode": "2.0.1",
"object-assign": "4.1.1",
"signal-exit": "3.0.2",
"string-width": "1.0.2",
"strip-ansi": "3.0.1",
"wide-align": "1.1.3"
}
},
"glob": {
"version": "7.1.3",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"fs.realpath": "1.0.0",
"inflight": "1.0.6",
"inherits": "2.0.3",
"minimatch": "3.0.4",
"once": "1.4.0",
"path-is-absolute": "1.0.1"
}
},
"has-unicode": {
"version": "2.0.1",
"bundled": true,
"dev": true,
"optional": true
},
"iconv-lite": {
"version": "0.4.24",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"safer-buffer": "2.1.2"
}
},
"ignore-walk": {
"version": "3.0.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"minimatch": "3.0.4"
}
},
"inflight": {
"version": "1.0.6",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"once": "1.4.0",
"wrappy": "1.0.2"
}
},
"inherits": {
"version": "2.0.3",
"bundled": true,
"dev": true
},
"ini": {
"version": "1.3.5",
"bundled": true,
"dev": true,
"optional": true
},
"is-fullwidth-code-point": {
"version": "1.0.0",
"bundled": true,
"dev": true,
"requires": {
"number-is-nan": "1.0.1"
}
},
"isarray": {
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true
},
"minimatch": {
"version": "3.0.4",
"bundled": true,
"dev": true,
"requires": {
"brace-expansion": "1.1.11"
}
},
"minimist": {
"version": "0.0.8",
"bundled": true,
"dev": true
},
"minipass": {
"version": "2.3.5",
"bundled": true,
"dev": true,
"requires": {
"safe-buffer": "5.1.2",
"yallist": "3.0.3"
}
},
"minizlib": {
"version": "1.2.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"minipass": "2.3.5"
}
},
"mkdirp": {
"version": "0.5.1",
"bundled": true,
"dev": true,
"requires": {
"minimist": "0.0.8"
}
},
"ms": {
"version": "2.0.0",
"bundled": true,
"dev": true,
"optional": true
},
"needle": {
"version": "2.2.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"debug": "2.6.9",
"iconv-lite": "0.4.24",
"sax": "1.2.4"
}
},
"node-pre-gyp": {
"version": "0.10.3",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"detect-libc": "1.0.3",
"mkdirp": "0.5.1",
"needle": "2.2.4",
"nopt": "4.0.1",
"npm-packlist": "1.2.0",
"npmlog": "4.1.2",
"rc": "1.2.8",
"rimraf": "2.6.3",
"semver": "5.6.0",
"tar": "4.4.8"
}
},
"nopt": {
"version": "4.0.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"abbrev": "1.1.1",
"osenv": "0.1.5"
}
},
"npm-bundled": {
"version": "1.0.5",
"bundled": true,
"dev": true,
"optional": true
},
"npm-packlist": {
"version": "1.2.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"ignore-walk": "3.0.1",
"npm-bundled": "1.0.5"
}
},
"npmlog": {
"version": "4.1.2",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"are-we-there-yet": "1.1.5",
"console-control-strings": "1.1.0",
"gauge": "2.7.4",
"set-blocking": "2.0.0"
}
},
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
"dev": true
},
"object-assign": {
"version": "4.1.1",
"bundled": true,
"dev": true,
"optional": true
},
"once": {
"version": "1.4.0",
"bundled": true,
"dev": true,
"requires": {
"wrappy": "1.0.2"
}
},
"os-homedir": {
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true
},
"os-tmpdir": {
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true
},
"osenv": {
"version": "0.1.5",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"os-homedir": "1.0.2",
"os-tmpdir": "1.0.2"
}
},
"path-is-absolute": {
"version": "1.0.1",
"bundled": true,
"dev": true,
"optional": true
},
"process-nextick-args": {
"version": "2.0.0",
"bundled": true,
"dev": true,
"optional": true
},
"rc": {
"version": "1.2.8",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"deep-extend": "0.6.0",
"ini": "1.3.5",
"minimist": "1.2.0",
"strip-json-comments": "2.0.1"
},
"dependencies": {
"minimist": {
"version": "1.2.0",
"bundled": true,
"dev": true,
"optional": true
}
}
},
"readable-stream": {
"version": "2.3.6",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"core-util-is": "1.0.2",
"inherits": "2.0.3",
"isarray": "1.0.0",
"process-nextick-args": "2.0.0",
"safe-buffer": "5.1.2",
"string_decoder": "1.1.1",
"util-deprecate": "1.0.2"
}
},
"rimraf": {
"version": "2.6.3",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"glob": "7.1.3"
}
},
"safe-buffer": {
"version": "5.1.2",
"bundled": true,
"dev": true
},
"safer-buffer": {
"version": "2.1.2",
"bundled": true,
"dev": true,
"optional": true
},
"sax": {
"version": "1.2.4",
"bundled": true,
"dev": true,
"optional": true
},
"semver": {
"version": "5.6.0",
"bundled": true,
"dev": true,
"optional": true
},
"set-blocking": {
"version": "2.0.0",
"bundled": true,
"dev": true,
"optional": true
},
"signal-exit": {
"version": "3.0.2",
"bundled": true,
"dev": true,
"optional": true
},
"string-width": {
"version": "1.0.2",
"bundled": true,
"dev": true,
"requires": {
"code-point-at": "1.1.0",
"is-fullwidth-code-point": "1.0.0",
"strip-ansi": "3.0.1"
}
},
"string_decoder": {
"version": "1.1.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "5.1.2"
}
},
"strip-ansi": {
"version": "3.0.1",
"bundled": true,
"dev": true,
"requires": {
"ansi-regex": "2.1.1"
}
},
"strip-json-comments": {
"version": "2.0.1",
"bundled": true,
"dev": true,
"optional": true
},
"tar": {
"version": "4.4.8",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"chownr": "1.1.1",
"fs-minipass": "1.2.5",
"minipass": "2.3.5",
"minizlib": "1.2.1",
"mkdirp": "0.5.1",
"safe-buffer": "5.1.2",
"yallist": "3.0.3"
}
},
"util-deprecate": {
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true
},
"wide-align": {
"version": "1.1.3",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"string-width": "1.0.2"
}
},
"wrappy": {
"version": "1.0.2",
"bundled": true,
"dev": true
},
"yallist": {
"version": "3.0.3",
"bundled": true,
"dev": true
}
}
},
"get-value": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz",
@ -694,25 +1157,6 @@
"path-is-absolute": "1.0.1"
}
},
"glob-base": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz",
"integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=",
"dev": true,
"requires": {
"glob-parent": "2.0.0",
"is-glob": "2.0.1"
}
},
"glob-parent": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz",
"integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=",
"dev": true,
"requires": {
"is-glob": "2.0.1"
}
},
"graceful-fs": {
"version": "4.1.15",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz",
@ -845,41 +1289,11 @@
}
}
},
"is-dotfile": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz",
"integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=",
"dev": true
},
"is-equal-shallow": {
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz",
"integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=",
"dev": true,
"requires": {
"is-primitive": "2.0.0"
}
},
"is-extendable": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz",
"integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik="
},
"is-extglob": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz",
"integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=",
"dev": true
},
"is-glob": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz",
"integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=",
"dev": true,
"requires": {
"is-extglob": "1.0.0"
}
},
"is-module": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz",
@ -912,18 +1326,6 @@
"isobject": "3.0.1"
}
},
"is-posix-bracket": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz",
"integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=",
"dev": true
},
"is-primitive": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz",
"integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=",
"dev": true
},
"is-windows": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz",
@ -996,12 +1398,6 @@
"object-visit": "1.0.1"
}
},
"math-random": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.4.tgz",
"integrity": "sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A==",
"dev": true
},
"micromatch": {
"version": "3.1.10",
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz",
@ -1070,6 +1466,13 @@
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
},
"nan": {
"version": "2.13.2",
"resolved": "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz",
"integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==",
"dev": true,
"optional": true
},
"nanomatch": {
"version": "1.2.13",
"resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz",
@ -1088,15 +1491,6 @@
"to-regex": "3.0.2"
}
},
"normalize-path": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz",
"integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=",
"dev": true,
"requires": {
"remove-trailing-separator": "1.1.0"
}
},
"object-copy": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz",
@ -1139,16 +1533,6 @@
"isobject": "3.0.1"
}
},
"object.omit": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz",
"integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=",
"dev": true,
"requires": {
"for-own": "0.1.5",
"is-extendable": "0.1.1"
}
},
"object.pick": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz",
@ -1166,18 +1550,6 @@
"wrappy": "1.0.2"
}
},
"parse-glob": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz",
"integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=",
"dev": true,
"requires": {
"glob-base": "0.3.0",
"is-dotfile": "1.0.3",
"is-extglob": "1.0.0",
"is-glob": "2.0.1"
}
},
"pascalcase": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz",
@ -1199,40 +1571,6 @@
"resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz",
"integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs="
},
"preserve": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz",
"integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=",
"dev": true
},
"randomatic": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.1.tgz",
"integrity": "sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw==",
"dev": true,
"requires": {
"is-number": "4.0.0",
"kind-of": "6.0.2",
"math-random": "1.0.4"
},
"dependencies": {
"is-number": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz",
"integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==",
"dev": true
}
}
},
"regex-cache": {
"version": "0.4.4",
"resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz",
"integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==",
"dev": true,
"requires": {
"is-equal-shallow": "0.1.3"
}
},
"regex-not": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz",
@ -1242,12 +1580,6 @@
"safe-regex": "1.1.0"
}
},
"remove-trailing-separator": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz",
"integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=",
"dev": true
},
"repeat-element": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz",
@ -1349,110 +1681,15 @@
}
},
"rollup-plugin-typescript2": {
"version": "0.19.3",
"resolved": "https://registry.npmjs.org/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.19.3.tgz",
"integrity": "sha512-lsRqfBCZhMl/tq9AT5YnQvzQWzXtnx3EQYFcHD72gul7nyyoOrzx5yCEH20smpw58v6UkHHZz03FbdLEPoHWjA==",
"version": "0.20.1",
"resolved": "https://registry.npmjs.org/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.20.1.tgz",
"integrity": "sha512-uxA5JQNOfmJ9rsO0yJKTObb1t4nNYUexCg9zxhEKF+NzZwljYWdfgrA06UzA24cOk8fQjGEe7Q5+Vge2vFlnnw==",
"dev": true,
"requires": {
"fs-extra": "7.0.1",
"resolve": "1.8.1",
"rollup-pluginutils": "2.3.3",
"resolve": "1.10.0",
"rollup-pluginutils": "2.4.1",
"tslib": "1.9.3"
},
"dependencies": {
"arr-diff": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz",
"integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=",
"dev": true,
"requires": {
"arr-flatten": "1.1.0"
}
},
"array-unique": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz",
"integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=",
"dev": true
},
"braces": {
"version": "1.8.5",
"resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz",
"integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=",
"dev": true,
"requires": {
"expand-range": "1.8.2",
"preserve": "0.2.0",
"repeat-element": "1.1.3"
}
},
"expand-brackets": {
"version": "0.1.5",
"resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz",
"integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=",
"dev": true,
"requires": {
"is-posix-bracket": "0.1.1"
}
},
"extglob": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz",
"integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=",
"dev": true,
"requires": {
"is-extglob": "1.0.0"
}
},
"kind-of": {
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
"integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
"dev": true,
"requires": {
"is-buffer": "1.1.6"
}
},
"micromatch": {
"version": "2.3.11",
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz",
"integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=",
"dev": true,
"requires": {
"arr-diff": "2.0.0",
"array-unique": "0.2.1",
"braces": "1.8.5",
"expand-brackets": "0.1.5",
"extglob": "0.3.2",
"filename-regex": "2.0.1",
"is-extglob": "1.0.0",
"is-glob": "2.0.1",
"kind-of": "3.2.2",
"normalize-path": "2.1.1",
"object.omit": "2.0.1",
"parse-glob": "3.0.4",
"regex-cache": "0.4.4"
}
},
"resolve": {
"version": "1.8.1",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz",
"integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==",
"dev": true,
"requires": {
"path-parse": "1.0.6"
}
},
"rollup-pluginutils": {
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.3.3.tgz",
"integrity": "sha512-2XZwja7b6P5q4RZ5FhyX1+f46xi1Z3qBKigLRZ6VTZjwbN0K1IFGMlwm06Uu0Emcre2Z63l77nq/pzn+KxIEoA==",
"dev": true,
"requires": {
"estree-walker": "0.5.2",
"micromatch": "2.3.11"
}
}
}
},
"rollup-pluginutils": {
@ -1474,7 +1711,7 @@
"rollup-watch": {
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/rollup-watch/-/rollup-watch-4.3.1.tgz",
"integrity": "sha512-6yjnIwfjpSrqA8IafyIu7fsEyeImNR4aDjA1bQ7KWeVuiA+Clfsx8+PGQkyABWIQzmauQ//tIJ5wAxLXsXs8qQ==",
"integrity": "sha1-WqHq6reHrd82iQXRArOdb8XOSos=",
"dev": true,
"requires": {
"chokidar": "1.7.0",
@ -1560,6 +1797,7 @@
"requires": {
"anymatch": "1.3.2",
"async-each": "1.0.1",
"fsevents": "1.2.7",
"glob-parent": "2.0.0",
"inherits": "2.0.3",
"is-binary-path": "1.0.1",

View File

@ -24,7 +24,7 @@
"scripts": {
"prebuild": "rimraf dist/*",
"build": "rollup -c",
"watch": "rollup -c -w rollup.config.self.js",
"watch": "rollup -c rollup.config.self.js -w ",
"build-self": "rollup -c rollup.config.self.js",
"lint": "tslint -c ./tslint.json src/*.ts ./*.js"
},
@ -56,7 +56,7 @@
"rollup-plugin-commonjs": "9.2.1",
"rollup-plugin-node-resolve": "4.0.1",
"rollup-plugin-re": "1.0.7",
"rollup-plugin-typescript2": "0.19.3",
"rollup-plugin-typescript2": "0.20.1",
"rollup-watch": "4.3.1",
"semver": "5.6.0",
"tslint": "5.13.1",

View File

@ -36,7 +36,7 @@ export default {
namedExports:
{
"colors/safe": [ "green", "white", "red", "yellow", "blue" ],
"lodash": [ "get", "each", "isEqual", "some", "filter", "endsWith", "map", "has", "isFunction", "concat", "find", "defaults", "assign", "merge", "flatMap", "chain" ],
"lodash": [ "compact", "get", "each", "isEqual", "some", "filter", "endsWith", "map", "has", "isFunction", "concat", "find", "defaults", "assign", "merge", "flatMap", "chain" ],
// "fs-extra": [ "renameSync", "removeSync", "ensureFileSync", "writeJsonSync", "readJsonSync", "existsSync", "readdirSync", "emptyDirSync" ],
},
}),

View File

@ -1,7 +1,7 @@
import { RollupContext } from "./rollupcontext";
import { ConsoleContext, VerbosityLevel } from "./context";
import { LanguageServiceHost } from "./host";
import { TsCache, convertDiagnostic, convertEmitOutput } from "./tscache";
import { TsCache, convertDiagnostic, convertEmitOutput, getAllReferences } from "./tscache";
import { tsModule, setTypescriptModule } from "./tsproxy";
import * as tsTypes from "typescript";
import * as resolve from "resolve";
@ -11,7 +11,7 @@ import { Partial } from "./partial";
import { parseTsConfig } from "./parse-tsconfig";
import { printDiagnostics } from "./print-diagnostics";
import { TSLIB, tslibSource, tslibVersion } from "./tslib";
import { blue, red, yellow } from "colors/safe";
import { blue, red, yellow, green } from "colors/safe";
import { dirname, isAbsolute, join, relative } from "path";
import { normalize } from "./normalize";
import { satisfies } from "semver";
@ -27,6 +27,7 @@ const typescript: PluginImpl<Partial<IOptions>> = (options) =>
let context: ConsoleContext;
let filter: any;
let parsedConfig: tsTypes.ParsedCommandLine;
let tsConfigPath: string | undefined;
let servicesHost: LanguageServiceHost;
let service: tsTypes.LanguageService;
let noErrors = true;
@ -75,24 +76,27 @@ const typescript: PluginImpl<Partial<IOptions>> = (options) =>
rollupOptions = {... config};
context = new ConsoleContext(pluginOptions.verbosity, "rpt2: ");
context.info(`typescript version: ${tsModule.version}`);
context.info(`tslib version: ${tslibVersion}`);
if (this.meta)
context.info(`rollup version: ${this.meta.rollupVersion}`);
if (!satisfies(tsModule.version, "$TS_VERSION_RANGE", { includePrerelease : true } as any))
throw new Error(`Installed typescript version '${tsModule.version}' is outside of supported range '$TS_VERSION_RANGE'`);
context.info(`rollup-plugin-typescript2 version: $RPT2_VERSION`);
context.debug(() => `plugin options:\n${JSON.stringify(pluginOptions, (key, value) => key === "typescript" ? `version ${(value as typeof tsModule).version}` : value, 4)}`);
context.debug(() => `rollup config:\n${JSON.stringify(rollupOptions, undefined, 4)}`);
watchMode = process.env.ROLLUP_WATCH === "true";
({ parsedTsConfig: parsedConfig, fileName: tsConfigPath } = parseTsConfig(context, pluginOptions));
if (watchMode)
context.info(`running in watch mode`);
if (generateRound === 0)
{
context.info(`typescript version: ${tsModule.version}`);
context.info(`tslib version: ${tslibVersion}`);
if (this.meta)
context.info(`rollup version: ${this.meta.rollupVersion}`);
parsedConfig = parseTsConfig(context, pluginOptions);
if (!satisfies(tsModule.version, "$TS_VERSION_RANGE", { includePrerelease : true } as any))
throw new Error(`Installed typescript version '${tsModule.version}' is outside of supported range '$TS_VERSION_RANGE'`);
context.info(`rollup-plugin-typescript2 version: $RPT2_VERSION`);
context.debug(() => `plugin options:\n${JSON.stringify(pluginOptions, (key, value) => key === "typescript" ? `version ${(value as typeof tsModule).version}` : value, 4)}`);
context.debug(() => `rollup config:\n${JSON.stringify(rollupOptions, undefined, 4)}`);
context.debug(() => `tsconfig path: ${tsConfigPath}`);
if (watchMode)
context.info(`running in watch mode`);
}
filter = createFilter(context, pluginOptions, parsedConfig);
@ -109,7 +113,7 @@ const typescript: PluginImpl<Partial<IOptions>> = (options) =>
cache().clean();
},
resolveId(importee: string, importer: string)
resolveId(this: PluginContext, importee: string, importer: string)
{
if (importee === TSLIB)
return "\0" + TSLIB;
@ -190,7 +194,8 @@ const typescript: PluginImpl<Partial<IOptions>> = (options) =>
this.error(red(`failed to transpile '${id}'`));
}
return convertEmitOutput(output);
const references = getAllReferences(id, servicesHost.getScriptSnapshot(id), parsedConfig.options);
return convertEmitOutput(output, references);
});
if (pluginOptions.check)
@ -214,6 +219,14 @@ const typescript: PluginImpl<Partial<IOptions>> = (options) =>
if (result)
{
if (watchMode && this.addWatchFile && result.references)
{
if (tsConfigPath)
this.addWatchFile(tsConfigPath);
result.references.map(this.addWatchFile, this);
context.debug(() => `${green(" watching")}: ${result.references!.join("\nrpt2: ")}`);
}
if (result.dts)
{
const key = normalize(id);

View File

@ -1,5 +1,4 @@
import { tsModule } from "./tsproxy";
import * as tsTypes from "typescript";
import { IContext } from "./context";
import { dirname } from "path";
import { printDiagnostics } from "./print-diagnostics";
@ -9,7 +8,7 @@ import { IOptions } from "./ioptions";
import * as _ from "lodash";
import { checkTsConfig } from "./check-tsconfig";
export function parseTsConfig(context: IContext, pluginOptions: IOptions): tsTypes.ParsedCommandLine
export function parseTsConfig(context: IContext, pluginOptions: IOptions)
{
const fileName = tsModule.findConfigFile(process.cwd(), tsModule.sys.fileExists, pluginOptions.tsconfig);
@ -54,5 +53,5 @@ export function parseTsConfig(context: IContext, pluginOptions: IOptions): tsTyp
context.debug(`built-in options overrides: ${JSON.stringify(compilerOptionsOverride, undefined, 4)}`);
context.debug(`parsed tsconfig: ${JSON.stringify(parsedTsConfig, undefined, 4)}`);
return parsedTsConfig;
return { parsedTsConfig, fileName };
}

View File

@ -17,6 +17,7 @@ export interface ICode
map?: string;
dts?: tsTypes.OutputFile;
dtsmap?: tsTypes.OutputFile;
references?: string[];
}
interface INodeLabel
@ -40,9 +41,9 @@ interface ITypeSnapshot
snapshot: tsTypes.IScriptSnapshot | undefined;
}
export function convertEmitOutput(output: tsTypes.EmitOutput): ICode
export function convertEmitOutput(output: tsTypes.EmitOutput, references?: string[]): ICode
{
const out: ICode = { code: "" };
const out: ICode = { code: "", references };
output.outputFiles.forEach((e) =>
{
@ -59,6 +60,20 @@ export function convertEmitOutput(output: tsTypes.EmitOutput): ICode
return out;
}
export function getAllReferences(importer: string, snapshot: tsTypes.IScriptSnapshot | undefined, options: tsTypes.CompilerOptions)
{
if (!snapshot)
return [];
const info = tsModule.preProcessFile(snapshot.getText(0, snapshot.getLength()), true, true);
return _.compact(_.concat(info.referencedFiles, info.importedFiles).map((reference) =>
{
const resolved = tsModule.nodeModuleNameResolver(reference.fileName, importer, options, tsModule.sys);
return resolved.resolvedModule ? resolved.resolvedModule.resolvedFileName : undefined;
}));
}
export function convertDiagnostic(type: string, data: tsTypes.Diagnostic[]): IDiagnostics[]
{
return _.map(data, (diagnostic) =>
@ -84,7 +99,7 @@ export function convertDiagnostic(type: string, data: tsTypes.Diagnostic[]): IDi
export class TsCache
{
private cacheVersion = "8";
private cacheVersion = "9";
private cachePrefix = "rpt2_";
private dependencyTree: Graph;
private ambientTypes: ITypeSnapshot[];