typescript 5.6.0-dev.20240605 → 5.6.0-dev.20240607
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 +160 -121
- package/lib/typescript.js +194 -135
- package/package.json +2 -2
package/lib/typescript.js
CHANGED
|
@@ -377,9 +377,8 @@ __export(typescript_exports, {
|
|
|
377
377
|
createBaseNodeFactory: () => createBaseNodeFactory,
|
|
378
378
|
createBinaryExpressionTrampoline: () => createBinaryExpressionTrampoline,
|
|
379
379
|
createBindingHelper: () => createBindingHelper,
|
|
380
|
-
createBuildInfo: () => createBuildInfo,
|
|
381
380
|
createBuilderProgram: () => createBuilderProgram,
|
|
382
|
-
|
|
381
|
+
createBuilderProgramUsingIncrementalBuildInfo: () => createBuilderProgramUsingIncrementalBuildInfo,
|
|
383
382
|
createBuilderStatusReporter: () => createBuilderStatusReporter,
|
|
384
383
|
createCacheWithRedirects: () => createCacheWithRedirects,
|
|
385
384
|
createCacheableExportInfoMap: () => createCacheableExportInfoMap,
|
|
@@ -1263,7 +1262,7 @@ __export(typescript_exports, {
|
|
|
1263
1262
|
isBreakStatement: () => isBreakStatement,
|
|
1264
1263
|
isBuild: () => isBuild,
|
|
1265
1264
|
isBuildInfoFile: () => isBuildInfoFile,
|
|
1266
|
-
isBuilderProgram: () =>
|
|
1265
|
+
isBuilderProgram: () => isBuilderProgram,
|
|
1267
1266
|
isBundle: () => isBundle,
|
|
1268
1267
|
isCallChain: () => isCallChain,
|
|
1269
1268
|
isCallExpression: () => isCallExpression,
|
|
@@ -1470,6 +1469,8 @@ __export(typescript_exports, {
|
|
|
1470
1469
|
isInTemplateString: () => isInTemplateString,
|
|
1471
1470
|
isInTopLevelContext: () => isInTopLevelContext,
|
|
1472
1471
|
isInTypeQuery: () => isInTypeQuery,
|
|
1472
|
+
isIncrementalBuildInfo: () => isIncrementalBuildInfo,
|
|
1473
|
+
isIncrementalBundleEmitBuildInfo: () => isIncrementalBundleEmitBuildInfo,
|
|
1473
1474
|
isIncrementalCompilation: () => isIncrementalCompilation,
|
|
1474
1475
|
isIndexSignatureDeclaration: () => isIndexSignatureDeclaration,
|
|
1475
1476
|
isIndexedAccessTypeNode: () => isIndexedAccessTypeNode,
|
|
@@ -1706,7 +1707,6 @@ __export(typescript_exports, {
|
|
|
1706
1707
|
isPrivateIdentifierClassElementDeclaration: () => isPrivateIdentifierClassElementDeclaration,
|
|
1707
1708
|
isPrivateIdentifierPropertyAccessExpression: () => isPrivateIdentifierPropertyAccessExpression,
|
|
1708
1709
|
isPrivateIdentifierSymbol: () => isPrivateIdentifierSymbol,
|
|
1709
|
-
isProgramBundleEmitBuildInfo: () => isProgramBundleEmitBuildInfo,
|
|
1710
1710
|
isProgramUptoDate: () => isProgramUptoDate,
|
|
1711
1711
|
isPrologueDirective: () => isPrologueDirective,
|
|
1712
1712
|
isPropertyAccessChain: () => isPropertyAccessChain,
|
|
@@ -2375,7 +2375,7 @@ module.exports = __toCommonJS(typescript_exports);
|
|
|
2375
2375
|
|
|
2376
2376
|
// src/compiler/corePublic.ts
|
|
2377
2377
|
var versionMajorMinor = "5.6";
|
|
2378
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
2378
|
+
var version = `${versionMajorMinor}.0-dev.20240607`;
|
|
2379
2379
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2380
2380
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2381
2381
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -118115,10 +118115,7 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
|
|
|
118115
118115
|
emitSkipped = true;
|
|
118116
118116
|
return;
|
|
118117
118117
|
}
|
|
118118
|
-
const buildInfo = host.getBuildInfo() ||
|
|
118119
|
-
/*program*/
|
|
118120
|
-
void 0
|
|
118121
|
-
);
|
|
118118
|
+
const buildInfo = host.getBuildInfo() || { version };
|
|
118122
118119
|
writeFile(
|
|
118123
118120
|
host,
|
|
118124
118121
|
emitterDiagnostics,
|
|
@@ -118401,9 +118398,6 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
|
|
|
118401
118398
|
return encodeURI(sourceMapFile);
|
|
118402
118399
|
}
|
|
118403
118400
|
}
|
|
118404
|
-
function createBuildInfo(program) {
|
|
118405
|
-
return { program, version };
|
|
118406
|
-
}
|
|
118407
118401
|
function getBuildInfoText(buildInfo) {
|
|
118408
118402
|
return JSON.stringify(buildInfo);
|
|
118409
118403
|
}
|
|
@@ -123190,7 +123184,7 @@ function isIgnoredFileFromWildCardWatching({
|
|
|
123190
123184
|
}
|
|
123191
123185
|
return false;
|
|
123192
123186
|
function hasSourceFile(file) {
|
|
123193
|
-
return realProgram ? !!realProgram.getSourceFileByPath(file) : builderProgram ? builderProgram.
|
|
123187
|
+
return realProgram ? !!realProgram.getSourceFileByPath(file) : builderProgram ? builderProgram.state.fileInfos.has(file) : !!find(program, (rootFile) => toPath3(rootFile) === file);
|
|
123194
123188
|
}
|
|
123195
123189
|
function isSupportedScriptKind() {
|
|
123196
123190
|
if (!getScriptKind2) return false;
|
|
@@ -123211,9 +123205,6 @@ function isIgnoredFileFromWildCardWatching({
|
|
|
123211
123205
|
}
|
|
123212
123206
|
}
|
|
123213
123207
|
}
|
|
123214
|
-
function isBuilderProgram(program) {
|
|
123215
|
-
return !!program.getState;
|
|
123216
|
-
}
|
|
123217
123208
|
function isEmittedFileOfProgram(program, file) {
|
|
123218
123209
|
if (!program) {
|
|
123219
123210
|
return false;
|
|
@@ -127837,6 +127828,13 @@ var BuilderFileEmit = /* @__PURE__ */ ((BuilderFileEmit2) => {
|
|
|
127837
127828
|
BuilderFileEmit2[BuilderFileEmit2["All"] = 31] = "All";
|
|
127838
127829
|
return BuilderFileEmit2;
|
|
127839
127830
|
})(BuilderFileEmit || {});
|
|
127831
|
+
function isBuilderProgramStateWithDefinedProgram(state) {
|
|
127832
|
+
return state.program !== void 0;
|
|
127833
|
+
}
|
|
127834
|
+
function toBuilderProgramStateWithDefinedProgram(state) {
|
|
127835
|
+
Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
|
|
127836
|
+
return state;
|
|
127837
|
+
}
|
|
127840
127838
|
function getBuilderFileEmit(options) {
|
|
127841
127839
|
let result = 1 /* Js */;
|
|
127842
127840
|
if (options.sourceMap) result = result | 2 /* JsMap */;
|
|
@@ -128101,7 +128099,11 @@ function getNextAffectedFile(state, cancellationToken, host) {
|
|
|
128101
128099
|
const affectedFile = affectedFiles[affectedFilesIndex];
|
|
128102
128100
|
if (!seenAffectedFiles.has(affectedFile.resolvedPath)) {
|
|
128103
128101
|
state.affectedFilesIndex = affectedFilesIndex;
|
|
128104
|
-
addToAffectedFilesPendingEmit(
|
|
128102
|
+
addToAffectedFilesPendingEmit(
|
|
128103
|
+
state,
|
|
128104
|
+
affectedFile.resolvedPath,
|
|
128105
|
+
getBuilderFileEmit(state.compilerOptions)
|
|
128106
|
+
);
|
|
128105
128107
|
handleDtsMayChangeOfAffectedFile(
|
|
128106
128108
|
state,
|
|
128107
128109
|
affectedFile,
|
|
@@ -128121,12 +128123,11 @@ function getNextAffectedFile(state, cancellationToken, host) {
|
|
|
128121
128123
|
if (nextKey.done) {
|
|
128122
128124
|
return void 0;
|
|
128123
128125
|
}
|
|
128124
|
-
const
|
|
128125
|
-
|
|
128126
|
-
if (compilerOptions.outFile) return program;
|
|
128126
|
+
const compilerOptions = state.program.getCompilerOptions();
|
|
128127
|
+
if (compilerOptions.outFile) return state.program;
|
|
128127
128128
|
state.affectedFiles = BuilderState.getFilesAffectedByWithOldState(
|
|
128128
128129
|
state,
|
|
128129
|
-
program,
|
|
128130
|
+
state.program,
|
|
128130
128131
|
nextKey.value,
|
|
128131
128132
|
cancellationToken,
|
|
128132
128133
|
host
|
|
@@ -128187,9 +128188,8 @@ function getNextPendingEmitDiagnosticsFile(state) {
|
|
|
128187
128188
|
function removeDiagnosticsOfLibraryFiles(state) {
|
|
128188
128189
|
if (!state.cleanedDiagnosticsOfLibFiles) {
|
|
128189
128190
|
state.cleanedDiagnosticsOfLibFiles = true;
|
|
128190
|
-
const
|
|
128191
|
-
|
|
128192
|
-
forEach(program.getSourceFiles(), (f) => program.isSourceFileDefaultLibrary(f) && !skipTypeChecking(f, options, program) && removeSemanticDiagnosticsOf(state, f.resolvedPath));
|
|
128191
|
+
const options = state.program.getCompilerOptions();
|
|
128192
|
+
forEach(state.program.getSourceFiles(), (f) => state.program.isSourceFileDefaultLibrary(f) && !skipTypeChecking(f, options, state.program) && removeSemanticDiagnosticsOf(state, f.resolvedPath));
|
|
128193
128193
|
}
|
|
128194
128194
|
}
|
|
128195
128195
|
function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken, host) {
|
|
@@ -128198,7 +128198,7 @@ function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken
|
|
|
128198
128198
|
removeDiagnosticsOfLibraryFiles(state);
|
|
128199
128199
|
BuilderState.updateShapeSignature(
|
|
128200
128200
|
state,
|
|
128201
|
-
|
|
128201
|
+
state.program,
|
|
128202
128202
|
affectedFile,
|
|
128203
128203
|
cancellationToken,
|
|
128204
128204
|
host
|
|
@@ -128216,12 +128216,11 @@ function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken
|
|
|
128216
128216
|
function handleDtsMayChangeOf(state, path, invalidateJsFiles, cancellationToken, host) {
|
|
128217
128217
|
removeSemanticDiagnosticsOf(state, path);
|
|
128218
128218
|
if (!state.changedFilesSet.has(path)) {
|
|
128219
|
-
const
|
|
128220
|
-
const sourceFile = program.getSourceFileByPath(path);
|
|
128219
|
+
const sourceFile = state.program.getSourceFileByPath(path);
|
|
128221
128220
|
if (sourceFile) {
|
|
128222
128221
|
BuilderState.updateShapeSignature(
|
|
128223
128222
|
state,
|
|
128224
|
-
program,
|
|
128223
|
+
state.program,
|
|
128225
128224
|
sourceFile,
|
|
128226
128225
|
cancellationToken,
|
|
128227
128226
|
host,
|
|
@@ -128229,9 +128228,17 @@ function handleDtsMayChangeOf(state, path, invalidateJsFiles, cancellationToken,
|
|
|
128229
128228
|
true
|
|
128230
128229
|
);
|
|
128231
128230
|
if (invalidateJsFiles) {
|
|
128232
|
-
addToAffectedFilesPendingEmit(
|
|
128231
|
+
addToAffectedFilesPendingEmit(
|
|
128232
|
+
state,
|
|
128233
|
+
path,
|
|
128234
|
+
getBuilderFileEmit(state.compilerOptions)
|
|
128235
|
+
);
|
|
128233
128236
|
} else if (getEmitDeclarations(state.compilerOptions)) {
|
|
128234
|
-
addToAffectedFilesPendingEmit(
|
|
128237
|
+
addToAffectedFilesPendingEmit(
|
|
128238
|
+
state,
|
|
128239
|
+
path,
|
|
128240
|
+
state.compilerOptions.declarationMap ? 24 /* AllDts */ : 8 /* Dts */
|
|
128241
|
+
);
|
|
128235
128242
|
}
|
|
128236
128243
|
}
|
|
128237
128244
|
}
|
|
@@ -128298,7 +128305,7 @@ function handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile
|
|
|
128298
128305
|
host
|
|
128299
128306
|
);
|
|
128300
128307
|
if (isChangedSignature(state, currentPath)) {
|
|
128301
|
-
const currentSourceFile =
|
|
128308
|
+
const currentSourceFile = state.program.getSourceFileByPath(currentPath);
|
|
128302
128309
|
queue.push(...BuilderState.getReferencedByPaths(state, currentSourceFile.resolvedPath));
|
|
128303
128310
|
}
|
|
128304
128311
|
}
|
|
@@ -128347,7 +128354,7 @@ function handleDtsMayChangeOfFileAndExportsOfFile(state, filePath, invalidateJsF
|
|
|
128347
128354
|
function getSemanticDiagnosticsOfFile(state, sourceFile, cancellationToken, semanticDiagnosticsPerFile) {
|
|
128348
128355
|
return concatenate(
|
|
128349
128356
|
getBinderAndCheckerDiagnosticsOfFile(state, sourceFile, cancellationToken, semanticDiagnosticsPerFile),
|
|
128350
|
-
|
|
128357
|
+
state.program.getProgramDiagnostics(sourceFile)
|
|
128351
128358
|
);
|
|
128352
128359
|
}
|
|
128353
128360
|
function getBinderAndCheckerDiagnosticsOfFile(state, sourceFile, cancellationToken, semanticDiagnosticsPerFile) {
|
|
@@ -128357,17 +128364,20 @@ function getBinderAndCheckerDiagnosticsOfFile(state, sourceFile, cancellationTok
|
|
|
128357
128364
|
if (cachedDiagnostics) {
|
|
128358
128365
|
return filterSemanticDiagnostics(cachedDiagnostics, state.compilerOptions);
|
|
128359
128366
|
}
|
|
128360
|
-
const diagnostics =
|
|
128367
|
+
const diagnostics = state.program.getBindAndCheckDiagnostics(sourceFile, cancellationToken);
|
|
128361
128368
|
semanticDiagnosticsPerFile.set(path, diagnostics);
|
|
128362
128369
|
return filterSemanticDiagnostics(diagnostics, state.compilerOptions);
|
|
128363
128370
|
}
|
|
128364
|
-
function
|
|
128371
|
+
function isIncrementalBundleEmitBuildInfo(info) {
|
|
128365
128372
|
var _a;
|
|
128366
128373
|
return !!((_a = info.options) == null ? void 0 : _a.outFile);
|
|
128367
128374
|
}
|
|
128375
|
+
function isIncrementalBuildInfo(info) {
|
|
128376
|
+
return !!info.fileNames;
|
|
128377
|
+
}
|
|
128368
128378
|
function getBuildInfo2(state) {
|
|
128369
128379
|
var _a, _b;
|
|
128370
|
-
const currentDirectory =
|
|
128380
|
+
const currentDirectory = state.program.getCurrentDirectory();
|
|
128371
128381
|
const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(getTsBuildInfoEmitOutputFilePath(state.compilerOptions), currentDirectory));
|
|
128372
128382
|
const latestChangedDtsFile = state.latestChangedDtsFile ? relativeToBuildInfoEnsuringAbsolutePath(state.latestChangedDtsFile) : void 0;
|
|
128373
128383
|
const fileNames = [];
|
|
@@ -128380,14 +128390,14 @@ function getBuildInfo2(state) {
|
|
|
128380
128390
|
tryAddRoot(key, fileId);
|
|
128381
128391
|
return value.impliedFormat ? { version: value.version, impliedFormat: value.impliedFormat, signature: void 0, affectsGlobalScope: void 0 } : value.version;
|
|
128382
128392
|
});
|
|
128383
|
-
|
|
128393
|
+
return {
|
|
128384
128394
|
fileNames,
|
|
128385
128395
|
fileInfos: fileInfos2,
|
|
128386
128396
|
root,
|
|
128387
128397
|
resolvedRoot: toResolvedRoot(),
|
|
128388
|
-
options:
|
|
128389
|
-
semanticDiagnosticsPerFile:
|
|
128390
|
-
emitDiagnosticsPerFile:
|
|
128398
|
+
options: toIncrementalBuildInfoCompilerOptions(state.compilerOptions),
|
|
128399
|
+
semanticDiagnosticsPerFile: toIncrementalBuildInfoDiagnostics(),
|
|
128400
|
+
emitDiagnosticsPerFile: toIncrementalBuildInfoEmitDiagnostics(),
|
|
128391
128401
|
changeFileSet: toChangeFileSet(),
|
|
128392
128402
|
outSignature: state.outSignature,
|
|
128393
128403
|
latestChangedDtsFile,
|
|
@@ -128397,10 +128407,10 @@ function getBuildInfo2(state) {
|
|
|
128397
128407
|
// Pending emit is same as deteremined by compilerOptions
|
|
128398
128408
|
state.programEmitPending
|
|
128399
128409
|
)
|
|
128400
|
-
)
|
|
128410
|
+
),
|
|
128401
128411
|
// Actual value
|
|
128412
|
+
version
|
|
128402
128413
|
};
|
|
128403
|
-
return createBuildInfo(program2);
|
|
128404
128414
|
}
|
|
128405
128415
|
let fileIdsList;
|
|
128406
128416
|
let fileNamesToFileIdListId;
|
|
@@ -128455,7 +128465,7 @@ function getBuildInfo2(state) {
|
|
|
128455
128465
|
toFileIdListId(state.referencedMap.getValues(key))
|
|
128456
128466
|
]);
|
|
128457
128467
|
}
|
|
128458
|
-
const semanticDiagnosticsPerFile =
|
|
128468
|
+
const semanticDiagnosticsPerFile = toIncrementalBuildInfoDiagnostics();
|
|
128459
128469
|
let affectedFilesPendingEmit;
|
|
128460
128470
|
if ((_b = state.affectedFilesPendingEmit) == null ? void 0 : _b.size) {
|
|
128461
128471
|
const fullEmitForOptions = getBuilderFileEmit(state.compilerOptions);
|
|
@@ -128479,22 +128489,22 @@ function getBuildInfo2(state) {
|
|
|
128479
128489
|
}
|
|
128480
128490
|
}
|
|
128481
128491
|
}
|
|
128482
|
-
|
|
128492
|
+
return {
|
|
128483
128493
|
fileNames,
|
|
128494
|
+
fileIdsList,
|
|
128484
128495
|
fileInfos,
|
|
128485
128496
|
root,
|
|
128486
128497
|
resolvedRoot: toResolvedRoot(),
|
|
128487
|
-
options:
|
|
128488
|
-
fileIdsList,
|
|
128498
|
+
options: toIncrementalBuildInfoCompilerOptions(state.compilerOptions),
|
|
128489
128499
|
referencedMap,
|
|
128490
128500
|
semanticDiagnosticsPerFile,
|
|
128491
|
-
emitDiagnosticsPerFile:
|
|
128501
|
+
emitDiagnosticsPerFile: toIncrementalBuildInfoEmitDiagnostics(),
|
|
128492
128502
|
affectedFilesPendingEmit,
|
|
128493
128503
|
changeFileSet: toChangeFileSet(),
|
|
128494
128504
|
emitSignatures,
|
|
128495
|
-
latestChangedDtsFile
|
|
128505
|
+
latestChangedDtsFile,
|
|
128506
|
+
version
|
|
128496
128507
|
};
|
|
128497
|
-
return createBuildInfo(program);
|
|
128498
128508
|
function relativeToBuildInfoEnsuringAbsolutePath(path) {
|
|
128499
128509
|
return relativeToBuildInfo(getNormalizedAbsolutePath(path, currentDirectory));
|
|
128500
128510
|
}
|
|
@@ -128542,13 +128552,13 @@ function getBuildInfo2(state) {
|
|
|
128542
128552
|
});
|
|
128543
128553
|
return result;
|
|
128544
128554
|
}
|
|
128545
|
-
function
|
|
128555
|
+
function toIncrementalBuildInfoCompilerOptions(options) {
|
|
128546
128556
|
let result;
|
|
128547
128557
|
const { optionsNameMap } = getOptionsNameMap();
|
|
128548
128558
|
for (const name of getOwnKeys(options).sort(compareStringsCaseSensitive)) {
|
|
128549
128559
|
const optionInfo = optionsNameMap.get(name.toLowerCase());
|
|
128550
128560
|
if (optionInfo == null ? void 0 : optionInfo.affectsBuildInfo) {
|
|
128551
|
-
(result || (result = {}))[name] =
|
|
128561
|
+
(result || (result = {}))[name] = toReusableCompilerOptionValue(
|
|
128552
128562
|
optionInfo,
|
|
128553
128563
|
options[name]
|
|
128554
128564
|
);
|
|
@@ -128556,7 +128566,7 @@ function getBuildInfo2(state) {
|
|
|
128556
128566
|
}
|
|
128557
128567
|
return result;
|
|
128558
128568
|
}
|
|
128559
|
-
function
|
|
128569
|
+
function toReusableCompilerOptionValue(option, value) {
|
|
128560
128570
|
if (option) {
|
|
128561
128571
|
Debug.assert(option.type !== "listOrElement");
|
|
128562
128572
|
if (option.type === "list") {
|
|
@@ -128570,7 +128580,7 @@ function getBuildInfo2(state) {
|
|
|
128570
128580
|
}
|
|
128571
128581
|
return value;
|
|
128572
128582
|
}
|
|
128573
|
-
function
|
|
128583
|
+
function toIncrementalBuildInfoDiagnostics() {
|
|
128574
128584
|
let result;
|
|
128575
128585
|
state.fileInfos.forEach((_value, key) => {
|
|
128576
128586
|
const value = state.semanticDiagnosticsPerFile.get(key);
|
|
@@ -128579,13 +128589,13 @@ function getBuildInfo2(state) {
|
|
|
128579
128589
|
} else if (value.length) {
|
|
128580
128590
|
result = append(result, [
|
|
128581
128591
|
toFileId(key),
|
|
128582
|
-
|
|
128592
|
+
toReusableDiagnostic(value, key)
|
|
128583
128593
|
]);
|
|
128584
128594
|
}
|
|
128585
128595
|
});
|
|
128586
128596
|
return result;
|
|
128587
128597
|
}
|
|
128588
|
-
function
|
|
128598
|
+
function toIncrementalBuildInfoEmitDiagnostics() {
|
|
128589
128599
|
var _a2;
|
|
128590
128600
|
let result;
|
|
128591
128601
|
if (!((_a2 = state.emitDiagnosticsPerFile) == null ? void 0 : _a2.size)) return result;
|
|
@@ -128593,51 +128603,51 @@ function getBuildInfo2(state) {
|
|
|
128593
128603
|
const value = state.emitDiagnosticsPerFile.get(key);
|
|
128594
128604
|
result = append(result, [
|
|
128595
128605
|
toFileId(key),
|
|
128596
|
-
|
|
128606
|
+
toReusableDiagnostic(value, key)
|
|
128597
128607
|
]);
|
|
128598
128608
|
}
|
|
128599
128609
|
return result;
|
|
128600
128610
|
}
|
|
128601
|
-
function
|
|
128611
|
+
function toReusableDiagnostic(diagnostics, diagnosticFilePath) {
|
|
128602
128612
|
Debug.assert(!!diagnostics.length);
|
|
128603
128613
|
return diagnostics.map((diagnostic) => {
|
|
128604
|
-
const result =
|
|
128614
|
+
const result = toReusableDiagnosticRelatedInformation(diagnostic, diagnosticFilePath);
|
|
128605
128615
|
result.reportsUnnecessary = diagnostic.reportsUnnecessary;
|
|
128606
128616
|
result.reportDeprecated = diagnostic.reportsDeprecated;
|
|
128607
128617
|
result.source = diagnostic.source;
|
|
128608
128618
|
result.skippedOn = diagnostic.skippedOn;
|
|
128609
128619
|
const { relatedInformation } = diagnostic;
|
|
128610
|
-
result.relatedInformation = relatedInformation ? relatedInformation.length ? relatedInformation.map((r) =>
|
|
128620
|
+
result.relatedInformation = relatedInformation ? relatedInformation.length ? relatedInformation.map((r) => toReusableDiagnosticRelatedInformation(r, diagnosticFilePath)) : [] : void 0;
|
|
128611
128621
|
return result;
|
|
128612
128622
|
});
|
|
128613
128623
|
}
|
|
128614
|
-
function
|
|
128624
|
+
function toReusableDiagnosticRelatedInformation(diagnostic, diagnosticFilePath) {
|
|
128615
128625
|
const { file } = diagnostic;
|
|
128616
128626
|
return {
|
|
128617
128627
|
...diagnostic,
|
|
128618
128628
|
file: file ? file.resolvedPath === diagnosticFilePath ? void 0 : relativeToBuildInfo(file.resolvedPath) : false,
|
|
128619
|
-
messageText: isString(diagnostic.messageText) ? diagnostic.messageText :
|
|
128629
|
+
messageText: isString(diagnostic.messageText) ? diagnostic.messageText : toReusableDiagnosticMessageChain(diagnostic.messageText)
|
|
128620
128630
|
};
|
|
128621
128631
|
}
|
|
128622
|
-
function
|
|
128632
|
+
function toReusableDiagnosticMessageChain(chain) {
|
|
128623
128633
|
if (chain.repopulateInfo) {
|
|
128624
128634
|
return {
|
|
128625
128635
|
info: chain.repopulateInfo(),
|
|
128626
|
-
next:
|
|
128636
|
+
next: toReusableDiagnosticMessageChainArray(chain.next)
|
|
128627
128637
|
};
|
|
128628
128638
|
}
|
|
128629
|
-
const next =
|
|
128639
|
+
const next = toReusableDiagnosticMessageChainArray(chain.next);
|
|
128630
128640
|
return next === chain.next ? chain : { ...chain, next };
|
|
128631
128641
|
}
|
|
128632
|
-
function
|
|
128642
|
+
function toReusableDiagnosticMessageChainArray(array) {
|
|
128633
128643
|
if (!array) return array;
|
|
128634
128644
|
return forEach(array, (chain, index) => {
|
|
128635
|
-
const reusable =
|
|
128645
|
+
const reusable = toReusableDiagnosticMessageChain(chain);
|
|
128636
128646
|
if (chain === reusable) return void 0;
|
|
128637
128647
|
const result = index > 0 ? array.slice(0, index - 1) : [];
|
|
128638
128648
|
result.push(reusable);
|
|
128639
128649
|
for (let i = index + 1; i < array.length; i++) {
|
|
128640
|
-
result.push(
|
|
128650
|
+
result.push(toReusableDiagnosticMessageChain(array[i]));
|
|
128641
128651
|
}
|
|
128642
128652
|
return result;
|
|
128643
128653
|
}) || array;
|
|
@@ -128714,24 +128724,27 @@ function computeSignature(text, host, data) {
|
|
|
128714
128724
|
return (host.createHash ?? generateDjb2Hash)(getTextHandlingSourceMapForSignature(text, data));
|
|
128715
128725
|
}
|
|
128716
128726
|
function createBuilderProgram(kind, { newProgram, host, oldProgram, configFileParsingDiagnostics }) {
|
|
128717
|
-
let oldState = oldProgram && oldProgram.
|
|
128727
|
+
let oldState = oldProgram && oldProgram.state;
|
|
128718
128728
|
if (oldState && newProgram === oldState.program && configFileParsingDiagnostics === newProgram.getConfigFileParsingDiagnostics()) {
|
|
128719
128729
|
newProgram = void 0;
|
|
128720
128730
|
oldState = void 0;
|
|
128721
128731
|
return oldProgram;
|
|
128722
128732
|
}
|
|
128723
128733
|
const state = createBuilderProgramState(newProgram, oldState);
|
|
128724
|
-
newProgram.getBuildInfo = () => getBuildInfo2(state);
|
|
128734
|
+
newProgram.getBuildInfo = () => getBuildInfo2(toBuilderProgramStateWithDefinedProgram(state));
|
|
128725
128735
|
newProgram = void 0;
|
|
128726
128736
|
oldProgram = void 0;
|
|
128727
128737
|
oldState = void 0;
|
|
128728
|
-
const
|
|
128729
|
-
|
|
128730
|
-
builderProgram.getState = getState;
|
|
128738
|
+
const builderProgram = createRedirectedBuilderProgram(state, configFileParsingDiagnostics);
|
|
128739
|
+
builderProgram.state = state;
|
|
128731
128740
|
builderProgram.saveEmitState = () => backupBuilderProgramEmitState(state);
|
|
128732
128741
|
builderProgram.restoreEmitState = (saved) => restoreBuilderProgramEmitState(state, saved);
|
|
128733
128742
|
builderProgram.hasChangedEmitSignature = () => !!state.hasChangedEmitSignature;
|
|
128734
|
-
builderProgram.getAllDependencies = (sourceFile) => BuilderState.getAllDependencies(
|
|
128743
|
+
builderProgram.getAllDependencies = (sourceFile) => BuilderState.getAllDependencies(
|
|
128744
|
+
state,
|
|
128745
|
+
Debug.checkDefined(state.program),
|
|
128746
|
+
sourceFile
|
|
128747
|
+
);
|
|
128735
128748
|
builderProgram.getSemanticDiagnostics = getSemanticDiagnostics;
|
|
128736
128749
|
builderProgram.emit = emit;
|
|
128737
128750
|
builderProgram.releaseProgram = () => releaseCache(state);
|
|
@@ -128746,8 +128759,12 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
128746
128759
|
}
|
|
128747
128760
|
return builderProgram;
|
|
128748
128761
|
function emitBuildInfo(writeFile2, cancellationToken) {
|
|
128762
|
+
Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
|
|
128749
128763
|
if (state.buildInfoEmitPending) {
|
|
128750
|
-
const result =
|
|
128764
|
+
const result = state.program.emitBuildInfo(
|
|
128765
|
+
writeFile2 || maybeBind(host, host.writeFile),
|
|
128766
|
+
cancellationToken
|
|
128767
|
+
);
|
|
128751
128768
|
state.buildInfoEmitPending = false;
|
|
128752
128769
|
return result;
|
|
128753
128770
|
}
|
|
@@ -128755,6 +128772,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
128755
128772
|
}
|
|
128756
128773
|
function emitNextAffectedFile(writeFile2, cancellationToken, emitOnlyDtsFiles, customTransformers) {
|
|
128757
128774
|
var _a, _b, _c, _d;
|
|
128775
|
+
Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
|
|
128758
128776
|
let affected = getNextAffectedFile(state, cancellationToken, host);
|
|
128759
128777
|
const programEmitKind = getBuilderFileEmit(state.compilerOptions);
|
|
128760
128778
|
let emitKind = emitOnlyDtsFiles ? programEmitKind & 24 /* AllDts */ : programEmitKind;
|
|
@@ -128795,7 +128813,10 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
128795
128813
|
if (!affected) {
|
|
128796
128814
|
if (!state.buildInfoEmitPending) return void 0;
|
|
128797
128815
|
const affected2 = state.program;
|
|
128798
|
-
const result2 = affected2.emitBuildInfo(
|
|
128816
|
+
const result2 = affected2.emitBuildInfo(
|
|
128817
|
+
writeFile2 || maybeBind(host, host.writeFile),
|
|
128818
|
+
cancellationToken
|
|
128819
|
+
);
|
|
128799
128820
|
state.buildInfoEmitPending = false;
|
|
128800
128821
|
return { result: result2, affected: affected2 };
|
|
128801
128822
|
}
|
|
@@ -128843,6 +128864,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
128843
128864
|
return { result, affected };
|
|
128844
128865
|
}
|
|
128845
128866
|
function getWriteFileCallback(writeFile2, customTransformers) {
|
|
128867
|
+
Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
|
|
128846
128868
|
if (!getEmitDeclarations(state.compilerOptions)) return writeFile2 || maybeBind(host, host.writeFile);
|
|
128847
128869
|
return (fileName, text, writeByteOrderMark, onError, sourceFiles, data) => {
|
|
128848
128870
|
var _a, _b, _c;
|
|
@@ -128909,6 +128931,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
128909
128931
|
};
|
|
128910
128932
|
}
|
|
128911
128933
|
function emit(targetSourceFile, writeFile2, cancellationToken, emitOnlyDtsFiles, customTransformers) {
|
|
128934
|
+
Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
|
|
128912
128935
|
if (kind === 1 /* EmitAndSemanticDiagnosticsBuilderProgram */) {
|
|
128913
128936
|
assertSourceFileOkWithoutNextAffectedCall(state, targetSourceFile);
|
|
128914
128937
|
}
|
|
@@ -128921,7 +128944,12 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
128921
128944
|
let diagnostics;
|
|
128922
128945
|
let emittedFiles = [];
|
|
128923
128946
|
let affectedEmitResult;
|
|
128924
|
-
while (affectedEmitResult = emitNextAffectedFile(
|
|
128947
|
+
while (affectedEmitResult = emitNextAffectedFile(
|
|
128948
|
+
writeFile2,
|
|
128949
|
+
cancellationToken,
|
|
128950
|
+
emitOnlyDtsFiles,
|
|
128951
|
+
customTransformers
|
|
128952
|
+
)) {
|
|
128925
128953
|
emitSkipped = emitSkipped || affectedEmitResult.result.emitSkipped;
|
|
128926
128954
|
diagnostics = addRange(diagnostics, affectedEmitResult.result.diagnostics);
|
|
128927
128955
|
emittedFiles = addRange(emittedFiles, affectedEmitResult.result.emittedFiles);
|
|
@@ -128937,7 +128965,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
128937
128965
|
clearAffectedFilesPendingEmit(state, emitOnlyDtsFiles);
|
|
128938
128966
|
}
|
|
128939
128967
|
}
|
|
128940
|
-
return
|
|
128968
|
+
return state.program.emit(
|
|
128941
128969
|
targetSourceFile,
|
|
128942
128970
|
getWriteFileCallback(writeFile2, customTransformers),
|
|
128943
128971
|
cancellationToken,
|
|
@@ -128946,6 +128974,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
128946
128974
|
);
|
|
128947
128975
|
}
|
|
128948
128976
|
function getSemanticDiagnosticsOfNextAffectedFile(cancellationToken, ignoreSourceFile) {
|
|
128977
|
+
Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
|
|
128949
128978
|
while (true) {
|
|
128950
128979
|
const affected = getNextAffectedFile(state, cancellationToken, host);
|
|
128951
128980
|
let result;
|
|
@@ -128983,6 +129012,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
128983
129012
|
}
|
|
128984
129013
|
}
|
|
128985
129014
|
function getSemanticDiagnostics(sourceFile, cancellationToken) {
|
|
129015
|
+
Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
|
|
128986
129016
|
assertSourceFileOkWithoutNextAffectedCall(state, sourceFile);
|
|
128987
129017
|
if (sourceFile) {
|
|
128988
129018
|
return getSemanticDiagnosticsOfFile(state, sourceFile, cancellationToken);
|
|
@@ -128993,7 +129023,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
128993
129023
|
if (affectedResult.affected === state.program) return affectedResult.result;
|
|
128994
129024
|
}
|
|
128995
129025
|
let diagnostics;
|
|
128996
|
-
for (const sourceFile2 of
|
|
129026
|
+
for (const sourceFile2 of state.program.getSourceFiles()) {
|
|
128997
129027
|
diagnostics = addRange(diagnostics, getSemanticDiagnosticsOfFile(state, sourceFile2, cancellationToken));
|
|
128998
129028
|
}
|
|
128999
129029
|
return diagnostics || emptyArray;
|
|
@@ -129014,43 +129044,42 @@ function toBuilderFileEmit(value, fullEmitForOptions) {
|
|
|
129014
129044
|
function toProgramEmitPending(value, options) {
|
|
129015
129045
|
return !value ? getBuilderFileEmit(options || {}) : value;
|
|
129016
129046
|
}
|
|
129017
|
-
function
|
|
129047
|
+
function createBuilderProgramUsingIncrementalBuildInfo(buildInfo, buildInfoPath, host) {
|
|
129018
129048
|
var _a, _b, _c, _d;
|
|
129019
|
-
const program = buildInfo.program;
|
|
129020
129049
|
const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory()));
|
|
129021
129050
|
const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames());
|
|
129022
129051
|
let state;
|
|
129023
|
-
const filePaths = (_a =
|
|
129052
|
+
const filePaths = (_a = buildInfo.fileNames) == null ? void 0 : _a.map(toPathInBuildInfoDirectory);
|
|
129024
129053
|
let filePathsSetList;
|
|
129025
|
-
const latestChangedDtsFile =
|
|
129054
|
+
const latestChangedDtsFile = buildInfo.latestChangedDtsFile ? toAbsolutePath(buildInfo.latestChangedDtsFile) : void 0;
|
|
129026
129055
|
const fileInfos = /* @__PURE__ */ new Map();
|
|
129027
|
-
const changedFilesSet = new Set(map(
|
|
129028
|
-
if (
|
|
129029
|
-
|
|
129056
|
+
const changedFilesSet = new Set(map(buildInfo.changeFileSet, toFilePath));
|
|
129057
|
+
if (isIncrementalBundleEmitBuildInfo(buildInfo)) {
|
|
129058
|
+
buildInfo.fileInfos.forEach((fileInfo, index) => {
|
|
129030
129059
|
const path = toFilePath(index + 1);
|
|
129031
129060
|
fileInfos.set(path, isString(fileInfo) ? { version: fileInfo, signature: void 0, affectsGlobalScope: void 0, impliedFormat: void 0 } : fileInfo);
|
|
129032
129061
|
});
|
|
129033
129062
|
state = {
|
|
129034
129063
|
fileInfos,
|
|
129035
|
-
compilerOptions:
|
|
129036
|
-
semanticDiagnosticsPerFile: toPerFileSemanticDiagnostics(
|
|
129037
|
-
emitDiagnosticsPerFile: toPerFileEmitDiagnostics(
|
|
129064
|
+
compilerOptions: buildInfo.options ? convertToOptionsWithAbsolutePaths(buildInfo.options, toAbsolutePath) : {},
|
|
129065
|
+
semanticDiagnosticsPerFile: toPerFileSemanticDiagnostics(buildInfo.semanticDiagnosticsPerFile),
|
|
129066
|
+
emitDiagnosticsPerFile: toPerFileEmitDiagnostics(buildInfo.emitDiagnosticsPerFile),
|
|
129038
129067
|
hasReusableDiagnostic: true,
|
|
129039
129068
|
changedFilesSet,
|
|
129040
129069
|
latestChangedDtsFile,
|
|
129041
|
-
outSignature:
|
|
129042
|
-
programEmitPending:
|
|
129070
|
+
outSignature: buildInfo.outSignature,
|
|
129071
|
+
programEmitPending: buildInfo.pendingEmit === void 0 ? void 0 : toProgramEmitPending(buildInfo.pendingEmit, buildInfo.options)
|
|
129043
129072
|
};
|
|
129044
129073
|
} else {
|
|
129045
|
-
filePathsSetList = (_b =
|
|
129046
|
-
const emitSignatures = ((_c =
|
|
129047
|
-
|
|
129074
|
+
filePathsSetList = (_b = buildInfo.fileIdsList) == null ? void 0 : _b.map((fileIds) => new Set(fileIds.map(toFilePath)));
|
|
129075
|
+
const emitSignatures = ((_c = buildInfo.options) == null ? void 0 : _c.composite) && !buildInfo.options.outFile ? /* @__PURE__ */ new Map() : void 0;
|
|
129076
|
+
buildInfo.fileInfos.forEach((fileInfo, index) => {
|
|
129048
129077
|
const path = toFilePath(index + 1);
|
|
129049
129078
|
const stateFileInfo = toBuilderStateFileInfoForMultiEmit(fileInfo);
|
|
129050
129079
|
fileInfos.set(path, stateFileInfo);
|
|
129051
129080
|
if (emitSignatures && stateFileInfo.signature) emitSignatures.set(path, stateFileInfo.signature);
|
|
129052
129081
|
});
|
|
129053
|
-
(_d =
|
|
129082
|
+
(_d = buildInfo.emitSignatures) == null ? void 0 : _d.forEach((value) => {
|
|
129054
129083
|
if (isNumber(value)) emitSignatures.delete(toFilePath(value));
|
|
129055
129084
|
else {
|
|
129056
129085
|
const key = toFilePath(value[0]);
|
|
@@ -129063,22 +129092,22 @@ function createBuilderProgramUsingProgramBuildInfo(buildInfo, buildInfoPath, hos
|
|
|
129063
129092
|
);
|
|
129064
129093
|
}
|
|
129065
129094
|
});
|
|
129066
|
-
const fullEmitForOptions =
|
|
129095
|
+
const fullEmitForOptions = buildInfo.affectedFilesPendingEmit ? getBuilderFileEmit(buildInfo.options || {}) : void 0;
|
|
129067
129096
|
state = {
|
|
129068
129097
|
fileInfos,
|
|
129069
|
-
compilerOptions:
|
|
129070
|
-
referencedMap: toManyToManyPathMap(
|
|
129071
|
-
semanticDiagnosticsPerFile: toPerFileSemanticDiagnostics(
|
|
129072
|
-
emitDiagnosticsPerFile: toPerFileEmitDiagnostics(
|
|
129098
|
+
compilerOptions: buildInfo.options ? convertToOptionsWithAbsolutePaths(buildInfo.options, toAbsolutePath) : {},
|
|
129099
|
+
referencedMap: toManyToManyPathMap(buildInfo.referencedMap, buildInfo.options ?? {}),
|
|
129100
|
+
semanticDiagnosticsPerFile: toPerFileSemanticDiagnostics(buildInfo.semanticDiagnosticsPerFile),
|
|
129101
|
+
emitDiagnosticsPerFile: toPerFileEmitDiagnostics(buildInfo.emitDiagnosticsPerFile),
|
|
129073
129102
|
hasReusableDiagnostic: true,
|
|
129074
|
-
affectedFilesPendingEmit:
|
|
129103
|
+
affectedFilesPendingEmit: buildInfo.affectedFilesPendingEmit && arrayToMap(buildInfo.affectedFilesPendingEmit, (value) => toFilePath(isNumber(value) ? value : value[0]), (value) => toBuilderFileEmit(value, fullEmitForOptions)),
|
|
129075
129104
|
changedFilesSet,
|
|
129076
129105
|
latestChangedDtsFile,
|
|
129077
129106
|
emitSignatures: (emitSignatures == null ? void 0 : emitSignatures.size) ? emitSignatures : void 0
|
|
129078
129107
|
};
|
|
129079
129108
|
}
|
|
129080
129109
|
return {
|
|
129081
|
-
|
|
129110
|
+
state,
|
|
129082
129111
|
saveEmitState: noop,
|
|
129083
129112
|
restoreEmitState: noop,
|
|
129084
129113
|
getProgram: notImplemented,
|
|
@@ -129172,15 +129201,15 @@ function getBuildInfoFileVersionMap(program, buildInfoPath, host) {
|
|
|
129172
129201
|
}
|
|
129173
129202
|
}
|
|
129174
129203
|
}
|
|
129175
|
-
function createRedirectedBuilderProgram(
|
|
129204
|
+
function createRedirectedBuilderProgram(state, configFileParsingDiagnostics) {
|
|
129176
129205
|
return {
|
|
129177
|
-
|
|
129206
|
+
state: void 0,
|
|
129178
129207
|
saveEmitState: noop,
|
|
129179
129208
|
restoreEmitState: noop,
|
|
129180
129209
|
getProgram,
|
|
129181
|
-
getProgramOrUndefined: () =>
|
|
129182
|
-
releaseProgram: () =>
|
|
129183
|
-
getCompilerOptions: () =>
|
|
129210
|
+
getProgramOrUndefined: () => state.program,
|
|
129211
|
+
releaseProgram: () => state.program = void 0,
|
|
129212
|
+
getCompilerOptions: () => state.compilerOptions,
|
|
129184
129213
|
getSourceFile: (fileName) => getProgram().getSourceFile(fileName),
|
|
129185
129214
|
getSourceFiles: () => getProgram().getSourceFiles(),
|
|
129186
129215
|
getOptionsDiagnostics: (cancellationToken) => getProgram().getOptionsDiagnostics(cancellationToken),
|
|
@@ -129196,20 +129225,50 @@ function createRedirectedBuilderProgram(getState, configFileParsingDiagnostics)
|
|
|
129196
129225
|
close: noop
|
|
129197
129226
|
};
|
|
129198
129227
|
function getProgram() {
|
|
129199
|
-
return Debug.checkDefined(
|
|
129228
|
+
return Debug.checkDefined(state.program);
|
|
129200
129229
|
}
|
|
129201
129230
|
}
|
|
129202
129231
|
|
|
129203
129232
|
// src/compiler/builderPublic.ts
|
|
129204
129233
|
function createSemanticDiagnosticsBuilderProgram(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences) {
|
|
129205
|
-
return createBuilderProgram(
|
|
129234
|
+
return createBuilderProgram(
|
|
129235
|
+
0 /* SemanticDiagnosticsBuilderProgram */,
|
|
129236
|
+
getBuilderCreationParameters(
|
|
129237
|
+
newProgramOrRootNames,
|
|
129238
|
+
hostOrOptions,
|
|
129239
|
+
oldProgramOrHost,
|
|
129240
|
+
configFileParsingDiagnosticsOrOldProgram,
|
|
129241
|
+
configFileParsingDiagnostics,
|
|
129242
|
+
projectReferences
|
|
129243
|
+
)
|
|
129244
|
+
);
|
|
129206
129245
|
}
|
|
129207
129246
|
function createEmitAndSemanticDiagnosticsBuilderProgram(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences) {
|
|
129208
|
-
return createBuilderProgram(
|
|
129247
|
+
return createBuilderProgram(
|
|
129248
|
+
1 /* EmitAndSemanticDiagnosticsBuilderProgram */,
|
|
129249
|
+
getBuilderCreationParameters(
|
|
129250
|
+
newProgramOrRootNames,
|
|
129251
|
+
hostOrOptions,
|
|
129252
|
+
oldProgramOrHost,
|
|
129253
|
+
configFileParsingDiagnosticsOrOldProgram,
|
|
129254
|
+
configFileParsingDiagnostics,
|
|
129255
|
+
projectReferences
|
|
129256
|
+
)
|
|
129257
|
+
);
|
|
129209
129258
|
}
|
|
129210
129259
|
function createAbstractBuilder(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences) {
|
|
129211
|
-
const { newProgram, configFileParsingDiagnostics: newConfigFileParsingDiagnostics } = getBuilderCreationParameters(
|
|
129212
|
-
|
|
129260
|
+
const { newProgram, configFileParsingDiagnostics: newConfigFileParsingDiagnostics } = getBuilderCreationParameters(
|
|
129261
|
+
newProgramOrRootNames,
|
|
129262
|
+
hostOrOptions,
|
|
129263
|
+
oldProgramOrHost,
|
|
129264
|
+
configFileParsingDiagnosticsOrOldProgram,
|
|
129265
|
+
configFileParsingDiagnostics,
|
|
129266
|
+
projectReferences
|
|
129267
|
+
);
|
|
129268
|
+
return createRedirectedBuilderProgram(
|
|
129269
|
+
{ program: newProgram, compilerOptions: newProgram.getCompilerOptions() },
|
|
129270
|
+
newConfigFileParsingDiagnostics
|
|
129271
|
+
);
|
|
129213
129272
|
}
|
|
129214
129273
|
|
|
129215
129274
|
// src/compiler/resolutionCache.ts
|
|
@@ -130484,13 +130543,13 @@ function createTabularErrorsDisplay(filesInError, host) {
|
|
|
130484
130543
|
});
|
|
130485
130544
|
return tabularData;
|
|
130486
130545
|
}
|
|
130487
|
-
function
|
|
130488
|
-
return !!program.
|
|
130546
|
+
function isBuilderProgram(program) {
|
|
130547
|
+
return !!program.state;
|
|
130489
130548
|
}
|
|
130490
130549
|
function listFiles(program, write) {
|
|
130491
130550
|
const options = program.getCompilerOptions();
|
|
130492
130551
|
if (options.explainFiles) {
|
|
130493
|
-
explainFiles(
|
|
130552
|
+
explainFiles(isBuilderProgram(program) ? program.getProgram() : program, write);
|
|
130494
130553
|
} else if (options.listFiles || options.listFilesOnly) {
|
|
130495
130554
|
forEach(program.getSourceFiles(), (file) => {
|
|
130496
130555
|
write(file.fileName);
|
|
@@ -130990,8 +131049,8 @@ function readBuilderProgram(compilerOptions, host) {
|
|
|
130990
131049
|
if (!content) return void 0;
|
|
130991
131050
|
buildInfo = getBuildInfo(buildInfoPath, content);
|
|
130992
131051
|
}
|
|
130993
|
-
if (!buildInfo || buildInfo.version !== version || !buildInfo
|
|
130994
|
-
return
|
|
131052
|
+
if (!buildInfo || buildInfo.version !== version || !isIncrementalBuildInfo(buildInfo)) return void 0;
|
|
131053
|
+
return createBuilderProgramUsingIncrementalBuildInfo(buildInfo, buildInfoPath, host);
|
|
130995
131054
|
}
|
|
130996
131055
|
function createIncrementalCompilerHost(options, system = sys) {
|
|
130997
131056
|
const host = createCompilerHostWorker(
|
|
@@ -132756,7 +132815,7 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
|
|
|
132756
132815
|
let oldestOutputFileName;
|
|
132757
132816
|
let oldestOutputFileTime = maximumDate;
|
|
132758
132817
|
let buildInfoTime;
|
|
132759
|
-
let
|
|
132818
|
+
let incrementalBuildInfo;
|
|
132760
132819
|
let buildInfoVersionMap;
|
|
132761
132820
|
if (buildInfoPath) {
|
|
132762
132821
|
const buildInfoCacheEntry2 = getBuildInfoCacheEntry(state, buildInfoPath, resolvedPath);
|
|
@@ -132781,26 +132840,26 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
|
|
|
132781
132840
|
fileName: buildInfoPath
|
|
132782
132841
|
};
|
|
132783
132842
|
}
|
|
132784
|
-
if (buildInfo
|
|
132843
|
+
if (isIncrementalBuildInfo(buildInfo) && buildInfo.version !== version) {
|
|
132785
132844
|
return {
|
|
132786
132845
|
type: 13 /* TsVersionOutputOfDate */,
|
|
132787
132846
|
version: buildInfo.version
|
|
132788
132847
|
};
|
|
132789
132848
|
}
|
|
132790
|
-
if (buildInfo
|
|
132791
|
-
if (((_a = buildInfo.
|
|
132849
|
+
if (isIncrementalBuildInfo(buildInfo)) {
|
|
132850
|
+
if (((_a = buildInfo.changeFileSet) == null ? void 0 : _a.length) || (!project.options.noEmit ? ((_b = buildInfo.affectedFilesPendingEmit) == null ? void 0 : _b.length) || ((_c = buildInfo.emitDiagnosticsPerFile) == null ? void 0 : _c.length) || buildInfo.pendingEmit !== void 0 : (_d = buildInfo.semanticDiagnosticsPerFile) == null ? void 0 : _d.length)) {
|
|
132792
132851
|
return {
|
|
132793
132852
|
type: 7 /* OutOfDateBuildInfo */,
|
|
132794
132853
|
buildInfoFile: buildInfoPath
|
|
132795
132854
|
};
|
|
132796
132855
|
}
|
|
132797
|
-
if (!project.options.noEmit && getPendingEmitKind(project.options, buildInfo.
|
|
132856
|
+
if (!project.options.noEmit && getPendingEmitKind(project.options, buildInfo.options || {})) {
|
|
132798
132857
|
return {
|
|
132799
132858
|
type: 8 /* OutOfDateOptions */,
|
|
132800
132859
|
buildInfoFile: buildInfoPath
|
|
132801
132860
|
};
|
|
132802
132861
|
}
|
|
132803
|
-
|
|
132862
|
+
incrementalBuildInfo = buildInfo;
|
|
132804
132863
|
}
|
|
132805
132864
|
oldestOutputFileTime = buildInfoTime;
|
|
132806
132865
|
oldestOutputFileName = buildInfoPath;
|
|
@@ -132817,12 +132876,12 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
|
|
|
132817
132876
|
reason: `${inputFile} does not exist`
|
|
132818
132877
|
};
|
|
132819
132878
|
}
|
|
132820
|
-
const inputPath =
|
|
132879
|
+
const inputPath = incrementalBuildInfo ? toPath2(state, inputFile) : void 0;
|
|
132821
132880
|
if (buildInfoTime && buildInfoTime < inputTime) {
|
|
132822
132881
|
let version2;
|
|
132823
132882
|
let currentVersion;
|
|
132824
|
-
if (
|
|
132825
|
-
if (!buildInfoVersionMap) buildInfoVersionMap = getBuildInfoFileVersionMap(
|
|
132883
|
+
if (incrementalBuildInfo) {
|
|
132884
|
+
if (!buildInfoVersionMap) buildInfoVersionMap = getBuildInfoFileVersionMap(incrementalBuildInfo, buildInfoPath, host);
|
|
132826
132885
|
const resolvedInputPath = buildInfoVersionMap.roots.get(inputPath);
|
|
132827
132886
|
version2 = buildInfoVersionMap.fileInfos.get(resolvedInputPath ?? inputPath);
|
|
132828
132887
|
const text = version2 ? state.readFileWithCache(resolvedInputPath ?? inputFile) : void 0;
|
|
@@ -132841,10 +132900,10 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
|
|
|
132841
132900
|
newestInputFileName = inputFile;
|
|
132842
132901
|
newestInputFileTime = inputTime;
|
|
132843
132902
|
}
|
|
132844
|
-
if (
|
|
132903
|
+
if (incrementalBuildInfo) seenRoots.add(inputPath);
|
|
132845
132904
|
}
|
|
132846
|
-
if (
|
|
132847
|
-
if (!buildInfoVersionMap) buildInfoVersionMap = getBuildInfoFileVersionMap(
|
|
132905
|
+
if (incrementalBuildInfo) {
|
|
132906
|
+
if (!buildInfoVersionMap) buildInfoVersionMap = getBuildInfoFileVersionMap(incrementalBuildInfo, buildInfoPath, host);
|
|
132848
132907
|
const existingRoot = forEachEntry(
|
|
132849
132908
|
buildInfoVersionMap.roots,
|
|
132850
132909
|
// File was root file when project was built but its not any more
|
|
@@ -132991,7 +133050,7 @@ function getLatestChangedDtsTime(state, options, resolvedConfigPath) {
|
|
|
132991
133050
|
if (!options.composite) return void 0;
|
|
132992
133051
|
const entry = Debug.checkDefined(state.buildInfoCache.get(resolvedConfigPath));
|
|
132993
133052
|
if (entry.latestChangedDtsTime !== void 0) return entry.latestChangedDtsTime || void 0;
|
|
132994
|
-
const latestChangedDtsTime = entry.buildInfo && entry.buildInfo
|
|
133053
|
+
const latestChangedDtsTime = entry.buildInfo && isIncrementalBuildInfo(entry.buildInfo) && entry.buildInfo.latestChangedDtsFile ? state.host.getModifiedTime(getNormalizedAbsolutePath(entry.buildInfo.latestChangedDtsFile, getDirectoryPath(entry.path))) : void 0;
|
|
132995
133054
|
entry.latestChangedDtsTime = latestChangedDtsTime || false;
|
|
132996
133055
|
return latestChangedDtsTime;
|
|
132997
133056
|
}
|
|
@@ -178818,9 +178877,8 @@ __export(ts_exports2, {
|
|
|
178818
178877
|
createBaseNodeFactory: () => createBaseNodeFactory,
|
|
178819
178878
|
createBinaryExpressionTrampoline: () => createBinaryExpressionTrampoline,
|
|
178820
178879
|
createBindingHelper: () => createBindingHelper,
|
|
178821
|
-
createBuildInfo: () => createBuildInfo,
|
|
178822
178880
|
createBuilderProgram: () => createBuilderProgram,
|
|
178823
|
-
|
|
178881
|
+
createBuilderProgramUsingIncrementalBuildInfo: () => createBuilderProgramUsingIncrementalBuildInfo,
|
|
178824
178882
|
createBuilderStatusReporter: () => createBuilderStatusReporter,
|
|
178825
178883
|
createCacheWithRedirects: () => createCacheWithRedirects,
|
|
178826
178884
|
createCacheableExportInfoMap: () => createCacheableExportInfoMap,
|
|
@@ -179704,7 +179762,7 @@ __export(ts_exports2, {
|
|
|
179704
179762
|
isBreakStatement: () => isBreakStatement,
|
|
179705
179763
|
isBuild: () => isBuild,
|
|
179706
179764
|
isBuildInfoFile: () => isBuildInfoFile,
|
|
179707
|
-
isBuilderProgram: () =>
|
|
179765
|
+
isBuilderProgram: () => isBuilderProgram,
|
|
179708
179766
|
isBundle: () => isBundle,
|
|
179709
179767
|
isCallChain: () => isCallChain,
|
|
179710
179768
|
isCallExpression: () => isCallExpression,
|
|
@@ -179911,6 +179969,8 @@ __export(ts_exports2, {
|
|
|
179911
179969
|
isInTemplateString: () => isInTemplateString,
|
|
179912
179970
|
isInTopLevelContext: () => isInTopLevelContext,
|
|
179913
179971
|
isInTypeQuery: () => isInTypeQuery,
|
|
179972
|
+
isIncrementalBuildInfo: () => isIncrementalBuildInfo,
|
|
179973
|
+
isIncrementalBundleEmitBuildInfo: () => isIncrementalBundleEmitBuildInfo,
|
|
179914
179974
|
isIncrementalCompilation: () => isIncrementalCompilation,
|
|
179915
179975
|
isIndexSignatureDeclaration: () => isIndexSignatureDeclaration,
|
|
179916
179976
|
isIndexedAccessTypeNode: () => isIndexedAccessTypeNode,
|
|
@@ -180147,7 +180207,6 @@ __export(ts_exports2, {
|
|
|
180147
180207
|
isPrivateIdentifierClassElementDeclaration: () => isPrivateIdentifierClassElementDeclaration,
|
|
180148
180208
|
isPrivateIdentifierPropertyAccessExpression: () => isPrivateIdentifierPropertyAccessExpression,
|
|
180149
180209
|
isPrivateIdentifierSymbol: () => isPrivateIdentifierSymbol,
|
|
180150
|
-
isProgramBundleEmitBuildInfo: () => isProgramBundleEmitBuildInfo,
|
|
180151
180210
|
isProgramUptoDate: () => isProgramUptoDate,
|
|
180152
180211
|
isPrologueDirective: () => isPrologueDirective,
|
|
180153
180212
|
isPropertyAccessChain: () => isPropertyAccessChain,
|
|
@@ -193254,9 +193313,8 @@ if (typeof console !== "undefined") {
|
|
|
193254
193313
|
createBaseNodeFactory,
|
|
193255
193314
|
createBinaryExpressionTrampoline,
|
|
193256
193315
|
createBindingHelper,
|
|
193257
|
-
createBuildInfo,
|
|
193258
193316
|
createBuilderProgram,
|
|
193259
|
-
|
|
193317
|
+
createBuilderProgramUsingIncrementalBuildInfo,
|
|
193260
193318
|
createBuilderStatusReporter,
|
|
193261
193319
|
createCacheWithRedirects,
|
|
193262
193320
|
createCacheableExportInfoMap,
|
|
@@ -194347,6 +194405,8 @@ if (typeof console !== "undefined") {
|
|
|
194347
194405
|
isInTemplateString,
|
|
194348
194406
|
isInTopLevelContext,
|
|
194349
194407
|
isInTypeQuery,
|
|
194408
|
+
isIncrementalBuildInfo,
|
|
194409
|
+
isIncrementalBundleEmitBuildInfo,
|
|
194350
194410
|
isIncrementalCompilation,
|
|
194351
194411
|
isIndexSignatureDeclaration,
|
|
194352
194412
|
isIndexedAccessTypeNode,
|
|
@@ -194583,7 +194643,6 @@ if (typeof console !== "undefined") {
|
|
|
194583
194643
|
isPrivateIdentifierClassElementDeclaration,
|
|
194584
194644
|
isPrivateIdentifierPropertyAccessExpression,
|
|
194585
194645
|
isPrivateIdentifierSymbol,
|
|
194586
|
-
isProgramBundleEmitBuildInfo,
|
|
194587
194646
|
isProgramUptoDate,
|
|
194588
194647
|
isPrologueDirective,
|
|
194589
194648
|
isPropertyAccessChain,
|