diff --git a/lib/tsc.js b/lib/tsc.js index 676a6234c8d91..d11299cf5462f 100644 --- a/lib/tsc.js +++ b/lib/tsc.js @@ -65,7 +65,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) { var ts; (function (ts) { ts.versionMajorMinor = "4.3"; - ts.version = "4.3.3"; + ts.version = "4.3.4"; var NativeCollections; (function (NativeCollections) { function tryGetNativeMap() { @@ -13497,56 +13497,43 @@ var ts; } return __assign(__assign({}, writer), { writeTrailingSemicolon: function () { pendingTrailingSemicolon = true; - }, - writeLiteral: function (s) { + }, writeLiteral: function (s) { commitPendingTrailingSemicolon(); writer.writeLiteral(s); - }, - writeStringLiteral: function (s) { + }, writeStringLiteral: function (s) { commitPendingTrailingSemicolon(); writer.writeStringLiteral(s); - }, - writeSymbol: function (s, sym) { + }, writeSymbol: function (s, sym) { commitPendingTrailingSemicolon(); writer.writeSymbol(s, sym); - }, - writePunctuation: function (s) { + }, writePunctuation: function (s) { commitPendingTrailingSemicolon(); writer.writePunctuation(s); - }, - writeKeyword: function (s) { + }, writeKeyword: function (s) { commitPendingTrailingSemicolon(); writer.writeKeyword(s); - }, - writeOperator: function (s) { + }, writeOperator: function (s) { commitPendingTrailingSemicolon(); writer.writeOperator(s); - }, - writeParameter: function (s) { + }, writeParameter: function (s) { commitPendingTrailingSemicolon(); writer.writeParameter(s); - }, - writeSpace: function (s) { + }, writeSpace: function (s) { commitPendingTrailingSemicolon(); writer.writeSpace(s); - }, - writeProperty: function (s) { + }, writeProperty: function (s) { commitPendingTrailingSemicolon(); writer.writeProperty(s); - }, - writeComment: function (s) { + }, writeComment: function (s) { commitPendingTrailingSemicolon(); writer.writeComment(s); - }, - writeLine: function () { + }, writeLine: function () { commitPendingTrailingSemicolon(); writer.writeLine(); - }, - increaseIndent: function () { + }, increaseIndent: function () { commitPendingTrailingSemicolon(); writer.increaseIndent(); - }, - decreaseIndent: function () { + }, decreaseIndent: function () { commitPendingTrailingSemicolon(); writer.decreaseIndent(); } }); @@ -32857,9 +32844,7 @@ var ts; var preDirectoryResolutionCache = createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, directoryToModuleNameMap || (directoryToModuleNameMap = createCacheWithRedirects(options))); moduleNameToDirectoryMap || (moduleNameToDirectoryMap = createCacheWithRedirects(options)); var packageJsonInfoCache = createPackageJsonInfoCache(currentDirectory, getCanonicalFileName); - return __assign(__assign(__assign({}, packageJsonInfoCache), preDirectoryResolutionCache), { getOrCreateCacheForModuleName: getOrCreateCacheForModuleName, - clear: clear, - update: update, getPackageJsonInfoCache: function () { return packageJsonInfoCache; } }); + return __assign(__assign(__assign({}, packageJsonInfoCache), preDirectoryResolutionCache), { getOrCreateCacheForModuleName: getOrCreateCacheForModuleName, clear: clear, update: update, getPackageJsonInfoCache: function () { return packageJsonInfoCache; } }); function clear() { preDirectoryResolutionCache.clear(); moduleNameToDirectoryMap.clear(); @@ -96307,7 +96292,7 @@ var ts; }, emit: function (targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) { if (targetSourceFile || emitOnlyDtsFiles) { - return withProgramOrUndefined(function (program) { return program.emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers); }); + return withProgramOrUndefined(function (program) { var _a, _b; return program.emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers || ((_b = (_a = state.host).getCustomTransformers) === null || _b === void 0 ? void 0 : _b.call(_a, project))); }); } executeSteps(BuildStep.SemanticDiagnostics, cancellationToken); if (step === BuildStep.EmitBuildInfo) { @@ -96389,13 +96374,14 @@ var ts; } function emit(writeFileCallback, cancellationToken, customTransformers) { var _a; + var _b, _c; ts.Debug.assertIsDefined(program); ts.Debug.assert(step === BuildStep.Emit); program.backupState(); var declDiagnostics; var reportDeclarationDiagnostics = function (d) { return (declDiagnostics || (declDiagnostics = [])).push(d); }; var outputFiles = []; - var emitResult = ts.emitFilesAndReportErrors(program, reportDeclarationDiagnostics, undefined, undefined, function (name, text, writeByteOrderMark) { return outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark }); }, cancellationToken, false, customTransformers).emitResult; + var emitResult = ts.emitFilesAndReportErrors(program, reportDeclarationDiagnostics, undefined, undefined, function (name, text, writeByteOrderMark) { return outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark }); }, cancellationToken, false, customTransformers || ((_c = (_b = state.host).getCustomTransformers) === null || _c === void 0 ? void 0 : _c.call(_b, project))).emitResult; if (declDiagnostics) { program.restoreState(); (_a = buildErrors(state, projectPath, program, config, declDiagnostics, BuildResultFlags.DeclarationEmitErrors, "Declaration file"), buildResult = _a.buildResult, step = _a.step); @@ -96472,6 +96458,7 @@ var ts; return emitDiagnostics; } function emitBundle(writeFileCallback, customTransformers) { + var _a, _b; ts.Debug.assert(kind === InvalidatedProjectKind.UpdateBundle); if (state.options.dry) { reportStatus(state, ts.Diagnostics.A_non_dry_build_would_update_output_of_project_0, project); @@ -96486,7 +96473,7 @@ var ts; var outputFiles = ts.emitUsingBuildInfo(config, compilerHost, function (ref) { var refName = resolveProjectName(state, ref.path); return parseConfigFile(state, refName, toResolvedConfigFilePath(state, refName)); - }, customTransformers); + }, customTransformers || ((_b = (_a = state.host).getCustomTransformers) === null || _b === void 0 ? void 0 : _b.call(_a, project))); if (ts.isString(outputFiles)) { reportStatus(state, ts.Diagnostics.Cannot_update_output_of_project_0_because_there_was_error_reading_file_1, project, relName(state, outputFiles)); step = BuildStep.BuildInvalidatedProjectOfBundle; diff --git a/lib/tsserver.js b/lib/tsserver.js index 6ff08da17dfb1..66a3b91b10740 100644 --- a/lib/tsserver.js +++ b/lib/tsserver.js @@ -96,7 +96,7 @@ var ts; // The following is baselined as a literal template type without intervention /** The version of the TypeScript compiler release */ // eslint-disable-next-line @typescript-eslint/no-inferrable-types - ts.version = "4.3.3"; + ts.version = "4.3.4"; /* @internal */ var Comparison; (function (Comparison) { @@ -17321,56 +17321,43 @@ var ts; } return __assign(__assign({}, writer), { writeTrailingSemicolon: function () { pendingTrailingSemicolon = true; - }, - writeLiteral: function (s) { + }, writeLiteral: function (s) { commitPendingTrailingSemicolon(); writer.writeLiteral(s); - }, - writeStringLiteral: function (s) { + }, writeStringLiteral: function (s) { commitPendingTrailingSemicolon(); writer.writeStringLiteral(s); - }, - writeSymbol: function (s, sym) { + }, writeSymbol: function (s, sym) { commitPendingTrailingSemicolon(); writer.writeSymbol(s, sym); - }, - writePunctuation: function (s) { + }, writePunctuation: function (s) { commitPendingTrailingSemicolon(); writer.writePunctuation(s); - }, - writeKeyword: function (s) { + }, writeKeyword: function (s) { commitPendingTrailingSemicolon(); writer.writeKeyword(s); - }, - writeOperator: function (s) { + }, writeOperator: function (s) { commitPendingTrailingSemicolon(); writer.writeOperator(s); - }, - writeParameter: function (s) { + }, writeParameter: function (s) { commitPendingTrailingSemicolon(); writer.writeParameter(s); - }, - writeSpace: function (s) { + }, writeSpace: function (s) { commitPendingTrailingSemicolon(); writer.writeSpace(s); - }, - writeProperty: function (s) { + }, writeProperty: function (s) { commitPendingTrailingSemicolon(); writer.writeProperty(s); - }, - writeComment: function (s) { + }, writeComment: function (s) { commitPendingTrailingSemicolon(); writer.writeComment(s); - }, - writeLine: function () { + }, writeLine: function () { commitPendingTrailingSemicolon(); writer.writeLine(); - }, - increaseIndent: function () { + }, increaseIndent: function () { commitPendingTrailingSemicolon(); writer.increaseIndent(); - }, - decreaseIndent: function () { + }, decreaseIndent: function () { commitPendingTrailingSemicolon(); writer.decreaseIndent(); } }); @@ -40305,9 +40292,7 @@ var ts; var preDirectoryResolutionCache = createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, directoryToModuleNameMap || (directoryToModuleNameMap = createCacheWithRedirects(options))); moduleNameToDirectoryMap || (moduleNameToDirectoryMap = createCacheWithRedirects(options)); var packageJsonInfoCache = createPackageJsonInfoCache(currentDirectory, getCanonicalFileName); - return __assign(__assign(__assign({}, packageJsonInfoCache), preDirectoryResolutionCache), { getOrCreateCacheForModuleName: getOrCreateCacheForModuleName, - clear: clear, - update: update, getPackageJsonInfoCache: function () { return packageJsonInfoCache; } }); + return __assign(__assign(__assign({}, packageJsonInfoCache), preDirectoryResolutionCache), { getOrCreateCacheForModuleName: getOrCreateCacheForModuleName, clear: clear, update: update, getPackageJsonInfoCache: function () { return packageJsonInfoCache; } }); function clear() { preDirectoryResolutionCache.clear(); moduleNameToDirectoryMap.clear(); @@ -116658,7 +116643,7 @@ var ts; }, emit: function (targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) { if (targetSourceFile || emitOnlyDtsFiles) { - return withProgramOrUndefined(function (program) { return program.emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers); }); + return withProgramOrUndefined(function (program) { var _a, _b; return program.emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers || ((_b = (_a = state.host).getCustomTransformers) === null || _b === void 0 ? void 0 : _b.call(_a, project))); }); } executeSteps(BuildStep.SemanticDiagnostics, cancellationToken); if (step === BuildStep.EmitBuildInfo) { @@ -116743,6 +116728,7 @@ var ts; } function emit(writeFileCallback, cancellationToken, customTransformers) { var _a; + var _b, _c; ts.Debug.assertIsDefined(program); ts.Debug.assert(step === BuildStep.Emit); // Before emitting lets backup state, so we can revert it back if there are declaration errors to handle emit and declaration errors correctly @@ -116753,7 +116739,7 @@ var ts; var emitResult = ts.emitFilesAndReportErrors(program, reportDeclarationDiagnostics, /*write*/ undefined, /*reportSummary*/ undefined, function (name, text, writeByteOrderMark) { return outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark }); }, cancellationToken, - /*emitOnlyDts*/ false, customTransformers).emitResult; + /*emitOnlyDts*/ false, customTransformers || ((_c = (_b = state.host).getCustomTransformers) === null || _c === void 0 ? void 0 : _c.call(_b, project))).emitResult; // Don't emit .d.ts if there are decl file errors if (declDiagnostics) { program.restoreState(); @@ -116835,6 +116821,7 @@ var ts; return emitDiagnostics; } function emitBundle(writeFileCallback, customTransformers) { + var _a, _b; ts.Debug.assert(kind === InvalidatedProjectKind.UpdateBundle); if (state.options.dry) { reportStatus(state, ts.Diagnostics.A_non_dry_build_would_update_output_of_project_0, project); @@ -116850,7 +116837,7 @@ var ts; var outputFiles = ts.emitUsingBuildInfo(config, compilerHost, function (ref) { var refName = resolveProjectName(state, ref.path); return parseConfigFile(state, refName, toResolvedConfigFilePath(state, refName)); - }, customTransformers); + }, customTransformers || ((_b = (_a = state.host).getCustomTransformers) === null || _b === void 0 ? void 0 : _b.call(_a, project))); if (ts.isString(outputFiles)) { reportStatus(state, ts.Diagnostics.Cannot_update_output_of_project_0_because_there_was_error_reading_file_1, project, relName(state, outputFiles)); step = BuildStep.BuildInvalidatedProjectOfBundle; @@ -120743,9 +120730,7 @@ var ts; [8 /* OptionalDependencies */, info.optionalDependencies], [4 /* PeerDependencies */, info.peerDependencies], ]; - return __assign(__assign({}, info), { parseable: !!content, fileName: fileName, - get: get, - has: function (dependencyName, inGroups) { + return __assign(__assign({}, info), { parseable: !!content, fileName: fileName, get: get, has: function (dependencyName, inGroups) { return !!get(dependencyName, inGroups); } }); function get(dependencyName, inGroups) { @@ -127171,9 +127156,7 @@ var ts; var name_1 = displayParts_1.map(function (p) { return p.text; }).join(""); var declaration = symbol.declarations && ts.firstOrUndefined(symbol.declarations); var node = declaration ? (ts.getNameOfDeclaration(declaration) || declaration) : originalNode; - return __assign(__assign({}, getFileAndTextSpanFromNode(node)), { name: name_1, - kind: kind_1, - displayParts: displayParts_1, context: getContextNode(declaration) }); + return __assign(__assign({}, getFileAndTextSpanFromNode(node)), { name: name_1, kind: kind_1, displayParts: displayParts_1, context: getContextNode(declaration) }); } case 1 /* Label */: { var node = def.node; @@ -127208,10 +127191,7 @@ var ts; } })(); var sourceFile = info.sourceFile, textSpan = info.textSpan, name = info.name, kind = info.kind, displayParts = info.displayParts, context = info.context; - return __assign({ containerKind: "" /* unknown */, containerName: "", fileName: sourceFile.fileName, kind: kind, - name: name, - textSpan: textSpan, - displayParts: displayParts }, toContextSpan(textSpan, sourceFile, context)); + return __assign({ containerKind: "" /* unknown */, containerName: "", fileName: sourceFile.fileName, kind: kind, name: name, textSpan: textSpan, displayParts: displayParts }, toContextSpan(textSpan, sourceFile, context)); } function getFileAndTextSpanFromNode(node) { var sourceFile = node.getSourceFile(); @@ -165367,9 +165347,7 @@ var ts; var span = toProtocolTextSpanWithContext(textSpan, contextSpan, scriptInfo); var lineSpan = scriptInfo.lineToTextSpan(span.start.line - 1); var lineText = scriptInfo.getSnapshot().getText(lineSpan.start, ts.textSpanEnd(lineSpan)).replace(/\r|\n/g, ""); - return __assign(__assign({ file: fileName }, span), { lineText: lineText, - isWriteAccess: isWriteAccess, - isDefinition: isDefinition }); + return __assign(__assign({ file: fileName }, span), { lineText: lineText, isWriteAccess: isWriteAccess, isDefinition: isDefinition }); } function isCompletionEntryData(data) { return data === undefined || data && typeof data === "object" @@ -166301,10 +166279,8 @@ var ts; var WorkerSession = /** @class */ (function (_super) { __extends(WorkerSession, _super); function WorkerSession(host, webHost, options, logger, cancellationToken, hrtime) { - var _this = _super.call(this, __assign(__assign({ host: host, - cancellationToken: cancellationToken }, options), { typingsInstaller: server.nullTypingsInstaller, byteLength: ts.notImplemented, // Formats the message text in send of Session which is overriden in this class so not needed - hrtime: hrtime, - logger: logger, canUseEvents: false })) || this; + var _this = _super.call(this, __assign(__assign({ host: host, cancellationToken: cancellationToken }, options), { typingsInstaller: server.nullTypingsInstaller, byteLength: ts.notImplemented, // Formats the message text in send of Session which is overriden in this class so not needed + hrtime: hrtime, logger: logger, canUseEvents: false })) || this; _this.webHost = webHost; return _this; } @@ -167805,8 +167781,7 @@ var ts; var typingsInstaller = disableAutomaticTypingAcquisition ? undefined : new NodeTypingsInstaller(telemetryEnabled, logger, host, getGlobalTypingsCacheLocation(), typingSafeListLocation, typesMapLocation, npmLocation, validateDefaultNpmLocation, event); - _this = _super.call(this, __assign(__assign({ host: host, - cancellationToken: cancellationToken }, options), { typingsInstaller: typingsInstaller || server.nullTypingsInstaller, byteLength: Buffer.byteLength, hrtime: process.hrtime, logger: logger, canUseEvents: true, typesMapLocation: typesMapLocation })) || this; + _this = _super.call(this, __assign(__assign({ host: host, cancellationToken: cancellationToken }, options), { typingsInstaller: typingsInstaller || server.nullTypingsInstaller, byteLength: Buffer.byteLength, hrtime: process.hrtime, logger: logger, canUseEvents: true, typesMapLocation: typesMapLocation })) || this; _this.eventPort = eventPort; if (_this.canUseEvents && _this.eventPort) { var s_1 = net.connect({ port: _this.eventPort }, function () { diff --git a/lib/tsserverlibrary.d.ts b/lib/tsserverlibrary.d.ts index 6195d669a8306..d6750c44d0a2e 100644 --- a/lib/tsserverlibrary.d.ts +++ b/lib/tsserverlibrary.d.ts @@ -5205,6 +5205,7 @@ declare namespace ts { * writeFileCallback */ writeFile?(path: string, data: string, writeByteOrderMark?: boolean): void; + getCustomTransformers?: (project: string) => CustomTransformers | undefined; getModifiedTime(fileName: string): Date | undefined; setModifiedTime(fileName: string, date: Date): void; deleteFile(fileName: string): void; diff --git a/lib/tsserverlibrary.js b/lib/tsserverlibrary.js index f4f612b263875..bddccf9e0108f 100644 --- a/lib/tsserverlibrary.js +++ b/lib/tsserverlibrary.js @@ -290,7 +290,7 @@ var ts; // The following is baselined as a literal template type without intervention /** The version of the TypeScript compiler release */ // eslint-disable-next-line @typescript-eslint/no-inferrable-types - ts.version = "4.3.3"; + ts.version = "4.3.4"; /* @internal */ var Comparison; (function (Comparison) { @@ -17515,56 +17515,43 @@ var ts; } return __assign(__assign({}, writer), { writeTrailingSemicolon: function () { pendingTrailingSemicolon = true; - }, - writeLiteral: function (s) { + }, writeLiteral: function (s) { commitPendingTrailingSemicolon(); writer.writeLiteral(s); - }, - writeStringLiteral: function (s) { + }, writeStringLiteral: function (s) { commitPendingTrailingSemicolon(); writer.writeStringLiteral(s); - }, - writeSymbol: function (s, sym) { + }, writeSymbol: function (s, sym) { commitPendingTrailingSemicolon(); writer.writeSymbol(s, sym); - }, - writePunctuation: function (s) { + }, writePunctuation: function (s) { commitPendingTrailingSemicolon(); writer.writePunctuation(s); - }, - writeKeyword: function (s) { + }, writeKeyword: function (s) { commitPendingTrailingSemicolon(); writer.writeKeyword(s); - }, - writeOperator: function (s) { + }, writeOperator: function (s) { commitPendingTrailingSemicolon(); writer.writeOperator(s); - }, - writeParameter: function (s) { + }, writeParameter: function (s) { commitPendingTrailingSemicolon(); writer.writeParameter(s); - }, - writeSpace: function (s) { + }, writeSpace: function (s) { commitPendingTrailingSemicolon(); writer.writeSpace(s); - }, - writeProperty: function (s) { + }, writeProperty: function (s) { commitPendingTrailingSemicolon(); writer.writeProperty(s); - }, - writeComment: function (s) { + }, writeComment: function (s) { commitPendingTrailingSemicolon(); writer.writeComment(s); - }, - writeLine: function () { + }, writeLine: function () { commitPendingTrailingSemicolon(); writer.writeLine(); - }, - increaseIndent: function () { + }, increaseIndent: function () { commitPendingTrailingSemicolon(); writer.increaseIndent(); - }, - decreaseIndent: function () { + }, decreaseIndent: function () { commitPendingTrailingSemicolon(); writer.decreaseIndent(); } }); @@ -40499,9 +40486,7 @@ var ts; var preDirectoryResolutionCache = createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, directoryToModuleNameMap || (directoryToModuleNameMap = createCacheWithRedirects(options))); moduleNameToDirectoryMap || (moduleNameToDirectoryMap = createCacheWithRedirects(options)); var packageJsonInfoCache = createPackageJsonInfoCache(currentDirectory, getCanonicalFileName); - return __assign(__assign(__assign({}, packageJsonInfoCache), preDirectoryResolutionCache), { getOrCreateCacheForModuleName: getOrCreateCacheForModuleName, - clear: clear, - update: update, getPackageJsonInfoCache: function () { return packageJsonInfoCache; } }); + return __assign(__assign(__assign({}, packageJsonInfoCache), preDirectoryResolutionCache), { getOrCreateCacheForModuleName: getOrCreateCacheForModuleName, clear: clear, update: update, getPackageJsonInfoCache: function () { return packageJsonInfoCache; } }); function clear() { preDirectoryResolutionCache.clear(); moduleNameToDirectoryMap.clear(); @@ -116852,7 +116837,7 @@ var ts; }, emit: function (targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) { if (targetSourceFile || emitOnlyDtsFiles) { - return withProgramOrUndefined(function (program) { return program.emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers); }); + return withProgramOrUndefined(function (program) { var _a, _b; return program.emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers || ((_b = (_a = state.host).getCustomTransformers) === null || _b === void 0 ? void 0 : _b.call(_a, project))); }); } executeSteps(BuildStep.SemanticDiagnostics, cancellationToken); if (step === BuildStep.EmitBuildInfo) { @@ -116937,6 +116922,7 @@ var ts; } function emit(writeFileCallback, cancellationToken, customTransformers) { var _a; + var _b, _c; ts.Debug.assertIsDefined(program); ts.Debug.assert(step === BuildStep.Emit); // Before emitting lets backup state, so we can revert it back if there are declaration errors to handle emit and declaration errors correctly @@ -116947,7 +116933,7 @@ var ts; var emitResult = ts.emitFilesAndReportErrors(program, reportDeclarationDiagnostics, /*write*/ undefined, /*reportSummary*/ undefined, function (name, text, writeByteOrderMark) { return outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark }); }, cancellationToken, - /*emitOnlyDts*/ false, customTransformers).emitResult; + /*emitOnlyDts*/ false, customTransformers || ((_c = (_b = state.host).getCustomTransformers) === null || _c === void 0 ? void 0 : _c.call(_b, project))).emitResult; // Don't emit .d.ts if there are decl file errors if (declDiagnostics) { program.restoreState(); @@ -117029,6 +117015,7 @@ var ts; return emitDiagnostics; } function emitBundle(writeFileCallback, customTransformers) { + var _a, _b; ts.Debug.assert(kind === InvalidatedProjectKind.UpdateBundle); if (state.options.dry) { reportStatus(state, ts.Diagnostics.A_non_dry_build_would_update_output_of_project_0, project); @@ -117044,7 +117031,7 @@ var ts; var outputFiles = ts.emitUsingBuildInfo(config, compilerHost, function (ref) { var refName = resolveProjectName(state, ref.path); return parseConfigFile(state, refName, toResolvedConfigFilePath(state, refName)); - }, customTransformers); + }, customTransformers || ((_b = (_a = state.host).getCustomTransformers) === null || _b === void 0 ? void 0 : _b.call(_a, project))); if (ts.isString(outputFiles)) { reportStatus(state, ts.Diagnostics.Cannot_update_output_of_project_0_because_there_was_error_reading_file_1, project, relName(state, outputFiles)); step = BuildStep.BuildInvalidatedProjectOfBundle; @@ -121312,9 +121299,7 @@ var ts; [8 /* OptionalDependencies */, info.optionalDependencies], [4 /* PeerDependencies */, info.peerDependencies], ]; - return __assign(__assign({}, info), { parseable: !!content, fileName: fileName, - get: get, - has: function (dependencyName, inGroups) { + return __assign(__assign({}, info), { parseable: !!content, fileName: fileName, get: get, has: function (dependencyName, inGroups) { return !!get(dependencyName, inGroups); } }); function get(dependencyName, inGroups) { @@ -127740,9 +127725,7 @@ var ts; var name_1 = displayParts_1.map(function (p) { return p.text; }).join(""); var declaration = symbol.declarations && ts.firstOrUndefined(symbol.declarations); var node = declaration ? (ts.getNameOfDeclaration(declaration) || declaration) : originalNode; - return __assign(__assign({}, getFileAndTextSpanFromNode(node)), { name: name_1, - kind: kind_1, - displayParts: displayParts_1, context: getContextNode(declaration) }); + return __assign(__assign({}, getFileAndTextSpanFromNode(node)), { name: name_1, kind: kind_1, displayParts: displayParts_1, context: getContextNode(declaration) }); } case 1 /* Label */: { var node = def.node; @@ -127777,10 +127760,7 @@ var ts; } })(); var sourceFile = info.sourceFile, textSpan = info.textSpan, name = info.name, kind = info.kind, displayParts = info.displayParts, context = info.context; - return __assign({ containerKind: "" /* unknown */, containerName: "", fileName: sourceFile.fileName, kind: kind, - name: name, - textSpan: textSpan, - displayParts: displayParts }, toContextSpan(textSpan, sourceFile, context)); + return __assign({ containerKind: "" /* unknown */, containerName: "", fileName: sourceFile.fileName, kind: kind, name: name, textSpan: textSpan, displayParts: displayParts }, toContextSpan(textSpan, sourceFile, context)); } function getFileAndTextSpanFromNode(node) { var sourceFile = node.getSourceFile(); @@ -165561,9 +165541,7 @@ var ts; var span = toProtocolTextSpanWithContext(textSpan, contextSpan, scriptInfo); var lineSpan = scriptInfo.lineToTextSpan(span.start.line - 1); var lineText = scriptInfo.getSnapshot().getText(lineSpan.start, ts.textSpanEnd(lineSpan)).replace(/\r|\n/g, ""); - return __assign(__assign({ file: fileName }, span), { lineText: lineText, - isWriteAccess: isWriteAccess, - isDefinition: isDefinition }); + return __assign(__assign({ file: fileName }, span), { lineText: lineText, isWriteAccess: isWriteAccess, isDefinition: isDefinition }); } function isCompletionEntryData(data) { return data === undefined || data && typeof data === "object" diff --git a/lib/typescript.d.ts b/lib/typescript.d.ts index b86a3a29970a4..0cae15013d02c 100644 --- a/lib/typescript.d.ts +++ b/lib/typescript.d.ts @@ -5205,6 +5205,7 @@ declare namespace ts { * writeFileCallback */ writeFile?(path: string, data: string, writeByteOrderMark?: boolean): void; + getCustomTransformers?: (project: string) => CustomTransformers | undefined; getModifiedTime(fileName: string): Date | undefined; setModifiedTime(fileName: string, date: Date): void; deleteFile(fileName: string): void; diff --git a/lib/typescript.js b/lib/typescript.js index b3f80f1a315b2..59842e00c5ec4 100644 --- a/lib/typescript.js +++ b/lib/typescript.js @@ -290,7 +290,7 @@ var ts; // The following is baselined as a literal template type without intervention /** The version of the TypeScript compiler release */ // eslint-disable-next-line @typescript-eslint/no-inferrable-types - ts.version = "4.3.3"; + ts.version = "4.3.4"; /* @internal */ var Comparison; (function (Comparison) { @@ -17515,56 +17515,43 @@ var ts; } return __assign(__assign({}, writer), { writeTrailingSemicolon: function () { pendingTrailingSemicolon = true; - }, - writeLiteral: function (s) { + }, writeLiteral: function (s) { commitPendingTrailingSemicolon(); writer.writeLiteral(s); - }, - writeStringLiteral: function (s) { + }, writeStringLiteral: function (s) { commitPendingTrailingSemicolon(); writer.writeStringLiteral(s); - }, - writeSymbol: function (s, sym) { + }, writeSymbol: function (s, sym) { commitPendingTrailingSemicolon(); writer.writeSymbol(s, sym); - }, - writePunctuation: function (s) { + }, writePunctuation: function (s) { commitPendingTrailingSemicolon(); writer.writePunctuation(s); - }, - writeKeyword: function (s) { + }, writeKeyword: function (s) { commitPendingTrailingSemicolon(); writer.writeKeyword(s); - }, - writeOperator: function (s) { + }, writeOperator: function (s) { commitPendingTrailingSemicolon(); writer.writeOperator(s); - }, - writeParameter: function (s) { + }, writeParameter: function (s) { commitPendingTrailingSemicolon(); writer.writeParameter(s); - }, - writeSpace: function (s) { + }, writeSpace: function (s) { commitPendingTrailingSemicolon(); writer.writeSpace(s); - }, - writeProperty: function (s) { + }, writeProperty: function (s) { commitPendingTrailingSemicolon(); writer.writeProperty(s); - }, - writeComment: function (s) { + }, writeComment: function (s) { commitPendingTrailingSemicolon(); writer.writeComment(s); - }, - writeLine: function () { + }, writeLine: function () { commitPendingTrailingSemicolon(); writer.writeLine(); - }, - increaseIndent: function () { + }, increaseIndent: function () { commitPendingTrailingSemicolon(); writer.increaseIndent(); - }, - decreaseIndent: function () { + }, decreaseIndent: function () { commitPendingTrailingSemicolon(); writer.decreaseIndent(); } }); @@ -40499,9 +40486,7 @@ var ts; var preDirectoryResolutionCache = createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, directoryToModuleNameMap || (directoryToModuleNameMap = createCacheWithRedirects(options))); moduleNameToDirectoryMap || (moduleNameToDirectoryMap = createCacheWithRedirects(options)); var packageJsonInfoCache = createPackageJsonInfoCache(currentDirectory, getCanonicalFileName); - return __assign(__assign(__assign({}, packageJsonInfoCache), preDirectoryResolutionCache), { getOrCreateCacheForModuleName: getOrCreateCacheForModuleName, - clear: clear, - update: update, getPackageJsonInfoCache: function () { return packageJsonInfoCache; } }); + return __assign(__assign(__assign({}, packageJsonInfoCache), preDirectoryResolutionCache), { getOrCreateCacheForModuleName: getOrCreateCacheForModuleName, clear: clear, update: update, getPackageJsonInfoCache: function () { return packageJsonInfoCache; } }); function clear() { preDirectoryResolutionCache.clear(); moduleNameToDirectoryMap.clear(); @@ -116852,7 +116837,7 @@ var ts; }, emit: function (targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) { if (targetSourceFile || emitOnlyDtsFiles) { - return withProgramOrUndefined(function (program) { return program.emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers); }); + return withProgramOrUndefined(function (program) { var _a, _b; return program.emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers || ((_b = (_a = state.host).getCustomTransformers) === null || _b === void 0 ? void 0 : _b.call(_a, project))); }); } executeSteps(BuildStep.SemanticDiagnostics, cancellationToken); if (step === BuildStep.EmitBuildInfo) { @@ -116937,6 +116922,7 @@ var ts; } function emit(writeFileCallback, cancellationToken, customTransformers) { var _a; + var _b, _c; ts.Debug.assertIsDefined(program); ts.Debug.assert(step === BuildStep.Emit); // Before emitting lets backup state, so we can revert it back if there are declaration errors to handle emit and declaration errors correctly @@ -116947,7 +116933,7 @@ var ts; var emitResult = ts.emitFilesAndReportErrors(program, reportDeclarationDiagnostics, /*write*/ undefined, /*reportSummary*/ undefined, function (name, text, writeByteOrderMark) { return outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark }); }, cancellationToken, - /*emitOnlyDts*/ false, customTransformers).emitResult; + /*emitOnlyDts*/ false, customTransformers || ((_c = (_b = state.host).getCustomTransformers) === null || _c === void 0 ? void 0 : _c.call(_b, project))).emitResult; // Don't emit .d.ts if there are decl file errors if (declDiagnostics) { program.restoreState(); @@ -117029,6 +117015,7 @@ var ts; return emitDiagnostics; } function emitBundle(writeFileCallback, customTransformers) { + var _a, _b; ts.Debug.assert(kind === InvalidatedProjectKind.UpdateBundle); if (state.options.dry) { reportStatus(state, ts.Diagnostics.A_non_dry_build_would_update_output_of_project_0, project); @@ -117044,7 +117031,7 @@ var ts; var outputFiles = ts.emitUsingBuildInfo(config, compilerHost, function (ref) { var refName = resolveProjectName(state, ref.path); return parseConfigFile(state, refName, toResolvedConfigFilePath(state, refName)); - }, customTransformers); + }, customTransformers || ((_b = (_a = state.host).getCustomTransformers) === null || _b === void 0 ? void 0 : _b.call(_a, project))); if (ts.isString(outputFiles)) { reportStatus(state, ts.Diagnostics.Cannot_update_output_of_project_0_because_there_was_error_reading_file_1, project, relName(state, outputFiles)); step = BuildStep.BuildInvalidatedProjectOfBundle; @@ -121312,9 +121299,7 @@ var ts; [8 /* OptionalDependencies */, info.optionalDependencies], [4 /* PeerDependencies */, info.peerDependencies], ]; - return __assign(__assign({}, info), { parseable: !!content, fileName: fileName, - get: get, - has: function (dependencyName, inGroups) { + return __assign(__assign({}, info), { parseable: !!content, fileName: fileName, get: get, has: function (dependencyName, inGroups) { return !!get(dependencyName, inGroups); } }); function get(dependencyName, inGroups) { @@ -127740,9 +127725,7 @@ var ts; var name_1 = displayParts_1.map(function (p) { return p.text; }).join(""); var declaration = symbol.declarations && ts.firstOrUndefined(symbol.declarations); var node = declaration ? (ts.getNameOfDeclaration(declaration) || declaration) : originalNode; - return __assign(__assign({}, getFileAndTextSpanFromNode(node)), { name: name_1, - kind: kind_1, - displayParts: displayParts_1, context: getContextNode(declaration) }); + return __assign(__assign({}, getFileAndTextSpanFromNode(node)), { name: name_1, kind: kind_1, displayParts: displayParts_1, context: getContextNode(declaration) }); } case 1 /* Label */: { var node = def.node; @@ -127777,10 +127760,7 @@ var ts; } })(); var sourceFile = info.sourceFile, textSpan = info.textSpan, name = info.name, kind = info.kind, displayParts = info.displayParts, context = info.context; - return __assign({ containerKind: "" /* unknown */, containerName: "", fileName: sourceFile.fileName, kind: kind, - name: name, - textSpan: textSpan, - displayParts: displayParts }, toContextSpan(textSpan, sourceFile, context)); + return __assign({ containerKind: "" /* unknown */, containerName: "", fileName: sourceFile.fileName, kind: kind, name: name, textSpan: textSpan, displayParts: displayParts }, toContextSpan(textSpan, sourceFile, context)); } function getFileAndTextSpanFromNode(node) { var sourceFile = node.getSourceFile(); diff --git a/lib/typescriptServices.d.ts b/lib/typescriptServices.d.ts index 2d44d601a4731..af981316e9455 100644 --- a/lib/typescriptServices.d.ts +++ b/lib/typescriptServices.d.ts @@ -5205,6 +5205,7 @@ declare namespace ts { * writeFileCallback */ writeFile?(path: string, data: string, writeByteOrderMark?: boolean): void; + getCustomTransformers?: (project: string) => CustomTransformers | undefined; getModifiedTime(fileName: string): Date | undefined; setModifiedTime(fileName: string, date: Date): void; deleteFile(fileName: string): void; diff --git a/lib/typescriptServices.js b/lib/typescriptServices.js index 78539cc744019..cf1c925cc6e5e 100644 --- a/lib/typescriptServices.js +++ b/lib/typescriptServices.js @@ -290,7 +290,7 @@ var ts; // The following is baselined as a literal template type without intervention /** The version of the TypeScript compiler release */ // eslint-disable-next-line @typescript-eslint/no-inferrable-types - ts.version = "4.3.3"; + ts.version = "4.3.4"; /* @internal */ var Comparison; (function (Comparison) { @@ -17515,56 +17515,43 @@ var ts; } return __assign(__assign({}, writer), { writeTrailingSemicolon: function () { pendingTrailingSemicolon = true; - }, - writeLiteral: function (s) { + }, writeLiteral: function (s) { commitPendingTrailingSemicolon(); writer.writeLiteral(s); - }, - writeStringLiteral: function (s) { + }, writeStringLiteral: function (s) { commitPendingTrailingSemicolon(); writer.writeStringLiteral(s); - }, - writeSymbol: function (s, sym) { + }, writeSymbol: function (s, sym) { commitPendingTrailingSemicolon(); writer.writeSymbol(s, sym); - }, - writePunctuation: function (s) { + }, writePunctuation: function (s) { commitPendingTrailingSemicolon(); writer.writePunctuation(s); - }, - writeKeyword: function (s) { + }, writeKeyword: function (s) { commitPendingTrailingSemicolon(); writer.writeKeyword(s); - }, - writeOperator: function (s) { + }, writeOperator: function (s) { commitPendingTrailingSemicolon(); writer.writeOperator(s); - }, - writeParameter: function (s) { + }, writeParameter: function (s) { commitPendingTrailingSemicolon(); writer.writeParameter(s); - }, - writeSpace: function (s) { + }, writeSpace: function (s) { commitPendingTrailingSemicolon(); writer.writeSpace(s); - }, - writeProperty: function (s) { + }, writeProperty: function (s) { commitPendingTrailingSemicolon(); writer.writeProperty(s); - }, - writeComment: function (s) { + }, writeComment: function (s) { commitPendingTrailingSemicolon(); writer.writeComment(s); - }, - writeLine: function () { + }, writeLine: function () { commitPendingTrailingSemicolon(); writer.writeLine(); - }, - increaseIndent: function () { + }, increaseIndent: function () { commitPendingTrailingSemicolon(); writer.increaseIndent(); - }, - decreaseIndent: function () { + }, decreaseIndent: function () { commitPendingTrailingSemicolon(); writer.decreaseIndent(); } }); @@ -40499,9 +40486,7 @@ var ts; var preDirectoryResolutionCache = createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, directoryToModuleNameMap || (directoryToModuleNameMap = createCacheWithRedirects(options))); moduleNameToDirectoryMap || (moduleNameToDirectoryMap = createCacheWithRedirects(options)); var packageJsonInfoCache = createPackageJsonInfoCache(currentDirectory, getCanonicalFileName); - return __assign(__assign(__assign({}, packageJsonInfoCache), preDirectoryResolutionCache), { getOrCreateCacheForModuleName: getOrCreateCacheForModuleName, - clear: clear, - update: update, getPackageJsonInfoCache: function () { return packageJsonInfoCache; } }); + return __assign(__assign(__assign({}, packageJsonInfoCache), preDirectoryResolutionCache), { getOrCreateCacheForModuleName: getOrCreateCacheForModuleName, clear: clear, update: update, getPackageJsonInfoCache: function () { return packageJsonInfoCache; } }); function clear() { preDirectoryResolutionCache.clear(); moduleNameToDirectoryMap.clear(); @@ -116852,7 +116837,7 @@ var ts; }, emit: function (targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) { if (targetSourceFile || emitOnlyDtsFiles) { - return withProgramOrUndefined(function (program) { return program.emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers); }); + return withProgramOrUndefined(function (program) { var _a, _b; return program.emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers || ((_b = (_a = state.host).getCustomTransformers) === null || _b === void 0 ? void 0 : _b.call(_a, project))); }); } executeSteps(BuildStep.SemanticDiagnostics, cancellationToken); if (step === BuildStep.EmitBuildInfo) { @@ -116937,6 +116922,7 @@ var ts; } function emit(writeFileCallback, cancellationToken, customTransformers) { var _a; + var _b, _c; ts.Debug.assertIsDefined(program); ts.Debug.assert(step === BuildStep.Emit); // Before emitting lets backup state, so we can revert it back if there are declaration errors to handle emit and declaration errors correctly @@ -116947,7 +116933,7 @@ var ts; var emitResult = ts.emitFilesAndReportErrors(program, reportDeclarationDiagnostics, /*write*/ undefined, /*reportSummary*/ undefined, function (name, text, writeByteOrderMark) { return outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark }); }, cancellationToken, - /*emitOnlyDts*/ false, customTransformers).emitResult; + /*emitOnlyDts*/ false, customTransformers || ((_c = (_b = state.host).getCustomTransformers) === null || _c === void 0 ? void 0 : _c.call(_b, project))).emitResult; // Don't emit .d.ts if there are decl file errors if (declDiagnostics) { program.restoreState(); @@ -117029,6 +117015,7 @@ var ts; return emitDiagnostics; } function emitBundle(writeFileCallback, customTransformers) { + var _a, _b; ts.Debug.assert(kind === InvalidatedProjectKind.UpdateBundle); if (state.options.dry) { reportStatus(state, ts.Diagnostics.A_non_dry_build_would_update_output_of_project_0, project); @@ -117044,7 +117031,7 @@ var ts; var outputFiles = ts.emitUsingBuildInfo(config, compilerHost, function (ref) { var refName = resolveProjectName(state, ref.path); return parseConfigFile(state, refName, toResolvedConfigFilePath(state, refName)); - }, customTransformers); + }, customTransformers || ((_b = (_a = state.host).getCustomTransformers) === null || _b === void 0 ? void 0 : _b.call(_a, project))); if (ts.isString(outputFiles)) { reportStatus(state, ts.Diagnostics.Cannot_update_output_of_project_0_because_there_was_error_reading_file_1, project, relName(state, outputFiles)); step = BuildStep.BuildInvalidatedProjectOfBundle; @@ -121312,9 +121299,7 @@ var ts; [8 /* OptionalDependencies */, info.optionalDependencies], [4 /* PeerDependencies */, info.peerDependencies], ]; - return __assign(__assign({}, info), { parseable: !!content, fileName: fileName, - get: get, - has: function (dependencyName, inGroups) { + return __assign(__assign({}, info), { parseable: !!content, fileName: fileName, get: get, has: function (dependencyName, inGroups) { return !!get(dependencyName, inGroups); } }); function get(dependencyName, inGroups) { @@ -127740,9 +127725,7 @@ var ts; var name_1 = displayParts_1.map(function (p) { return p.text; }).join(""); var declaration = symbol.declarations && ts.firstOrUndefined(symbol.declarations); var node = declaration ? (ts.getNameOfDeclaration(declaration) || declaration) : originalNode; - return __assign(__assign({}, getFileAndTextSpanFromNode(node)), { name: name_1, - kind: kind_1, - displayParts: displayParts_1, context: getContextNode(declaration) }); + return __assign(__assign({}, getFileAndTextSpanFromNode(node)), { name: name_1, kind: kind_1, displayParts: displayParts_1, context: getContextNode(declaration) }); } case 1 /* Label */: { var node = def.node; @@ -127777,10 +127760,7 @@ var ts; } })(); var sourceFile = info.sourceFile, textSpan = info.textSpan, name = info.name, kind = info.kind, displayParts = info.displayParts, context = info.context; - return __assign({ containerKind: "" /* unknown */, containerName: "", fileName: sourceFile.fileName, kind: kind, - name: name, - textSpan: textSpan, - displayParts: displayParts }, toContextSpan(textSpan, sourceFile, context)); + return __assign({ containerKind: "" /* unknown */, containerName: "", fileName: sourceFile.fileName, kind: kind, name: name, textSpan: textSpan, displayParts: displayParts }, toContextSpan(textSpan, sourceFile, context)); } function getFileAndTextSpanFromNode(node) { var sourceFile = node.getSourceFile(); diff --git a/lib/typingsInstaller.js b/lib/typingsInstaller.js index 859392ce380af..5aa1daffbbe5c 100644 --- a/lib/typingsInstaller.js +++ b/lib/typingsInstaller.js @@ -85,7 +85,7 @@ var ts; // The following is baselined as a literal template type without intervention /** The version of the TypeScript compiler release */ // eslint-disable-next-line @typescript-eslint/no-inferrable-types - ts.version = "4.3.3"; + ts.version = "4.3.4"; /* @internal */ var Comparison; (function (Comparison) { @@ -17310,56 +17310,43 @@ var ts; } return __assign(__assign({}, writer), { writeTrailingSemicolon: function () { pendingTrailingSemicolon = true; - }, - writeLiteral: function (s) { + }, writeLiteral: function (s) { commitPendingTrailingSemicolon(); writer.writeLiteral(s); - }, - writeStringLiteral: function (s) { + }, writeStringLiteral: function (s) { commitPendingTrailingSemicolon(); writer.writeStringLiteral(s); - }, - writeSymbol: function (s, sym) { + }, writeSymbol: function (s, sym) { commitPendingTrailingSemicolon(); writer.writeSymbol(s, sym); - }, - writePunctuation: function (s) { + }, writePunctuation: function (s) { commitPendingTrailingSemicolon(); writer.writePunctuation(s); - }, - writeKeyword: function (s) { + }, writeKeyword: function (s) { commitPendingTrailingSemicolon(); writer.writeKeyword(s); - }, - writeOperator: function (s) { + }, writeOperator: function (s) { commitPendingTrailingSemicolon(); writer.writeOperator(s); - }, - writeParameter: function (s) { + }, writeParameter: function (s) { commitPendingTrailingSemicolon(); writer.writeParameter(s); - }, - writeSpace: function (s) { + }, writeSpace: function (s) { commitPendingTrailingSemicolon(); writer.writeSpace(s); - }, - writeProperty: function (s) { + }, writeProperty: function (s) { commitPendingTrailingSemicolon(); writer.writeProperty(s); - }, - writeComment: function (s) { + }, writeComment: function (s) { commitPendingTrailingSemicolon(); writer.writeComment(s); - }, - writeLine: function () { + }, writeLine: function () { commitPendingTrailingSemicolon(); writer.writeLine(); - }, - increaseIndent: function () { + }, increaseIndent: function () { commitPendingTrailingSemicolon(); writer.increaseIndent(); - }, - decreaseIndent: function () { + }, decreaseIndent: function () { commitPendingTrailingSemicolon(); writer.decreaseIndent(); } }); @@ -40294,9 +40281,7 @@ var ts; var preDirectoryResolutionCache = createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, directoryToModuleNameMap || (directoryToModuleNameMap = createCacheWithRedirects(options))); moduleNameToDirectoryMap || (moduleNameToDirectoryMap = createCacheWithRedirects(options)); var packageJsonInfoCache = createPackageJsonInfoCache(currentDirectory, getCanonicalFileName); - return __assign(__assign(__assign({}, packageJsonInfoCache), preDirectoryResolutionCache), { getOrCreateCacheForModuleName: getOrCreateCacheForModuleName, - clear: clear, - update: update, getPackageJsonInfoCache: function () { return packageJsonInfoCache; } }); + return __assign(__assign(__assign({}, packageJsonInfoCache), preDirectoryResolutionCache), { getOrCreateCacheForModuleName: getOrCreateCacheForModuleName, clear: clear, update: update, getPackageJsonInfoCache: function () { return packageJsonInfoCache; } }); function clear() { preDirectoryResolutionCache.clear(); moduleNameToDirectoryMap.clear(); @@ -116647,7 +116632,7 @@ var ts; }, emit: function (targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) { if (targetSourceFile || emitOnlyDtsFiles) { - return withProgramOrUndefined(function (program) { return program.emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers); }); + return withProgramOrUndefined(function (program) { var _a, _b; return program.emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers || ((_b = (_a = state.host).getCustomTransformers) === null || _b === void 0 ? void 0 : _b.call(_a, project))); }); } executeSteps(BuildStep.SemanticDiagnostics, cancellationToken); if (step === BuildStep.EmitBuildInfo) { @@ -116732,6 +116717,7 @@ var ts; } function emit(writeFileCallback, cancellationToken, customTransformers) { var _a; + var _b, _c; ts.Debug.assertIsDefined(program); ts.Debug.assert(step === BuildStep.Emit); // Before emitting lets backup state, so we can revert it back if there are declaration errors to handle emit and declaration errors correctly @@ -116742,7 +116728,7 @@ var ts; var emitResult = ts.emitFilesAndReportErrors(program, reportDeclarationDiagnostics, /*write*/ undefined, /*reportSummary*/ undefined, function (name, text, writeByteOrderMark) { return outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark }); }, cancellationToken, - /*emitOnlyDts*/ false, customTransformers).emitResult; + /*emitOnlyDts*/ false, customTransformers || ((_c = (_b = state.host).getCustomTransformers) === null || _c === void 0 ? void 0 : _c.call(_b, project))).emitResult; // Don't emit .d.ts if there are decl file errors if (declDiagnostics) { program.restoreState(); @@ -116824,6 +116810,7 @@ var ts; return emitDiagnostics; } function emitBundle(writeFileCallback, customTransformers) { + var _a, _b; ts.Debug.assert(kind === InvalidatedProjectKind.UpdateBundle); if (state.options.dry) { reportStatus(state, ts.Diagnostics.A_non_dry_build_would_update_output_of_project_0, project); @@ -116839,7 +116826,7 @@ var ts; var outputFiles = ts.emitUsingBuildInfo(config, compilerHost, function (ref) { var refName = resolveProjectName(state, ref.path); return parseConfigFile(state, refName, toResolvedConfigFilePath(state, refName)); - }, customTransformers); + }, customTransformers || ((_b = (_a = state.host).getCustomTransformers) === null || _b === void 0 ? void 0 : _b.call(_a, project))); if (ts.isString(outputFiles)) { reportStatus(state, ts.Diagnostics.Cannot_update_output_of_project_0_because_there_was_error_reading_file_1, project, relName(state, outputFiles)); step = BuildStep.BuildInvalidatedProjectOfBundle; diff --git a/package.json b/package.json index 0f515e9766e5d..a5eeae7d13e0b 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "typescript", "author": "Microsoft Corp.", "homepage": "https://www.typescriptlang.org/", - "version": "4.3.3", + "version": "4.3.4", "license": "Apache-2.0", "description": "TypeScript is a language for application scale JavaScript development", "keywords": [ diff --git a/src/compiler/corePublic.ts b/src/compiler/corePublic.ts index 8d3e8d5c8a4d7..ed8388e45b195 100644 --- a/src/compiler/corePublic.ts +++ b/src/compiler/corePublic.ts @@ -5,7 +5,7 @@ namespace ts { // The following is baselined as a literal template type without intervention /** The version of the TypeScript compiler release */ // eslint-disable-next-line @typescript-eslint/no-inferrable-types - export const version = "4.3.3" as string; + export const version = "4.3.4" as string; /** * Type of objects whose values are all of the same type. diff --git a/src/compiler/tsbuildPublic.ts b/src/compiler/tsbuildPublic.ts index ec2097dd9552d..bef0831691493 100644 --- a/src/compiler/tsbuildPublic.ts +++ b/src/compiler/tsbuildPublic.ts @@ -85,6 +85,7 @@ namespace ts { * writeFileCallback */ writeFile?(path: string, data: string, writeByteOrderMark?: boolean): void; + getCustomTransformers?: (project: string) => CustomTransformers | undefined; getModifiedTime(fileName: string): Date | undefined; setModifiedTime(fileName: string, date: Date): void; @@ -785,7 +786,7 @@ namespace ts { emit: (targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) => { if (targetSourceFile || emitOnlyDtsFiles) { return withProgramOrUndefined( - program => program.emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) + program => program.emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers || state.host.getCustomTransformers?.(project)) ); } executeSteps(BuildStep.SemanticDiagnostics, cancellationToken); @@ -921,7 +922,7 @@ namespace ts { (name, text, writeByteOrderMark) => outputFiles.push({ name, text, writeByteOrderMark }), cancellationToken, /*emitOnlyDts*/ false, - customTransformers + customTransformers || state.host.getCustomTransformers?.(project) ); // Don't emit .d.ts if there are decl file errors if (declDiagnostics) { @@ -1060,7 +1061,7 @@ namespace ts { const refName = resolveProjectName(state, ref.path); return parseConfigFile(state, refName, toResolvedConfigFilePath(state, refName)); }, - customTransformers + customTransformers || state.host.getCustomTransformers?.(project) ); if (isString(outputFiles)) { diff --git a/src/testRunner/tsconfig.json b/src/testRunner/tsconfig.json index 439b447d6396f..cc52d75d36bce 100644 --- a/src/testRunner/tsconfig.json +++ b/src/testRunner/tsconfig.json @@ -137,6 +137,7 @@ "unittests/tsbuild/transitiveReferences.ts", "unittests/tsbuild/watchEnvironment.ts", "unittests/tsbuild/watchMode.ts", + "unittests/tsbuildWatch/publicApi.ts", "unittests/tsc/composite.ts", "unittests/tsc/declarationEmit.ts", "unittests/tsc/incremental.ts", diff --git a/src/testRunner/unittests/tsbuildWatch/publicApi.ts b/src/testRunner/unittests/tsbuildWatch/publicApi.ts new file mode 100644 index 0000000000000..bca1472e0d893 --- /dev/null +++ b/src/testRunner/unittests/tsbuildWatch/publicApi.ts @@ -0,0 +1,115 @@ +namespace ts.tscWatch { + it("unittests:: tsbuildWatch:: watchMode:: Public API with custom transformers", () => { + const solution: File = { + path: `${projectRoot}/tsconfig.json`, + content: JSON.stringify({ + references: [ + { path: "./shared/tsconfig.json" }, + { path: "./webpack/tsconfig.json" } + ], + files: [] + }) + }; + const sharedConfig: File = { + path: `${projectRoot}/shared/tsconfig.json`, + content: JSON.stringify({ + compilerOptions: { composite: true }, + }) + }; + const sharedIndex: File = { + path: `${projectRoot}/shared/index.ts`, + content: `export function f1() { } +export class c { } +export enum e { } +// leading +export function f2() { } // trailing` + }; + const webpackConfig: File = { + path: `${projectRoot}/webpack/tsconfig.json`, + content: JSON.stringify({ + compilerOptions: { composite: true, }, + references: [{ path: "../shared/tsconfig.json" }] + }) + }; + const webpackIndex: File = { + path: `${projectRoot}/webpack/index.ts`, + content: `export function f2() { } +export class c2 { } +export enum e2 { } +// leading +export function f22() { } // trailing` + }; + const commandLineArgs = ["--b", "--w"]; + const { sys, baseline, oldSnap } = createBaseline(createWatchedSystem([libFile, solution, sharedConfig, sharedIndex, webpackConfig, webpackIndex], { currentDirectory: projectRoot })); + const { cb, getPrograms } = commandLineCallbacks(sys); + const buildHost = createSolutionBuilderWithWatchHost( + sys, + /*createProgram*/ undefined, + createDiagnosticReporter(sys, /*pretty*/ true), + createBuilderStatusReporter(sys, /*pretty*/ true), + createWatchStatusReporter(sys, /*pretty*/ true) + ); + buildHost.afterProgramEmitAndDiagnostics = cb; + buildHost.afterEmitBundle = cb; + buildHost.getCustomTransformers = getCustomTransformers; + const builder = createSolutionBuilderWithWatch(buildHost, [solution.path], { verbose: true }); + builder.build(); + runWatchBaseline({ + scenario: "publicApi", + subScenario: "with custom transformers", + commandLineArgs, + sys, + baseline, + oldSnap, + getPrograms, + changes: [ + { + caption: "change to shared", + change: sys => sys.prependFile(sharedIndex.path, "export function fooBar() {}"), + timeouts: sys => { + sys.checkTimeoutQueueLengthAndRun(1); // Shared + sys.checkTimeoutQueueLengthAndRun(1); // webpack + sys.checkTimeoutQueueLengthAndRun(1); // solution + sys.checkTimeoutQueueLength(0); + } + } + ], + watchOrSolution: builder + }); + + function getCustomTransformers(project: string): CustomTransformers { + const before: TransformerFactory = context => { + return file => visitEachChild(file, visit, context); + function visit(node: Node): VisitResult { + switch (node.kind) { + case SyntaxKind.FunctionDeclaration: + return visitFunction(node as FunctionDeclaration); + default: + return visitEachChild(node, visit, context); + } + } + function visitFunction(node: FunctionDeclaration) { + addSyntheticLeadingComment(node, SyntaxKind.MultiLineCommentTrivia, `@before${project}`, /*hasTrailingNewLine*/ true); + return node; + } + }; + + const after: TransformerFactory = context => { + return file => visitEachChild(file, visit, context); + function visit(node: Node): VisitResult { + switch (node.kind) { + case SyntaxKind.VariableStatement: + return visitVariableStatement(node as VariableStatement); + default: + return visitEachChild(node, visit, context); + } + } + function visitVariableStatement(node: VariableStatement) { + addSyntheticLeadingComment(node, SyntaxKind.SingleLineCommentTrivia, `@after${project}`); + return node; + } + }; + return { before: [before], after: [after] }; + } + }); +} \ No newline at end of file diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 6195d669a8306..d6750c44d0a2e 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -5205,6 +5205,7 @@ declare namespace ts { * writeFileCallback */ writeFile?(path: string, data: string, writeByteOrderMark?: boolean): void; + getCustomTransformers?: (project: string) => CustomTransformers | undefined; getModifiedTime(fileName: string): Date | undefined; setModifiedTime(fileName: string, date: Date): void; deleteFile(fileName: string): void; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index b86a3a29970a4..0cae15013d02c 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -5205,6 +5205,7 @@ declare namespace ts { * writeFileCallback */ writeFile?(path: string, data: string, writeByteOrderMark?: boolean): void; + getCustomTransformers?: (project: string) => CustomTransformers | undefined; getModifiedTime(fileName: string): Date | undefined; setModifiedTime(fileName: string, date: Date): void; deleteFile(fileName: string): void; diff --git a/tests/baselines/reference/tsbuild/watchMode/publicApi/with-custom-transformers.js b/tests/baselines/reference/tsbuild/watchMode/publicApi/with-custom-transformers.js new file mode 100644 index 0000000000000..cb6cf6f589af1 --- /dev/null +++ b/tests/baselines/reference/tsbuild/watchMode/publicApi/with-custom-transformers.js @@ -0,0 +1,383 @@ +Input:: +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } + +//// [/user/username/projects/myproject/tsconfig.json] +{"references":[{"path":"./shared/tsconfig.json"},{"path":"./webpack/tsconfig.json"}],"files":[]} + +//// [/user/username/projects/myproject/shared/tsconfig.json] +{"compilerOptions":{"composite":true}} + +//// [/user/username/projects/myproject/shared/index.ts] +export function f1() { } +export class c { } +export enum e { } +// leading +export function f2() { } // trailing + +//// [/user/username/projects/myproject/webpack/tsconfig.json] +{"compilerOptions":{"composite":true},"references":[{"path":"../shared/tsconfig.json"}]} + +//// [/user/username/projects/myproject/webpack/index.ts] +export function f2() { } +export class c2 { } +export enum e2 { } +// leading +export function f22() { } // trailing + + +/a/lib/tsc.js --b --w +Output:: +[12:00:31 AM] Projects in this build: + * shared/tsconfig.json + * webpack/tsconfig.json + * tsconfig.json + +[12:00:32 AM] Project 'shared/tsconfig.json' is out of date because output file 'shared/index.js' does not exist + +[12:00:33 AM] Building project '/user/username/projects/myproject/shared/tsconfig.json'... + +[12:00:42 AM] Project 'webpack/tsconfig.json' is out of date because output file 'webpack/index.js' does not exist + +[12:00:43 AM] Building project '/user/username/projects/myproject/webpack/tsconfig.json'... + +[12:00:52 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/shared/index.ts"] +Program options: {"composite":true,"configFilePath":"/user/username/projects/myproject/shared/tsconfig.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/shared/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/myproject/shared/index.ts + +Program root files: ["/user/username/projects/myproject/webpack/index.ts"] +Program options: {"composite":true,"configFilePath":"/user/username/projects/myproject/webpack/tsconfig.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/webpack/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/myproject/webpack/index.ts + +WatchedFiles:: +/user/username/projects/myproject/shared/tsconfig.json: + {"fileName":"/user/username/projects/myproject/shared/tsconfig.json","pollingInterval":250} +/user/username/projects/myproject/shared/index.ts: + {"fileName":"/user/username/projects/myproject/shared/index.ts","pollingInterval":250} +/user/username/projects/myproject/webpack/tsconfig.json: + {"fileName":"/user/username/projects/myproject/webpack/tsconfig.json","pollingInterval":250} +/user/username/projects/myproject/webpack/index.ts: + {"fileName":"/user/username/projects/myproject/webpack/index.ts","pollingInterval":250} +/user/username/projects/myproject/tsconfig.json: + {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/myproject/shared: + {"directoryName":"/user/username/projects/myproject/shared","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/myproject/webpack: + {"directoryName":"/user/username/projects/myproject/webpack","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/shared/index.js] +"use strict"; +exports.__esModule = true; +exports.f2 = exports.e = exports.c = exports.f1 = void 0; +/*@before/user/username/projects/myproject/shared/tsconfig.json*/ +function f1() { } +exports.f1 = f1; +//@after/user/username/projects/myproject/shared/tsconfig.json +var c = /** @class */ (function () { + function c() { + } + return c; +}()); +exports.c = c; +//@after/user/username/projects/myproject/shared/tsconfig.json +var e; +(function (e) { +})(e = exports.e || (exports.e = {})); +// leading +/*@before/user/username/projects/myproject/shared/tsconfig.json*/ +function f2() { } // trailing +exports.f2 = f2; + + +//// [/user/username/projects/myproject/shared/index.d.ts] +export declare function f1(): void; +export declare class c { +} +export declare enum e { +} +export declare function f2(): void; + + +//// [/user/username/projects/myproject/shared/tsconfig.tsbuildinfo] +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"8649344783-export function f1() { }\nexport class c { }\nexport enum e { }\n// leading\nexport function f2() { } // trailing"],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} + +//// [/user/username/projects/myproject/shared/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "./index.ts" + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "./index.ts": { + "version": "8649344783-export function f1() { }\nexport class c { }\nexport enum e { }\n// leading\nexport function f2() { } // trailing", + "signature": "8649344783-export function f1() { }\nexport class c { }\nexport enum e { }\n// leading\nexport function f2() { } // trailing" + } + }, + "options": { + "composite": true + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion", + "size": 745 +} + +//// [/user/username/projects/myproject/webpack/index.js] +"use strict"; +exports.__esModule = true; +exports.f22 = exports.e2 = exports.c2 = exports.f2 = void 0; +/*@before/user/username/projects/myproject/webpack/tsconfig.json*/ +function f2() { } +exports.f2 = f2; +//@after/user/username/projects/myproject/webpack/tsconfig.json +var c2 = /** @class */ (function () { + function c2() { + } + return c2; +}()); +exports.c2 = c2; +//@after/user/username/projects/myproject/webpack/tsconfig.json +var e2; +(function (e2) { +})(e2 = exports.e2 || (exports.e2 = {})); +// leading +/*@before/user/username/projects/myproject/webpack/tsconfig.json*/ +function f22() { } // trailing +exports.f22 = f22; + + +//// [/user/username/projects/myproject/webpack/index.d.ts] +export declare function f2(): void; +export declare class c2 { +} +export declare enum e2 { +} +export declare function f22(): void; + + +//// [/user/username/projects/myproject/webpack/tsconfig.tsbuildinfo] +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"20140662566-export function f2() { }\nexport class c2 { }\nexport enum e2 { }\n// leading\nexport function f22() { } // trailing"],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} + +//// [/user/username/projects/myproject/webpack/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "./index.ts" + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "./index.ts": { + "version": "20140662566-export function f2() { }\nexport class c2 { }\nexport enum e2 { }\n// leading\nexport function f22() { } // trailing", + "signature": "20140662566-export function f2() { }\nexport class c2 { }\nexport enum e2 { }\n// leading\nexport function f22() { } // trailing" + } + }, + "options": { + "composite": true + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion", + "size": 749 +} + + +Change:: change to shared + +Input:: +//// [/user/username/projects/myproject/shared/index.ts] +export function fooBar() {}export function f1() { } +export class c { } +export enum e { } +// leading +export function f2() { } // trailing + + +Output:: +>> Screen clear +[12:00:55 AM] File change detected. Starting incremental compilation... + +[12:00:56 AM] Project 'shared/tsconfig.json' is out of date because oldest output 'shared/index.js' is older than newest input 'shared/index.ts' + +[12:00:57 AM] Building project '/user/username/projects/myproject/shared/tsconfig.json'... + +[12:01:10 AM] Project 'webpack/tsconfig.json' is out of date because oldest output 'webpack/index.js' is older than newest input 'shared/tsconfig.json' + +[12:01:11 AM] Building project '/user/username/projects/myproject/webpack/tsconfig.json'... + +[12:01:13 AM] Updating unchanged output timestamps of project '/user/username/projects/myproject/webpack/tsconfig.json'... + +[12:01:14 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/shared/index.ts"] +Program options: {"composite":true,"configFilePath":"/user/username/projects/myproject/shared/tsconfig.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/shared/index.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/myproject/shared/index.ts + +Program root files: ["/user/username/projects/myproject/webpack/index.ts"] +Program options: {"composite":true,"configFilePath":"/user/username/projects/myproject/webpack/tsconfig.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/webpack/index.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/myproject/shared/tsconfig.json: + {"fileName":"/user/username/projects/myproject/shared/tsconfig.json","pollingInterval":250} +/user/username/projects/myproject/shared/index.ts: + {"fileName":"/user/username/projects/myproject/shared/index.ts","pollingInterval":250} +/user/username/projects/myproject/webpack/tsconfig.json: + {"fileName":"/user/username/projects/myproject/webpack/tsconfig.json","pollingInterval":250} +/user/username/projects/myproject/webpack/index.ts: + {"fileName":"/user/username/projects/myproject/webpack/index.ts","pollingInterval":250} +/user/username/projects/myproject/tsconfig.json: + {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/myproject/shared: + {"directoryName":"/user/username/projects/myproject/shared","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/myproject/webpack: + {"directoryName":"/user/username/projects/myproject/webpack","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/shared/index.js] +"use strict"; +exports.__esModule = true; +exports.f2 = exports.e = exports.c = exports.f1 = exports.fooBar = void 0; +/*@before/user/username/projects/myproject/shared/tsconfig.json*/ +function fooBar() { } +exports.fooBar = fooBar; +/*@before/user/username/projects/myproject/shared/tsconfig.json*/ +function f1() { } +exports.f1 = f1; +//@after/user/username/projects/myproject/shared/tsconfig.json +var c = /** @class */ (function () { + function c() { + } + return c; +}()); +exports.c = c; +//@after/user/username/projects/myproject/shared/tsconfig.json +var e; +(function (e) { +})(e = exports.e || (exports.e = {})); +// leading +/*@before/user/username/projects/myproject/shared/tsconfig.json*/ +function f2() { } // trailing +exports.f2 = f2; + + +//// [/user/username/projects/myproject/shared/index.d.ts] +export declare function fooBar(): void; +export declare function f1(): void; +export declare class c { +} +export declare enum e { +} +export declare function f2(): void; + + +//// [/user/username/projects/myproject/shared/tsconfig.tsbuildinfo] +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"14127205977-export function fooBar() {}export function f1() { }\nexport class c { }\nexport enum e { }\n// leading\nexport function f2() { } // trailing","signature":"1966424426-export declare function fooBar(): void;\nexport declare function f1(): void;\nexport declare class c {\n}\nexport declare enum e {\n}\nexport declare function f2(): void;\n"}],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} + +//// [/user/username/projects/myproject/shared/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "./index.ts" + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "./index.ts": { + "version": "14127205977-export function fooBar() {}export function f1() { }\nexport class c { }\nexport enum e { }\n// leading\nexport function f2() { } // trailing", + "signature": "1966424426-export declare function fooBar(): void;\nexport declare function f1(): void;\nexport declare class c {\n}\nexport declare enum e {\n}\nexport declare function f2(): void;\n" + } + }, + "options": { + "composite": true + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion", + "size": 983 +} + +//// [/user/username/projects/myproject/webpack/index.js] file changed its modified time +//// [/user/username/projects/myproject/webpack/index.d.ts] file changed its modified time +//// [/user/username/projects/myproject/webpack/tsconfig.tsbuildinfo] file changed its modified time