@typescript-deploys/pr-build 4.8.0-pr-49285-33 → 4.8.0-pr-49156-9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/tsc.js +109 -50
- package/lib/tsserver.js +118 -53
- package/lib/tsserverlibrary.js +118 -53
- package/lib/typescript.js +118 -53
- package/lib/typescriptServices.js +118 -53
- package/lib/typingsInstaller.js +118 -53
- package/package.json +1 -1
package/lib/tsserver.js
CHANGED
|
@@ -108647,12 +108647,6 @@ var ts;
|
|
|
108647
108647
|
/*@internal*/
|
|
108648
108648
|
var ts;
|
|
108649
108649
|
(function (ts) {
|
|
108650
|
-
function getDeclarationDiagnostics(host, resolver, file) {
|
|
108651
|
-
var compilerOptions = host.getCompilerOptions();
|
|
108652
|
-
var result = ts.transformNodes(resolver, host, ts.factory, compilerOptions, file ? [file] : ts.filter(host.getSourceFiles(), ts.isSourceFileNotJson), [transformDeclarations], /*allowDtsFiles*/ false);
|
|
108653
|
-
return result.diagnostics;
|
|
108654
|
-
}
|
|
108655
|
-
ts.getDeclarationDiagnostics = getDeclarationDiagnostics;
|
|
108656
108650
|
function hasInternalAnnotation(range, currentSourceFile) {
|
|
108657
108651
|
var comment = currentSourceFile.text.substring(range.pos, range.end);
|
|
108658
108652
|
return ts.stringContains(comment, "@internal");
|
|
@@ -110843,6 +110837,14 @@ var ts;
|
|
|
110843
110837
|
}
|
|
110844
110838
|
ts.getFirstProjectOutput = getFirstProjectOutput;
|
|
110845
110839
|
/*@internal*/
|
|
110840
|
+
function getCacheDtsEmitResultKey(sourceFileOrBundle, options) {
|
|
110841
|
+
return ts.isSourceFile(sourceFileOrBundle) ? sourceFileOrBundle.resolvedPath : ts.outFile(options);
|
|
110842
|
+
}
|
|
110843
|
+
ts.getCacheDtsEmitResultKey = getCacheDtsEmitResultKey;
|
|
110844
|
+
function isForceDtsEmitResult(result) {
|
|
110845
|
+
return !!result && !result.transformed;
|
|
110846
|
+
}
|
|
110847
|
+
/*@internal*/
|
|
110846
110848
|
// targetSourceFile is when users only want one file in entire project to be emitted. This is used in compileOnSave feature
|
|
110847
110849
|
function emitFiles(resolver, host, targetSourceFile, _a, emitOnlyDtsFiles, onlyBuildInfo, forceDtsEmit) {
|
|
110848
110850
|
var scriptTransformers = _a.scriptTransformers, declarationTransformers = _a.declarationTransformers;
|
|
@@ -110855,7 +110857,6 @@ var ts;
|
|
|
110855
110857
|
var _b = ts.performance.createTimer("printTime", "beforePrint", "afterPrint"), enter = _b.enter, exit = _b.exit;
|
|
110856
110858
|
var bundleBuildInfo;
|
|
110857
110859
|
var emitSkipped = false;
|
|
110858
|
-
var exportedModulesFromDeclarationEmit;
|
|
110859
110860
|
// Emit each output file
|
|
110860
110861
|
enter();
|
|
110861
110862
|
forEachEmittedFile(host, emitSourceFileOrBundle, ts.getSourceFilesToEmit(host, targetSourceFile, forceDtsEmit), forceDtsEmit, onlyBuildInfo, !targetSourceFile);
|
|
@@ -110865,7 +110866,6 @@ var ts;
|
|
|
110865
110866
|
diagnostics: emitterDiagnostics.getDiagnostics(),
|
|
110866
110867
|
emittedFiles: emittedFilesList,
|
|
110867
110868
|
sourceMaps: sourceMapDataList,
|
|
110868
|
-
exportedModulesFromDeclarationEmit: exportedModulesFromDeclarationEmit
|
|
110869
110869
|
};
|
|
110870
110870
|
function emitSourceFileOrBundle(_a, sourceFileOrBundle) {
|
|
110871
110871
|
var jsFilePath = _a.jsFilePath, sourceMapFilePath = _a.sourceMapFilePath, declarationFilePath = _a.declarationFilePath, declarationMapPath = _a.declarationMapPath, buildInfoPath = _a.buildInfoPath;
|
|
@@ -110956,14 +110956,14 @@ var ts;
|
|
|
110956
110956
|
isEmitNotificationEnabled: transform.isEmitNotificationEnabled,
|
|
110957
110957
|
substituteNode: transform.substituteNode,
|
|
110958
110958
|
});
|
|
110959
|
-
|
|
110960
|
-
printSourceFileOrBundle(jsFilePath, sourceMapFilePath, transform.transformed[0], printer, compilerOptions);
|
|
110959
|
+
printSourceFileOrBundle(jsFilePath, sourceMapFilePath, transform, printer, compilerOptions);
|
|
110961
110960
|
// Clean up emit nodes on parse tree
|
|
110962
110961
|
transform.dispose();
|
|
110963
110962
|
if (bundleBuildInfo)
|
|
110964
110963
|
bundleBuildInfo.js = printer.bundleFileInfo;
|
|
110965
110964
|
}
|
|
110966
110965
|
function emitDeclarationFileOrBundle(sourceFileOrBundle, declarationFilePath, declarationMapPath, relativeToBuildInfo) {
|
|
110966
|
+
var _a, _b;
|
|
110967
110967
|
if (!sourceFileOrBundle)
|
|
110968
110968
|
return;
|
|
110969
110969
|
if (!declarationFilePath) {
|
|
@@ -110975,15 +110975,43 @@ var ts;
|
|
|
110975
110975
|
var filesForEmit = forceDtsEmit ? sourceFiles : ts.filter(sourceFiles, ts.isSourceFileNotJson);
|
|
110976
110976
|
// Setup and perform the transformation to retrieve declarations from the input files
|
|
110977
110977
|
var inputListOrBundle = ts.outFile(compilerOptions) ? [ts.factory.createBundle(filesForEmit, !ts.isSourceFile(sourceFileOrBundle) ? sourceFileOrBundle.prepends : undefined)] : filesForEmit;
|
|
110978
|
-
|
|
110978
|
+
// Use existing result:
|
|
110979
|
+
var key = getCacheDtsEmitResultKey(sourceFileOrBundle, compilerOptions);
|
|
110980
|
+
var cache = host.getDtsEmitResultCache();
|
|
110981
|
+
var existing = declarationTransformers.length === 1 ? cache.get(key) : undefined;
|
|
110982
|
+
if (isForceDtsEmitResult(existing)) {
|
|
110983
|
+
if ((_a = existing.diagnostics) === null || _a === void 0 ? void 0 : _a.length) {
|
|
110984
|
+
for (var _c = 0, _d = existing.diagnostics; _c < _d.length; _c++) {
|
|
110985
|
+
var diagnostic = _d[_c];
|
|
110986
|
+
emitterDiagnostics.add(diagnostic);
|
|
110987
|
+
}
|
|
110988
|
+
}
|
|
110989
|
+
var declBlocked_1 = !!((_b = existing.diagnostics) === null || _b === void 0 ? void 0 : _b.length) || !!host.isEmitBlocked(declarationFilePath) || !!compilerOptions.noEmit;
|
|
110990
|
+
emitSkipped = emitSkipped || declBlocked_1;
|
|
110991
|
+
if (!declBlocked_1 || forceDtsEmit) {
|
|
110992
|
+
// Write the output file
|
|
110993
|
+
if (declarationMapPath && !forceDtsEmit) {
|
|
110994
|
+
if (sourceMapDataList && existing.sourceMapData) {
|
|
110995
|
+
sourceMapDataList.push(existing.sourceMapData);
|
|
110996
|
+
}
|
|
110997
|
+
ts.writeFile(host, emitterDiagnostics, declarationMapPath, existing.sourceMap, /*writeByteOrderMark*/ false, sourceFiles);
|
|
110998
|
+
}
|
|
110999
|
+
ts.writeFile(host, emitterDiagnostics, declarationFilePath, existing.text, !!compilerOptions.emitBOM, filesForEmit, {
|
|
111000
|
+
sourceMapUrlPos: existing.sourceMapUrlPos,
|
|
111001
|
+
exportedModulesFromDeclarationEmit: existing.exportedModulesFromDeclarationEmit,
|
|
111002
|
+
});
|
|
111003
|
+
}
|
|
111004
|
+
return;
|
|
111005
|
+
}
|
|
111006
|
+
if (!existing && emitOnlyDtsFiles && !ts.getEmitDeclarations(compilerOptions)) {
|
|
110979
111007
|
// Checker wont collect the linked aliases since thats only done when declaration is enabled.
|
|
110980
111008
|
// Do that here when emitting only dts files
|
|
110981
111009
|
filesForEmit.forEach(collectLinkedAliases);
|
|
110982
111010
|
}
|
|
110983
|
-
var declarationTransform = ts.transformNodes(resolver, host, ts.factory, compilerOptions, inputListOrBundle, declarationTransformers, /*allowDtsFiles*/ false);
|
|
111011
|
+
var declarationTransform = existing || ts.transformNodes(resolver, host, ts.factory, compilerOptions, inputListOrBundle, declarationTransformers, /*allowDtsFiles*/ false);
|
|
110984
111012
|
if (ts.length(declarationTransform.diagnostics)) {
|
|
110985
|
-
for (var
|
|
110986
|
-
var diagnostic =
|
|
111013
|
+
for (var _e = 0, _f = declarationTransform.diagnostics; _e < _f.length; _e++) {
|
|
111014
|
+
var diagnostic = _f[_e];
|
|
110987
111015
|
emitterDiagnostics.add(diagnostic);
|
|
110988
111016
|
}
|
|
110989
111017
|
}
|
|
@@ -110993,8 +111021,8 @@ var ts;
|
|
|
110993
111021
|
noEmitHelpers: true,
|
|
110994
111022
|
module: compilerOptions.module,
|
|
110995
111023
|
target: compilerOptions.target,
|
|
110996
|
-
|
|
110997
|
-
|
|
111024
|
+
// Emit maps when there is noEmit not set with forceDtsEmit
|
|
111025
|
+
sourceMap: (!forceDtsEmit || !compilerOptions.noEmit) && compilerOptions.declarationMap,
|
|
110998
111026
|
extendedDiagnostics: compilerOptions.extendedDiagnostics,
|
|
110999
111027
|
onlyPrintJsDocStyle: true,
|
|
111000
111028
|
writeBundleFileInfo: !!bundleBuildInfo,
|
|
@@ -111012,18 +111040,13 @@ var ts;
|
|
|
111012
111040
|
var declBlocked = (!!declarationTransform.diagnostics && !!declarationTransform.diagnostics.length) || !!host.isEmitBlocked(declarationFilePath) || !!compilerOptions.noEmit;
|
|
111013
111041
|
emitSkipped = emitSkipped || declBlocked;
|
|
111014
111042
|
if (!declBlocked || forceDtsEmit) {
|
|
111015
|
-
|
|
111016
|
-
|
|
111017
|
-
sourceMap: !forceDtsEmit && compilerOptions.declarationMap,
|
|
111043
|
+
printSourceFileOrBundle(declarationFilePath, declarationMapPath, declarationTransform, declarationPrinter, {
|
|
111044
|
+
sourceMap: printerOptions.sourceMap,
|
|
111018
111045
|
sourceRoot: compilerOptions.sourceRoot,
|
|
111019
111046
|
mapRoot: compilerOptions.mapRoot,
|
|
111020
111047
|
extendedDiagnostics: compilerOptions.extendedDiagnostics,
|
|
111021
111048
|
// Explicitly do not passthru either `inline` option
|
|
111022
111049
|
});
|
|
111023
|
-
if (forceDtsEmit && declarationTransform.transformed[0].kind === 305 /* SourceFile */) {
|
|
111024
|
-
var sourceFile = declarationTransform.transformed[0];
|
|
111025
|
-
exportedModulesFromDeclarationEmit = sourceFile.exportedModulesFromDeclarationEmit;
|
|
111026
|
-
}
|
|
111027
111050
|
}
|
|
111028
111051
|
declarationTransform.dispose();
|
|
111029
111052
|
if (bundleBuildInfo)
|
|
@@ -111042,7 +111065,9 @@ var ts;
|
|
|
111042
111065
|
}
|
|
111043
111066
|
ts.forEachChild(node, collectLinkedAliases);
|
|
111044
111067
|
}
|
|
111045
|
-
function printSourceFileOrBundle(jsFilePath, sourceMapFilePath,
|
|
111068
|
+
function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, transform, printer, mapOptions) {
|
|
111069
|
+
ts.Debug.assert(transform.transformed.length === 1, "Should only see one output from the transform");
|
|
111070
|
+
var sourceFileOrBundle = transform.transformed[0];
|
|
111046
111071
|
var bundle = sourceFileOrBundle.kind === 306 /* Bundle */ ? sourceFileOrBundle : undefined;
|
|
111047
111072
|
var sourceFile = sourceFileOrBundle.kind === 305 /* SourceFile */ ? sourceFileOrBundle : undefined;
|
|
111048
111073
|
var sourceFiles = bundle ? bundle.sourceFiles : [sourceFile];
|
|
@@ -111057,9 +111082,11 @@ var ts;
|
|
|
111057
111082
|
printer.writeFile(sourceFile, writer, sourceMapGenerator);
|
|
111058
111083
|
}
|
|
111059
111084
|
var sourceMapUrlPos;
|
|
111085
|
+
var sourceMap;
|
|
111086
|
+
var sourceMapData;
|
|
111060
111087
|
if (sourceMapGenerator) {
|
|
111061
111088
|
if (sourceMapDataList) {
|
|
111062
|
-
sourceMapDataList.push({
|
|
111089
|
+
sourceMapDataList.push(sourceMapData = {
|
|
111063
111090
|
inputSourceFileNames: sourceMapGenerator.getSources(),
|
|
111064
111091
|
sourceMap: sourceMapGenerator.toJSON()
|
|
111065
111092
|
});
|
|
@@ -111073,8 +111100,9 @@ var ts;
|
|
|
111073
111100
|
}
|
|
111074
111101
|
// Write the source map
|
|
111075
111102
|
if (sourceMapFilePath) {
|
|
111076
|
-
|
|
111077
|
-
|
|
111103
|
+
sourceMap = sourceMapGenerator.toString();
|
|
111104
|
+
if (!forceDtsEmit)
|
|
111105
|
+
ts.writeFile(host, emitterDiagnostics, sourceMapFilePath, sourceMap, /*writeByteOrderMark*/ false, sourceFiles);
|
|
111078
111106
|
if (printer.bundleFileInfo)
|
|
111079
111107
|
printer.bundleFileInfo.mapHash = ts.BuilderState.computeSignature(sourceMap, ts.maybeBind(host, host.createHash));
|
|
111080
111108
|
}
|
|
@@ -111084,11 +111112,26 @@ var ts;
|
|
|
111084
111112
|
}
|
|
111085
111113
|
// Write the output file
|
|
111086
111114
|
var text = writer.getText();
|
|
111087
|
-
ts.writeFile(host, emitterDiagnostics, jsFilePath,
|
|
111115
|
+
ts.writeFile(host, emitterDiagnostics, jsFilePath, writer.getText(), !!compilerOptions.emitBOM, sourceFiles, {
|
|
111116
|
+
sourceMapUrlPos: sourceMapUrlPos,
|
|
111117
|
+
exportedModulesFromDeclarationEmit: sourceFile === null || sourceFile === void 0 ? void 0 : sourceFile.exportedModulesFromDeclarationEmit,
|
|
111118
|
+
});
|
|
111088
111119
|
// We store the hash of the text written in the buildinfo to ensure that text of the referenced d.ts file is same as whats in the buildinfo
|
|
111089
111120
|
// This is needed because incremental can be toggled between two runs and we might use stale file text to do text manipulation in prepend mode
|
|
111090
111121
|
if (printer.bundleFileInfo)
|
|
111091
111122
|
printer.bundleFileInfo.hash = ts.BuilderState.computeSignature(text, ts.maybeBind(host, host.createHash));
|
|
111123
|
+
if (forceDtsEmit) {
|
|
111124
|
+
// Store the result
|
|
111125
|
+
var key = getCacheDtsEmitResultKey(sourceFileOrBundle, compilerOptions);
|
|
111126
|
+
host.getDtsEmitResultCache().set(key, {
|
|
111127
|
+
diagnostics: transform.diagnostics,
|
|
111128
|
+
text: writer.getText(),
|
|
111129
|
+
sourceMap: sourceMap,
|
|
111130
|
+
sourceMapData: sourceMapData,
|
|
111131
|
+
sourceMapUrlPos: sourceMapUrlPos,
|
|
111132
|
+
exportedModulesFromDeclarationEmit: sourceFile === null || sourceFile === void 0 ? void 0 : sourceFile.exportedModulesFromDeclarationEmit,
|
|
111133
|
+
});
|
|
111134
|
+
}
|
|
111092
111135
|
// Reset state
|
|
111093
111136
|
writer.clear();
|
|
111094
111137
|
}
|
|
@@ -111311,7 +111354,7 @@ var ts;
|
|
|
111311
111354
|
newBuildInfo.program = buildInfo.program;
|
|
111312
111355
|
if (newBuildInfo.program && changedDtsText !== undefined && config.options.composite) {
|
|
111313
111356
|
// Update the output signature
|
|
111314
|
-
newBuildInfo.program.outSignature = ts.computeSignature(changedDtsText,
|
|
111357
|
+
newBuildInfo.program.outSignature = ts.BuilderState.computeSignature(changedDtsText, createHash, changedDtsData);
|
|
111315
111358
|
newBuildInfo.program.dtsChangeTime = ts.getCurrentTime(host).getTime();
|
|
111316
111359
|
}
|
|
111317
111360
|
// Update sourceFileInfo
|
|
@@ -111347,6 +111390,7 @@ var ts;
|
|
|
111347
111390
|
redirectTargetsMap: ts.createMultiMap(),
|
|
111348
111391
|
getFileIncludeReasons: ts.notImplemented,
|
|
111349
111392
|
createHash: createHash,
|
|
111393
|
+
getDtsEmitResultCache: function () { return new ts.Map(); },
|
|
111350
111394
|
};
|
|
111351
111395
|
emitFiles(ts.notImplementedResolver, emitHost,
|
|
111352
111396
|
/*targetSourceFile*/ undefined, ts.getTransformers(config.options, customTransformers));
|
|
@@ -117317,6 +117361,7 @@ var ts;
|
|
|
117317
117361
|
// Key is a file name. Value is the (non-empty, or undefined) list of files that redirect to it.
|
|
117318
117362
|
var redirectTargetsMap = ts.createMultiMap();
|
|
117319
117363
|
var usesUriStyleNodeCoreModules = false;
|
|
117364
|
+
var cacheDtsEmitResult;
|
|
117320
117365
|
/**
|
|
117321
117366
|
* map with
|
|
117322
117367
|
* - SourceFile if present
|
|
@@ -118077,6 +118122,7 @@ var ts;
|
|
|
118077
118122
|
redirectTargetsMap: redirectTargetsMap,
|
|
118078
118123
|
getFileIncludeReasons: program.getFileIncludeReasons,
|
|
118079
118124
|
createHash: ts.maybeBind(host, host.createHash),
|
|
118125
|
+
getDtsEmitResultCache: function () { return cacheDtsEmitResult || (cacheDtsEmitResult = new ts.Map()); },
|
|
118080
118126
|
};
|
|
118081
118127
|
}
|
|
118082
118128
|
function writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data) {
|
|
@@ -118535,7 +118581,31 @@ var ts;
|
|
|
118535
118581
|
return runWithCancellationToken(function () {
|
|
118536
118582
|
var resolver = getTypeChecker().getEmitResolver(sourceFile, cancellationToken);
|
|
118537
118583
|
// Don't actually write any files since we're just getting diagnostics.
|
|
118538
|
-
|
|
118584
|
+
var emitHost = getEmitHost(ts.noop);
|
|
118585
|
+
if (sourceFile) {
|
|
118586
|
+
if (!ts.outFile(options)) {
|
|
118587
|
+
// Check from cache
|
|
118588
|
+
var existing = cacheDtsEmitResult === null || cacheDtsEmitResult === void 0 ? void 0 : cacheDtsEmitResult.get(sourceFile.resolvedPath);
|
|
118589
|
+
if (existing)
|
|
118590
|
+
return existing.diagnostics || ts.emptyArray;
|
|
118591
|
+
}
|
|
118592
|
+
var result = ts.transformNodes(resolver, emitHost, ts.factory, options, [sourceFile], [ts.transformDeclarations], /*allowDtsFiles*/ false);
|
|
118593
|
+
if (!ts.outFile(options)) {
|
|
118594
|
+
(cacheDtsEmitResult || (cacheDtsEmitResult = new ts.Map())).set(sourceFile.resolvedPath, result);
|
|
118595
|
+
}
|
|
118596
|
+
return result.diagnostics || ts.emptyArray;
|
|
118597
|
+
}
|
|
118598
|
+
var diagnostics;
|
|
118599
|
+
ts.forEachEmittedFile(emitHost, function (_emitFileNames, sourceFileOrBundle) {
|
|
118600
|
+
var key = ts.getCacheDtsEmitResultKey(sourceFileOrBundle, options);
|
|
118601
|
+
var existing = cacheDtsEmitResult === null || cacheDtsEmitResult === void 0 ? void 0 : cacheDtsEmitResult.get(key);
|
|
118602
|
+
if (existing)
|
|
118603
|
+
return existing.diagnostics || ts.emptyArray;
|
|
118604
|
+
var result = ts.transformNodes(resolver, emitHost, ts.factory, options, [sourceFileOrBundle], [ts.transformDeclarations], /*allowDtsFiles*/ false);
|
|
118605
|
+
diagnostics = ts.addRange(diagnostics, result.diagnostics);
|
|
118606
|
+
(cacheDtsEmitResult || (cacheDtsEmitResult = new ts.Map())).set(key, result);
|
|
118607
|
+
});
|
|
118608
|
+
return diagnostics || ts.emptyArray;
|
|
118539
118609
|
});
|
|
118540
118610
|
}
|
|
118541
118611
|
function getAndCacheDiagnostics(sourceFile, cancellationToken, cache, getDiagnostics) {
|
|
@@ -120178,8 +120248,8 @@ var ts;
|
|
|
120178
120248
|
(function (ts) {
|
|
120179
120249
|
function getFileEmitOutput(program, sourceFile, emitOnlyDtsFiles, cancellationToken, customTransformers, forceDtsEmit) {
|
|
120180
120250
|
var outputFiles = [];
|
|
120181
|
-
var _a = program.emit(sourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers, forceDtsEmit), emitSkipped = _a.emitSkipped, diagnostics = _a.diagnostics
|
|
120182
|
-
return { outputFiles: outputFiles, emitSkipped: emitSkipped, diagnostics: diagnostics
|
|
120251
|
+
var _a = program.emit(sourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers, forceDtsEmit), emitSkipped = _a.emitSkipped, diagnostics = _a.diagnostics;
|
|
120252
|
+
return { outputFiles: outputFiles, emitSkipped: emitSkipped, diagnostics: diagnostics };
|
|
120183
120253
|
function writeFile(fileName, text, writeByteOrderMark) {
|
|
120184
120254
|
outputFiles.push({ name: fileName, writeByteOrderMark: writeByteOrderMark, text: text });
|
|
120185
120255
|
}
|
|
@@ -120427,6 +120497,10 @@ var ts;
|
|
|
120427
120497
|
(state.hasCalledUpdateShapeSignature || (state.hasCalledUpdateShapeSignature = new ts.Set())).add(path);
|
|
120428
120498
|
}
|
|
120429
120499
|
BuilderState.updateSignatureOfFile = updateSignatureOfFile;
|
|
120500
|
+
function computeSignature(text, computeHash, data) {
|
|
120501
|
+
return (computeHash || ts.generateDjb2Hash)((data === null || data === void 0 ? void 0 : data.sourceMapUrlPos) !== undefined ? text.substring(0, data.sourceMapUrlPos) : text);
|
|
120502
|
+
}
|
|
120503
|
+
BuilderState.computeSignature = computeSignature;
|
|
120430
120504
|
/**
|
|
120431
120505
|
* Returns if the shape of the signature has changed since last emit
|
|
120432
120506
|
*/
|
|
@@ -120440,18 +120514,17 @@ var ts;
|
|
|
120440
120514
|
var prevSignature = info.signature;
|
|
120441
120515
|
var latestSignature;
|
|
120442
120516
|
if (!sourceFile.isDeclarationFile && !useFileVersionAsSignature) {
|
|
120443
|
-
|
|
120444
|
-
|
|
120445
|
-
|
|
120446
|
-
|
|
120447
|
-
var firstDts_1 = ts.firstOrUndefined(emitOutput_1.outputFiles);
|
|
120448
|
-
if (firstDts_1) {
|
|
120449
|
-
ts.Debug.assert(ts.isDeclarationFileName(firstDts_1.name), "File extension for signature expected to be dts", function () { return "Found: " + ts.getAnyExtensionFromPath(firstDts_1.name) + " for " + firstDts_1.name + ":: All output files: " + JSON.stringify(emitOutput_1.outputFiles.map(function (f) { return f.name; })); });
|
|
120450
|
-
latestSignature = computeSignature(firstDts_1.text, computeHash);
|
|
120517
|
+
programOfThisState.emit(sourceFile, function (fileName, text, _writeByteOrderMark, _onError, _sourceFiles, data) {
|
|
120518
|
+
ts.Debug.assert(ts.isDeclarationFileName(fileName), "File extension for signature expected to be dts");
|
|
120519
|
+
ts.Debug.assert(latestSignature === undefined, "Only one file should be set");
|
|
120520
|
+
latestSignature = computeSignature(text, computeHash, data);
|
|
120451
120521
|
if (latestSignature !== prevSignature) {
|
|
120452
|
-
updateExportedModules(state, sourceFile,
|
|
120522
|
+
updateExportedModules(state, sourceFile, data === null || data === void 0 ? void 0 : data.exportedModulesFromDeclarationEmit);
|
|
120453
120523
|
}
|
|
120454
|
-
}
|
|
120524
|
+
}, cancellationToken,
|
|
120525
|
+
/*emitOnlyDtsFiles*/ true,
|
|
120526
|
+
/*customTransformers*/ undefined,
|
|
120527
|
+
/*forceDtsEmit*/ true);
|
|
120455
120528
|
}
|
|
120456
120529
|
// Default is to use file version as signature
|
|
120457
120530
|
if (latestSignature === undefined) {
|
|
@@ -120474,10 +120547,6 @@ var ts;
|
|
|
120474
120547
|
return latestSignature !== prevSignature;
|
|
120475
120548
|
}
|
|
120476
120549
|
BuilderState.updateShapeSignature = updateShapeSignature;
|
|
120477
|
-
function computeSignature(text, computeHash) {
|
|
120478
|
-
return (computeHash || ts.generateDjb2Hash)(text);
|
|
120479
|
-
}
|
|
120480
|
-
BuilderState.computeSignature = computeSignature;
|
|
120481
120550
|
/**
|
|
120482
120551
|
* Coverts the declaration emit result into exported modules map
|
|
120483
120552
|
*/
|
|
@@ -121378,10 +121447,6 @@ var ts;
|
|
|
121378
121447
|
return { host: host, newProgram: newProgram, oldProgram: oldProgram, configFileParsingDiagnostics: configFileParsingDiagnostics || ts.emptyArray };
|
|
121379
121448
|
}
|
|
121380
121449
|
ts.getBuilderCreationParameters = getBuilderCreationParameters;
|
|
121381
|
-
function computeSignature(text, data, computeHash) {
|
|
121382
|
-
return ts.BuilderState.computeSignature((data === null || data === void 0 ? void 0 : data.sourceMapUrlPos) !== undefined ? text.substring(0, data.sourceMapUrlPos) : text, computeHash);
|
|
121383
|
-
}
|
|
121384
|
-
ts.computeSignature = computeSignature;
|
|
121385
121450
|
function createBuilderProgram(kind, _a) {
|
|
121386
121451
|
var newProgram = _a.newProgram, host = _a.host, oldProgram = _a.oldProgram, configFileParsingDiagnostics = _a.configFileParsingDiagnostics;
|
|
121387
121452
|
// Return same program if underlying program doesnt change
|
|
@@ -121486,7 +121551,7 @@ var ts;
|
|
|
121486
121551
|
var file = sourceFiles[0];
|
|
121487
121552
|
var info = state.fileInfos.get(file.resolvedPath);
|
|
121488
121553
|
if (info.signature === file.version) {
|
|
121489
|
-
newSignature = computeSignature(text,
|
|
121554
|
+
newSignature = ts.BuilderState.computeSignature(text, computeHash, data);
|
|
121490
121555
|
if (newSignature !== file.version) { // Update it
|
|
121491
121556
|
if (host.storeFilesChangingSignatureDuringEmit)
|
|
121492
121557
|
(state.filesChangingSignature || (state.filesChangingSignature = new ts.Set())).add(file.resolvedPath);
|
|
@@ -121513,7 +121578,7 @@ var ts;
|
|
|
121513
121578
|
if (state.compilerOptions.composite) {
|
|
121514
121579
|
var filePath = sourceFiles[0].resolvedPath;
|
|
121515
121580
|
var oldSignature = (_c = state.emitSignatures) === null || _c === void 0 ? void 0 : _c.get(filePath);
|
|
121516
|
-
newSignature || (newSignature = computeSignature(text,
|
|
121581
|
+
newSignature || (newSignature = ts.BuilderState.computeSignature(text, computeHash, data));
|
|
121517
121582
|
if (newSignature !== oldSignature) {
|
|
121518
121583
|
(state.emitSignatures || (state.emitSignatures = new ts.Map())).set(filePath, newSignature);
|
|
121519
121584
|
state.hasChangedEmitSignature = true;
|
|
@@ -121521,7 +121586,7 @@ var ts;
|
|
|
121521
121586
|
}
|
|
121522
121587
|
}
|
|
121523
121588
|
else if (state.compilerOptions.composite) {
|
|
121524
|
-
var newSignature = computeSignature(text,
|
|
121589
|
+
var newSignature = ts.BuilderState.computeSignature(text, computeHash, data);
|
|
121525
121590
|
if (newSignature !== state.outSignature) {
|
|
121526
121591
|
state.outSignature = newSignature;
|
|
121527
121592
|
state.hasChangedEmitSignature = true;
|