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/tsc.js
CHANGED
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
20
|
var versionMajorMinor = "5.6";
|
|
21
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
21
|
+
var version = `${versionMajorMinor}.0-dev.20240607`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -113149,10 +113149,7 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
|
|
|
113149
113149
|
emitSkipped = true;
|
|
113150
113150
|
return;
|
|
113151
113151
|
}
|
|
113152
|
-
const buildInfo = host.getBuildInfo() ||
|
|
113153
|
-
/*program*/
|
|
113154
|
-
void 0
|
|
113155
|
-
);
|
|
113152
|
+
const buildInfo = host.getBuildInfo() || { version };
|
|
113156
113153
|
writeFile(
|
|
113157
113154
|
host,
|
|
113158
113155
|
emitterDiagnostics,
|
|
@@ -113435,9 +113432,6 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
|
|
|
113435
113432
|
return encodeURI(sourceMapFile);
|
|
113436
113433
|
}
|
|
113437
113434
|
}
|
|
113438
|
-
function createBuildInfo(program) {
|
|
113439
|
-
return { program, version };
|
|
113440
|
-
}
|
|
113441
113435
|
function getBuildInfoText(buildInfo) {
|
|
113442
113436
|
return JSON.stringify(buildInfo);
|
|
113443
113437
|
}
|
|
@@ -118218,7 +118212,7 @@ function isIgnoredFileFromWildCardWatching({
|
|
|
118218
118212
|
}
|
|
118219
118213
|
return false;
|
|
118220
118214
|
function hasSourceFile(file) {
|
|
118221
|
-
return realProgram ? !!realProgram.getSourceFileByPath(file) : builderProgram ? builderProgram.
|
|
118215
|
+
return realProgram ? !!realProgram.getSourceFileByPath(file) : builderProgram ? builderProgram.state.fileInfos.has(file) : !!find(program, (rootFile) => toPath3(rootFile) === file);
|
|
118222
118216
|
}
|
|
118223
118217
|
function isSupportedScriptKind() {
|
|
118224
118218
|
if (!getScriptKind) return false;
|
|
@@ -118239,9 +118233,6 @@ function isIgnoredFileFromWildCardWatching({
|
|
|
118239
118233
|
}
|
|
118240
118234
|
}
|
|
118241
118235
|
}
|
|
118242
|
-
function isBuilderProgram(program) {
|
|
118243
|
-
return !!program.getState;
|
|
118244
|
-
}
|
|
118245
118236
|
function isEmittedFileOfProgram(program, file) {
|
|
118246
118237
|
if (!program) {
|
|
118247
118238
|
return false;
|
|
@@ -122799,6 +122790,13 @@ var BuilderState;
|
|
|
122799
122790
|
})(BuilderState || (BuilderState = {}));
|
|
122800
122791
|
|
|
122801
122792
|
// src/compiler/builder.ts
|
|
122793
|
+
function isBuilderProgramStateWithDefinedProgram(state) {
|
|
122794
|
+
return state.program !== void 0;
|
|
122795
|
+
}
|
|
122796
|
+
function toBuilderProgramStateWithDefinedProgram(state) {
|
|
122797
|
+
Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
|
|
122798
|
+
return state;
|
|
122799
|
+
}
|
|
122802
122800
|
function getBuilderFileEmit(options) {
|
|
122803
122801
|
let result = 1 /* Js */;
|
|
122804
122802
|
if (options.sourceMap) result = result | 2 /* JsMap */;
|
|
@@ -123063,7 +123061,11 @@ function getNextAffectedFile(state, cancellationToken, host) {
|
|
|
123063
123061
|
const affectedFile = affectedFiles[affectedFilesIndex];
|
|
123064
123062
|
if (!seenAffectedFiles.has(affectedFile.resolvedPath)) {
|
|
123065
123063
|
state.affectedFilesIndex = affectedFilesIndex;
|
|
123066
|
-
addToAffectedFilesPendingEmit(
|
|
123064
|
+
addToAffectedFilesPendingEmit(
|
|
123065
|
+
state,
|
|
123066
|
+
affectedFile.resolvedPath,
|
|
123067
|
+
getBuilderFileEmit(state.compilerOptions)
|
|
123068
|
+
);
|
|
123067
123069
|
handleDtsMayChangeOfAffectedFile(
|
|
123068
123070
|
state,
|
|
123069
123071
|
affectedFile,
|
|
@@ -123083,12 +123085,11 @@ function getNextAffectedFile(state, cancellationToken, host) {
|
|
|
123083
123085
|
if (nextKey.done) {
|
|
123084
123086
|
return void 0;
|
|
123085
123087
|
}
|
|
123086
|
-
const
|
|
123087
|
-
|
|
123088
|
-
if (compilerOptions.outFile) return program;
|
|
123088
|
+
const compilerOptions = state.program.getCompilerOptions();
|
|
123089
|
+
if (compilerOptions.outFile) return state.program;
|
|
123089
123090
|
state.affectedFiles = BuilderState.getFilesAffectedByWithOldState(
|
|
123090
123091
|
state,
|
|
123091
|
-
program,
|
|
123092
|
+
state.program,
|
|
123092
123093
|
nextKey.value,
|
|
123093
123094
|
cancellationToken,
|
|
123094
123095
|
host
|
|
@@ -123149,9 +123150,8 @@ function getNextPendingEmitDiagnosticsFile(state) {
|
|
|
123149
123150
|
function removeDiagnosticsOfLibraryFiles(state) {
|
|
123150
123151
|
if (!state.cleanedDiagnosticsOfLibFiles) {
|
|
123151
123152
|
state.cleanedDiagnosticsOfLibFiles = true;
|
|
123152
|
-
const
|
|
123153
|
-
|
|
123154
|
-
forEach(program.getSourceFiles(), (f) => program.isSourceFileDefaultLibrary(f) && !skipTypeChecking(f, options, program) && removeSemanticDiagnosticsOf(state, f.resolvedPath));
|
|
123153
|
+
const options = state.program.getCompilerOptions();
|
|
123154
|
+
forEach(state.program.getSourceFiles(), (f) => state.program.isSourceFileDefaultLibrary(f) && !skipTypeChecking(f, options, state.program) && removeSemanticDiagnosticsOf(state, f.resolvedPath));
|
|
123155
123155
|
}
|
|
123156
123156
|
}
|
|
123157
123157
|
function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken, host) {
|
|
@@ -123160,7 +123160,7 @@ function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken
|
|
|
123160
123160
|
removeDiagnosticsOfLibraryFiles(state);
|
|
123161
123161
|
BuilderState.updateShapeSignature(
|
|
123162
123162
|
state,
|
|
123163
|
-
|
|
123163
|
+
state.program,
|
|
123164
123164
|
affectedFile,
|
|
123165
123165
|
cancellationToken,
|
|
123166
123166
|
host
|
|
@@ -123178,12 +123178,11 @@ function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken
|
|
|
123178
123178
|
function handleDtsMayChangeOf(state, path, invalidateJsFiles, cancellationToken, host) {
|
|
123179
123179
|
removeSemanticDiagnosticsOf(state, path);
|
|
123180
123180
|
if (!state.changedFilesSet.has(path)) {
|
|
123181
|
-
const
|
|
123182
|
-
const sourceFile = program.getSourceFileByPath(path);
|
|
123181
|
+
const sourceFile = state.program.getSourceFileByPath(path);
|
|
123183
123182
|
if (sourceFile) {
|
|
123184
123183
|
BuilderState.updateShapeSignature(
|
|
123185
123184
|
state,
|
|
123186
|
-
program,
|
|
123185
|
+
state.program,
|
|
123187
123186
|
sourceFile,
|
|
123188
123187
|
cancellationToken,
|
|
123189
123188
|
host,
|
|
@@ -123191,9 +123190,17 @@ function handleDtsMayChangeOf(state, path, invalidateJsFiles, cancellationToken,
|
|
|
123191
123190
|
true
|
|
123192
123191
|
);
|
|
123193
123192
|
if (invalidateJsFiles) {
|
|
123194
|
-
addToAffectedFilesPendingEmit(
|
|
123193
|
+
addToAffectedFilesPendingEmit(
|
|
123194
|
+
state,
|
|
123195
|
+
path,
|
|
123196
|
+
getBuilderFileEmit(state.compilerOptions)
|
|
123197
|
+
);
|
|
123195
123198
|
} else if (getEmitDeclarations(state.compilerOptions)) {
|
|
123196
|
-
addToAffectedFilesPendingEmit(
|
|
123199
|
+
addToAffectedFilesPendingEmit(
|
|
123200
|
+
state,
|
|
123201
|
+
path,
|
|
123202
|
+
state.compilerOptions.declarationMap ? 24 /* AllDts */ : 8 /* Dts */
|
|
123203
|
+
);
|
|
123197
123204
|
}
|
|
123198
123205
|
}
|
|
123199
123206
|
}
|
|
@@ -123260,7 +123267,7 @@ function handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile
|
|
|
123260
123267
|
host
|
|
123261
123268
|
);
|
|
123262
123269
|
if (isChangedSignature(state, currentPath)) {
|
|
123263
|
-
const currentSourceFile =
|
|
123270
|
+
const currentSourceFile = state.program.getSourceFileByPath(currentPath);
|
|
123264
123271
|
queue.push(...BuilderState.getReferencedByPaths(state, currentSourceFile.resolvedPath));
|
|
123265
123272
|
}
|
|
123266
123273
|
}
|
|
@@ -123309,7 +123316,7 @@ function handleDtsMayChangeOfFileAndExportsOfFile(state, filePath, invalidateJsF
|
|
|
123309
123316
|
function getSemanticDiagnosticsOfFile(state, sourceFile, cancellationToken, semanticDiagnosticsPerFile) {
|
|
123310
123317
|
return concatenate(
|
|
123311
123318
|
getBinderAndCheckerDiagnosticsOfFile(state, sourceFile, cancellationToken, semanticDiagnosticsPerFile),
|
|
123312
|
-
|
|
123319
|
+
state.program.getProgramDiagnostics(sourceFile)
|
|
123313
123320
|
);
|
|
123314
123321
|
}
|
|
123315
123322
|
function getBinderAndCheckerDiagnosticsOfFile(state, sourceFile, cancellationToken, semanticDiagnosticsPerFile) {
|
|
@@ -123319,17 +123326,20 @@ function getBinderAndCheckerDiagnosticsOfFile(state, sourceFile, cancellationTok
|
|
|
123319
123326
|
if (cachedDiagnostics) {
|
|
123320
123327
|
return filterSemanticDiagnostics(cachedDiagnostics, state.compilerOptions);
|
|
123321
123328
|
}
|
|
123322
|
-
const diagnostics =
|
|
123329
|
+
const diagnostics = state.program.getBindAndCheckDiagnostics(sourceFile, cancellationToken);
|
|
123323
123330
|
semanticDiagnosticsPerFile.set(path, diagnostics);
|
|
123324
123331
|
return filterSemanticDiagnostics(diagnostics, state.compilerOptions);
|
|
123325
123332
|
}
|
|
123326
|
-
function
|
|
123333
|
+
function isIncrementalBundleEmitBuildInfo(info) {
|
|
123327
123334
|
var _a;
|
|
123328
123335
|
return !!((_a = info.options) == null ? void 0 : _a.outFile);
|
|
123329
123336
|
}
|
|
123337
|
+
function isIncrementalBuildInfo(info) {
|
|
123338
|
+
return !!info.fileNames;
|
|
123339
|
+
}
|
|
123330
123340
|
function getBuildInfo2(state) {
|
|
123331
123341
|
var _a, _b;
|
|
123332
|
-
const currentDirectory =
|
|
123342
|
+
const currentDirectory = state.program.getCurrentDirectory();
|
|
123333
123343
|
const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(getTsBuildInfoEmitOutputFilePath(state.compilerOptions), currentDirectory));
|
|
123334
123344
|
const latestChangedDtsFile = state.latestChangedDtsFile ? relativeToBuildInfoEnsuringAbsolutePath(state.latestChangedDtsFile) : void 0;
|
|
123335
123345
|
const fileNames = [];
|
|
@@ -123342,14 +123352,14 @@ function getBuildInfo2(state) {
|
|
|
123342
123352
|
tryAddRoot(key, fileId);
|
|
123343
123353
|
return value.impliedFormat ? { version: value.version, impliedFormat: value.impliedFormat, signature: void 0, affectsGlobalScope: void 0 } : value.version;
|
|
123344
123354
|
});
|
|
123345
|
-
|
|
123355
|
+
return {
|
|
123346
123356
|
fileNames,
|
|
123347
123357
|
fileInfos: fileInfos2,
|
|
123348
123358
|
root,
|
|
123349
123359
|
resolvedRoot: toResolvedRoot(),
|
|
123350
|
-
options:
|
|
123351
|
-
semanticDiagnosticsPerFile:
|
|
123352
|
-
emitDiagnosticsPerFile:
|
|
123360
|
+
options: toIncrementalBuildInfoCompilerOptions(state.compilerOptions),
|
|
123361
|
+
semanticDiagnosticsPerFile: toIncrementalBuildInfoDiagnostics(),
|
|
123362
|
+
emitDiagnosticsPerFile: toIncrementalBuildInfoEmitDiagnostics(),
|
|
123353
123363
|
changeFileSet: toChangeFileSet(),
|
|
123354
123364
|
outSignature: state.outSignature,
|
|
123355
123365
|
latestChangedDtsFile,
|
|
@@ -123359,10 +123369,10 @@ function getBuildInfo2(state) {
|
|
|
123359
123369
|
// Pending emit is same as deteremined by compilerOptions
|
|
123360
123370
|
state.programEmitPending
|
|
123361
123371
|
)
|
|
123362
|
-
)
|
|
123372
|
+
),
|
|
123363
123373
|
// Actual value
|
|
123374
|
+
version
|
|
123364
123375
|
};
|
|
123365
|
-
return createBuildInfo(program2);
|
|
123366
123376
|
}
|
|
123367
123377
|
let fileIdsList;
|
|
123368
123378
|
let fileNamesToFileIdListId;
|
|
@@ -123417,7 +123427,7 @@ function getBuildInfo2(state) {
|
|
|
123417
123427
|
toFileIdListId(state.referencedMap.getValues(key))
|
|
123418
123428
|
]);
|
|
123419
123429
|
}
|
|
123420
|
-
const semanticDiagnosticsPerFile =
|
|
123430
|
+
const semanticDiagnosticsPerFile = toIncrementalBuildInfoDiagnostics();
|
|
123421
123431
|
let affectedFilesPendingEmit;
|
|
123422
123432
|
if ((_b = state.affectedFilesPendingEmit) == null ? void 0 : _b.size) {
|
|
123423
123433
|
const fullEmitForOptions = getBuilderFileEmit(state.compilerOptions);
|
|
@@ -123441,22 +123451,22 @@ function getBuildInfo2(state) {
|
|
|
123441
123451
|
}
|
|
123442
123452
|
}
|
|
123443
123453
|
}
|
|
123444
|
-
|
|
123454
|
+
return {
|
|
123445
123455
|
fileNames,
|
|
123456
|
+
fileIdsList,
|
|
123446
123457
|
fileInfos,
|
|
123447
123458
|
root,
|
|
123448
123459
|
resolvedRoot: toResolvedRoot(),
|
|
123449
|
-
options:
|
|
123450
|
-
fileIdsList,
|
|
123460
|
+
options: toIncrementalBuildInfoCompilerOptions(state.compilerOptions),
|
|
123451
123461
|
referencedMap,
|
|
123452
123462
|
semanticDiagnosticsPerFile,
|
|
123453
|
-
emitDiagnosticsPerFile:
|
|
123463
|
+
emitDiagnosticsPerFile: toIncrementalBuildInfoEmitDiagnostics(),
|
|
123454
123464
|
affectedFilesPendingEmit,
|
|
123455
123465
|
changeFileSet: toChangeFileSet(),
|
|
123456
123466
|
emitSignatures,
|
|
123457
|
-
latestChangedDtsFile
|
|
123467
|
+
latestChangedDtsFile,
|
|
123468
|
+
version
|
|
123458
123469
|
};
|
|
123459
|
-
return createBuildInfo(program);
|
|
123460
123470
|
function relativeToBuildInfoEnsuringAbsolutePath(path) {
|
|
123461
123471
|
return relativeToBuildInfo(getNormalizedAbsolutePath(path, currentDirectory));
|
|
123462
123472
|
}
|
|
@@ -123504,13 +123514,13 @@ function getBuildInfo2(state) {
|
|
|
123504
123514
|
});
|
|
123505
123515
|
return result;
|
|
123506
123516
|
}
|
|
123507
|
-
function
|
|
123517
|
+
function toIncrementalBuildInfoCompilerOptions(options) {
|
|
123508
123518
|
let result;
|
|
123509
123519
|
const { optionsNameMap } = getOptionsNameMap();
|
|
123510
123520
|
for (const name of getOwnKeys(options).sort(compareStringsCaseSensitive)) {
|
|
123511
123521
|
const optionInfo = optionsNameMap.get(name.toLowerCase());
|
|
123512
123522
|
if (optionInfo == null ? void 0 : optionInfo.affectsBuildInfo) {
|
|
123513
|
-
(result || (result = {}))[name] =
|
|
123523
|
+
(result || (result = {}))[name] = toReusableCompilerOptionValue(
|
|
123514
123524
|
optionInfo,
|
|
123515
123525
|
options[name]
|
|
123516
123526
|
);
|
|
@@ -123518,7 +123528,7 @@ function getBuildInfo2(state) {
|
|
|
123518
123528
|
}
|
|
123519
123529
|
return result;
|
|
123520
123530
|
}
|
|
123521
|
-
function
|
|
123531
|
+
function toReusableCompilerOptionValue(option, value) {
|
|
123522
123532
|
if (option) {
|
|
123523
123533
|
Debug.assert(option.type !== "listOrElement");
|
|
123524
123534
|
if (option.type === "list") {
|
|
@@ -123532,7 +123542,7 @@ function getBuildInfo2(state) {
|
|
|
123532
123542
|
}
|
|
123533
123543
|
return value;
|
|
123534
123544
|
}
|
|
123535
|
-
function
|
|
123545
|
+
function toIncrementalBuildInfoDiagnostics() {
|
|
123536
123546
|
let result;
|
|
123537
123547
|
state.fileInfos.forEach((_value, key) => {
|
|
123538
123548
|
const value = state.semanticDiagnosticsPerFile.get(key);
|
|
@@ -123541,13 +123551,13 @@ function getBuildInfo2(state) {
|
|
|
123541
123551
|
} else if (value.length) {
|
|
123542
123552
|
result = append(result, [
|
|
123543
123553
|
toFileId(key),
|
|
123544
|
-
|
|
123554
|
+
toReusableDiagnostic(value, key)
|
|
123545
123555
|
]);
|
|
123546
123556
|
}
|
|
123547
123557
|
});
|
|
123548
123558
|
return result;
|
|
123549
123559
|
}
|
|
123550
|
-
function
|
|
123560
|
+
function toIncrementalBuildInfoEmitDiagnostics() {
|
|
123551
123561
|
var _a2;
|
|
123552
123562
|
let result;
|
|
123553
123563
|
if (!((_a2 = state.emitDiagnosticsPerFile) == null ? void 0 : _a2.size)) return result;
|
|
@@ -123555,51 +123565,51 @@ function getBuildInfo2(state) {
|
|
|
123555
123565
|
const value = state.emitDiagnosticsPerFile.get(key);
|
|
123556
123566
|
result = append(result, [
|
|
123557
123567
|
toFileId(key),
|
|
123558
|
-
|
|
123568
|
+
toReusableDiagnostic(value, key)
|
|
123559
123569
|
]);
|
|
123560
123570
|
}
|
|
123561
123571
|
return result;
|
|
123562
123572
|
}
|
|
123563
|
-
function
|
|
123573
|
+
function toReusableDiagnostic(diagnostics, diagnosticFilePath) {
|
|
123564
123574
|
Debug.assert(!!diagnostics.length);
|
|
123565
123575
|
return diagnostics.map((diagnostic) => {
|
|
123566
|
-
const result =
|
|
123576
|
+
const result = toReusableDiagnosticRelatedInformation(diagnostic, diagnosticFilePath);
|
|
123567
123577
|
result.reportsUnnecessary = diagnostic.reportsUnnecessary;
|
|
123568
123578
|
result.reportDeprecated = diagnostic.reportsDeprecated;
|
|
123569
123579
|
result.source = diagnostic.source;
|
|
123570
123580
|
result.skippedOn = diagnostic.skippedOn;
|
|
123571
123581
|
const { relatedInformation } = diagnostic;
|
|
123572
|
-
result.relatedInformation = relatedInformation ? relatedInformation.length ? relatedInformation.map((r) =>
|
|
123582
|
+
result.relatedInformation = relatedInformation ? relatedInformation.length ? relatedInformation.map((r) => toReusableDiagnosticRelatedInformation(r, diagnosticFilePath)) : [] : void 0;
|
|
123573
123583
|
return result;
|
|
123574
123584
|
});
|
|
123575
123585
|
}
|
|
123576
|
-
function
|
|
123586
|
+
function toReusableDiagnosticRelatedInformation(diagnostic, diagnosticFilePath) {
|
|
123577
123587
|
const { file } = diagnostic;
|
|
123578
123588
|
return {
|
|
123579
123589
|
...diagnostic,
|
|
123580
123590
|
file: file ? file.resolvedPath === diagnosticFilePath ? void 0 : relativeToBuildInfo(file.resolvedPath) : false,
|
|
123581
|
-
messageText: isString(diagnostic.messageText) ? diagnostic.messageText :
|
|
123591
|
+
messageText: isString(diagnostic.messageText) ? diagnostic.messageText : toReusableDiagnosticMessageChain(diagnostic.messageText)
|
|
123582
123592
|
};
|
|
123583
123593
|
}
|
|
123584
|
-
function
|
|
123594
|
+
function toReusableDiagnosticMessageChain(chain) {
|
|
123585
123595
|
if (chain.repopulateInfo) {
|
|
123586
123596
|
return {
|
|
123587
123597
|
info: chain.repopulateInfo(),
|
|
123588
|
-
next:
|
|
123598
|
+
next: toReusableDiagnosticMessageChainArray(chain.next)
|
|
123589
123599
|
};
|
|
123590
123600
|
}
|
|
123591
|
-
const next =
|
|
123601
|
+
const next = toReusableDiagnosticMessageChainArray(chain.next);
|
|
123592
123602
|
return next === chain.next ? chain : { ...chain, next };
|
|
123593
123603
|
}
|
|
123594
|
-
function
|
|
123604
|
+
function toReusableDiagnosticMessageChainArray(array) {
|
|
123595
123605
|
if (!array) return array;
|
|
123596
123606
|
return forEach(array, (chain, index) => {
|
|
123597
|
-
const reusable =
|
|
123607
|
+
const reusable = toReusableDiagnosticMessageChain(chain);
|
|
123598
123608
|
if (chain === reusable) return void 0;
|
|
123599
123609
|
const result = index > 0 ? array.slice(0, index - 1) : [];
|
|
123600
123610
|
result.push(reusable);
|
|
123601
123611
|
for (let i = index + 1; i < array.length; i++) {
|
|
123602
|
-
result.push(
|
|
123612
|
+
result.push(toReusableDiagnosticMessageChain(array[i]));
|
|
123603
123613
|
}
|
|
123604
123614
|
return result;
|
|
123605
123615
|
}) || array;
|
|
@@ -123671,24 +123681,27 @@ function computeSignature(text, host, data) {
|
|
|
123671
123681
|
return (host.createHash ?? generateDjb2Hash)(getTextHandlingSourceMapForSignature(text, data));
|
|
123672
123682
|
}
|
|
123673
123683
|
function createBuilderProgram(kind, { newProgram, host, oldProgram, configFileParsingDiagnostics }) {
|
|
123674
|
-
let oldState = oldProgram && oldProgram.
|
|
123684
|
+
let oldState = oldProgram && oldProgram.state;
|
|
123675
123685
|
if (oldState && newProgram === oldState.program && configFileParsingDiagnostics === newProgram.getConfigFileParsingDiagnostics()) {
|
|
123676
123686
|
newProgram = void 0;
|
|
123677
123687
|
oldState = void 0;
|
|
123678
123688
|
return oldProgram;
|
|
123679
123689
|
}
|
|
123680
123690
|
const state = createBuilderProgramState(newProgram, oldState);
|
|
123681
|
-
newProgram.getBuildInfo = () => getBuildInfo2(state);
|
|
123691
|
+
newProgram.getBuildInfo = () => getBuildInfo2(toBuilderProgramStateWithDefinedProgram(state));
|
|
123682
123692
|
newProgram = void 0;
|
|
123683
123693
|
oldProgram = void 0;
|
|
123684
123694
|
oldState = void 0;
|
|
123685
|
-
const
|
|
123686
|
-
|
|
123687
|
-
builderProgram.getState = getState;
|
|
123695
|
+
const builderProgram = createRedirectedBuilderProgram(state, configFileParsingDiagnostics);
|
|
123696
|
+
builderProgram.state = state;
|
|
123688
123697
|
builderProgram.saveEmitState = () => backupBuilderProgramEmitState(state);
|
|
123689
123698
|
builderProgram.restoreEmitState = (saved) => restoreBuilderProgramEmitState(state, saved);
|
|
123690
123699
|
builderProgram.hasChangedEmitSignature = () => !!state.hasChangedEmitSignature;
|
|
123691
|
-
builderProgram.getAllDependencies = (sourceFile) => BuilderState.getAllDependencies(
|
|
123700
|
+
builderProgram.getAllDependencies = (sourceFile) => BuilderState.getAllDependencies(
|
|
123701
|
+
state,
|
|
123702
|
+
Debug.checkDefined(state.program),
|
|
123703
|
+
sourceFile
|
|
123704
|
+
);
|
|
123692
123705
|
builderProgram.getSemanticDiagnostics = getSemanticDiagnostics;
|
|
123693
123706
|
builderProgram.emit = emit;
|
|
123694
123707
|
builderProgram.releaseProgram = () => releaseCache(state);
|
|
@@ -123703,8 +123716,12 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
123703
123716
|
}
|
|
123704
123717
|
return builderProgram;
|
|
123705
123718
|
function emitBuildInfo(writeFile2, cancellationToken) {
|
|
123719
|
+
Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
|
|
123706
123720
|
if (state.buildInfoEmitPending) {
|
|
123707
|
-
const result =
|
|
123721
|
+
const result = state.program.emitBuildInfo(
|
|
123722
|
+
writeFile2 || maybeBind(host, host.writeFile),
|
|
123723
|
+
cancellationToken
|
|
123724
|
+
);
|
|
123708
123725
|
state.buildInfoEmitPending = false;
|
|
123709
123726
|
return result;
|
|
123710
123727
|
}
|
|
@@ -123712,6 +123729,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
123712
123729
|
}
|
|
123713
123730
|
function emitNextAffectedFile(writeFile2, cancellationToken, emitOnlyDtsFiles, customTransformers) {
|
|
123714
123731
|
var _a, _b, _c, _d;
|
|
123732
|
+
Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
|
|
123715
123733
|
let affected = getNextAffectedFile(state, cancellationToken, host);
|
|
123716
123734
|
const programEmitKind = getBuilderFileEmit(state.compilerOptions);
|
|
123717
123735
|
let emitKind = emitOnlyDtsFiles ? programEmitKind & 24 /* AllDts */ : programEmitKind;
|
|
@@ -123752,7 +123770,10 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
123752
123770
|
if (!affected) {
|
|
123753
123771
|
if (!state.buildInfoEmitPending) return void 0;
|
|
123754
123772
|
const affected2 = state.program;
|
|
123755
|
-
const result2 = affected2.emitBuildInfo(
|
|
123773
|
+
const result2 = affected2.emitBuildInfo(
|
|
123774
|
+
writeFile2 || maybeBind(host, host.writeFile),
|
|
123775
|
+
cancellationToken
|
|
123776
|
+
);
|
|
123756
123777
|
state.buildInfoEmitPending = false;
|
|
123757
123778
|
return { result: result2, affected: affected2 };
|
|
123758
123779
|
}
|
|
@@ -123800,6 +123821,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
123800
123821
|
return { result, affected };
|
|
123801
123822
|
}
|
|
123802
123823
|
function getWriteFileCallback(writeFile2, customTransformers) {
|
|
123824
|
+
Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
|
|
123803
123825
|
if (!getEmitDeclarations(state.compilerOptions)) return writeFile2 || maybeBind(host, host.writeFile);
|
|
123804
123826
|
return (fileName, text, writeByteOrderMark, onError, sourceFiles, data) => {
|
|
123805
123827
|
var _a, _b, _c;
|
|
@@ -123866,6 +123888,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
123866
123888
|
};
|
|
123867
123889
|
}
|
|
123868
123890
|
function emit(targetSourceFile, writeFile2, cancellationToken, emitOnlyDtsFiles, customTransformers) {
|
|
123891
|
+
Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
|
|
123869
123892
|
if (kind === 1 /* EmitAndSemanticDiagnosticsBuilderProgram */) {
|
|
123870
123893
|
assertSourceFileOkWithoutNextAffectedCall(state, targetSourceFile);
|
|
123871
123894
|
}
|
|
@@ -123878,7 +123901,12 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
123878
123901
|
let diagnostics;
|
|
123879
123902
|
let emittedFiles = [];
|
|
123880
123903
|
let affectedEmitResult;
|
|
123881
|
-
while (affectedEmitResult = emitNextAffectedFile(
|
|
123904
|
+
while (affectedEmitResult = emitNextAffectedFile(
|
|
123905
|
+
writeFile2,
|
|
123906
|
+
cancellationToken,
|
|
123907
|
+
emitOnlyDtsFiles,
|
|
123908
|
+
customTransformers
|
|
123909
|
+
)) {
|
|
123882
123910
|
emitSkipped = emitSkipped || affectedEmitResult.result.emitSkipped;
|
|
123883
123911
|
diagnostics = addRange(diagnostics, affectedEmitResult.result.diagnostics);
|
|
123884
123912
|
emittedFiles = addRange(emittedFiles, affectedEmitResult.result.emittedFiles);
|
|
@@ -123894,7 +123922,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
123894
123922
|
clearAffectedFilesPendingEmit(state, emitOnlyDtsFiles);
|
|
123895
123923
|
}
|
|
123896
123924
|
}
|
|
123897
|
-
return
|
|
123925
|
+
return state.program.emit(
|
|
123898
123926
|
targetSourceFile,
|
|
123899
123927
|
getWriteFileCallback(writeFile2, customTransformers),
|
|
123900
123928
|
cancellationToken,
|
|
@@ -123903,6 +123931,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
123903
123931
|
);
|
|
123904
123932
|
}
|
|
123905
123933
|
function getSemanticDiagnosticsOfNextAffectedFile(cancellationToken, ignoreSourceFile) {
|
|
123934
|
+
Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
|
|
123906
123935
|
while (true) {
|
|
123907
123936
|
const affected = getNextAffectedFile(state, cancellationToken, host);
|
|
123908
123937
|
let result;
|
|
@@ -123940,6 +123969,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
123940
123969
|
}
|
|
123941
123970
|
}
|
|
123942
123971
|
function getSemanticDiagnostics(sourceFile, cancellationToken) {
|
|
123972
|
+
Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
|
|
123943
123973
|
assertSourceFileOkWithoutNextAffectedCall(state, sourceFile);
|
|
123944
123974
|
if (sourceFile) {
|
|
123945
123975
|
return getSemanticDiagnosticsOfFile(state, sourceFile, cancellationToken);
|
|
@@ -123950,7 +123980,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
123950
123980
|
if (affectedResult.affected === state.program) return affectedResult.result;
|
|
123951
123981
|
}
|
|
123952
123982
|
let diagnostics;
|
|
123953
|
-
for (const sourceFile2 of
|
|
123983
|
+
for (const sourceFile2 of state.program.getSourceFiles()) {
|
|
123954
123984
|
diagnostics = addRange(diagnostics, getSemanticDiagnosticsOfFile(state, sourceFile2, cancellationToken));
|
|
123955
123985
|
}
|
|
123956
123986
|
return diagnostics || emptyArray;
|
|
@@ -123971,43 +124001,42 @@ function toBuilderFileEmit(value, fullEmitForOptions) {
|
|
|
123971
124001
|
function toProgramEmitPending(value, options) {
|
|
123972
124002
|
return !value ? getBuilderFileEmit(options || {}) : value;
|
|
123973
124003
|
}
|
|
123974
|
-
function
|
|
124004
|
+
function createBuilderProgramUsingIncrementalBuildInfo(buildInfo, buildInfoPath, host) {
|
|
123975
124005
|
var _a, _b, _c, _d;
|
|
123976
|
-
const program = buildInfo.program;
|
|
123977
124006
|
const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory()));
|
|
123978
124007
|
const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames());
|
|
123979
124008
|
let state;
|
|
123980
|
-
const filePaths = (_a =
|
|
124009
|
+
const filePaths = (_a = buildInfo.fileNames) == null ? void 0 : _a.map(toPathInBuildInfoDirectory);
|
|
123981
124010
|
let filePathsSetList;
|
|
123982
|
-
const latestChangedDtsFile =
|
|
124011
|
+
const latestChangedDtsFile = buildInfo.latestChangedDtsFile ? toAbsolutePath(buildInfo.latestChangedDtsFile) : void 0;
|
|
123983
124012
|
const fileInfos = /* @__PURE__ */ new Map();
|
|
123984
|
-
const changedFilesSet = new Set(map(
|
|
123985
|
-
if (
|
|
123986
|
-
|
|
124013
|
+
const changedFilesSet = new Set(map(buildInfo.changeFileSet, toFilePath));
|
|
124014
|
+
if (isIncrementalBundleEmitBuildInfo(buildInfo)) {
|
|
124015
|
+
buildInfo.fileInfos.forEach((fileInfo, index) => {
|
|
123987
124016
|
const path = toFilePath(index + 1);
|
|
123988
124017
|
fileInfos.set(path, isString(fileInfo) ? { version: fileInfo, signature: void 0, affectsGlobalScope: void 0, impliedFormat: void 0 } : fileInfo);
|
|
123989
124018
|
});
|
|
123990
124019
|
state = {
|
|
123991
124020
|
fileInfos,
|
|
123992
|
-
compilerOptions:
|
|
123993
|
-
semanticDiagnosticsPerFile: toPerFileSemanticDiagnostics(
|
|
123994
|
-
emitDiagnosticsPerFile: toPerFileEmitDiagnostics(
|
|
124021
|
+
compilerOptions: buildInfo.options ? convertToOptionsWithAbsolutePaths(buildInfo.options, toAbsolutePath) : {},
|
|
124022
|
+
semanticDiagnosticsPerFile: toPerFileSemanticDiagnostics(buildInfo.semanticDiagnosticsPerFile),
|
|
124023
|
+
emitDiagnosticsPerFile: toPerFileEmitDiagnostics(buildInfo.emitDiagnosticsPerFile),
|
|
123995
124024
|
hasReusableDiagnostic: true,
|
|
123996
124025
|
changedFilesSet,
|
|
123997
124026
|
latestChangedDtsFile,
|
|
123998
|
-
outSignature:
|
|
123999
|
-
programEmitPending:
|
|
124027
|
+
outSignature: buildInfo.outSignature,
|
|
124028
|
+
programEmitPending: buildInfo.pendingEmit === void 0 ? void 0 : toProgramEmitPending(buildInfo.pendingEmit, buildInfo.options)
|
|
124000
124029
|
};
|
|
124001
124030
|
} else {
|
|
124002
|
-
filePathsSetList = (_b =
|
|
124003
|
-
const emitSignatures = ((_c =
|
|
124004
|
-
|
|
124031
|
+
filePathsSetList = (_b = buildInfo.fileIdsList) == null ? void 0 : _b.map((fileIds) => new Set(fileIds.map(toFilePath)));
|
|
124032
|
+
const emitSignatures = ((_c = buildInfo.options) == null ? void 0 : _c.composite) && !buildInfo.options.outFile ? /* @__PURE__ */ new Map() : void 0;
|
|
124033
|
+
buildInfo.fileInfos.forEach((fileInfo, index) => {
|
|
124005
124034
|
const path = toFilePath(index + 1);
|
|
124006
124035
|
const stateFileInfo = toBuilderStateFileInfoForMultiEmit(fileInfo);
|
|
124007
124036
|
fileInfos.set(path, stateFileInfo);
|
|
124008
124037
|
if (emitSignatures && stateFileInfo.signature) emitSignatures.set(path, stateFileInfo.signature);
|
|
124009
124038
|
});
|
|
124010
|
-
(_d =
|
|
124039
|
+
(_d = buildInfo.emitSignatures) == null ? void 0 : _d.forEach((value) => {
|
|
124011
124040
|
if (isNumber(value)) emitSignatures.delete(toFilePath(value));
|
|
124012
124041
|
else {
|
|
124013
124042
|
const key = toFilePath(value[0]);
|
|
@@ -124020,22 +124049,22 @@ function createBuilderProgramUsingProgramBuildInfo(buildInfo, buildInfoPath, hos
|
|
|
124020
124049
|
);
|
|
124021
124050
|
}
|
|
124022
124051
|
});
|
|
124023
|
-
const fullEmitForOptions =
|
|
124052
|
+
const fullEmitForOptions = buildInfo.affectedFilesPendingEmit ? getBuilderFileEmit(buildInfo.options || {}) : void 0;
|
|
124024
124053
|
state = {
|
|
124025
124054
|
fileInfos,
|
|
124026
|
-
compilerOptions:
|
|
124027
|
-
referencedMap: toManyToManyPathMap(
|
|
124028
|
-
semanticDiagnosticsPerFile: toPerFileSemanticDiagnostics(
|
|
124029
|
-
emitDiagnosticsPerFile: toPerFileEmitDiagnostics(
|
|
124055
|
+
compilerOptions: buildInfo.options ? convertToOptionsWithAbsolutePaths(buildInfo.options, toAbsolutePath) : {},
|
|
124056
|
+
referencedMap: toManyToManyPathMap(buildInfo.referencedMap, buildInfo.options ?? {}),
|
|
124057
|
+
semanticDiagnosticsPerFile: toPerFileSemanticDiagnostics(buildInfo.semanticDiagnosticsPerFile),
|
|
124058
|
+
emitDiagnosticsPerFile: toPerFileEmitDiagnostics(buildInfo.emitDiagnosticsPerFile),
|
|
124030
124059
|
hasReusableDiagnostic: true,
|
|
124031
|
-
affectedFilesPendingEmit:
|
|
124060
|
+
affectedFilesPendingEmit: buildInfo.affectedFilesPendingEmit && arrayToMap(buildInfo.affectedFilesPendingEmit, (value) => toFilePath(isNumber(value) ? value : value[0]), (value) => toBuilderFileEmit(value, fullEmitForOptions)),
|
|
124032
124061
|
changedFilesSet,
|
|
124033
124062
|
latestChangedDtsFile,
|
|
124034
124063
|
emitSignatures: (emitSignatures == null ? void 0 : emitSignatures.size) ? emitSignatures : void 0
|
|
124035
124064
|
};
|
|
124036
124065
|
}
|
|
124037
124066
|
return {
|
|
124038
|
-
|
|
124067
|
+
state,
|
|
124039
124068
|
saveEmitState: noop,
|
|
124040
124069
|
restoreEmitState: noop,
|
|
124041
124070
|
getProgram: notImplemented,
|
|
@@ -124129,15 +124158,15 @@ function getBuildInfoFileVersionMap(program, buildInfoPath, host) {
|
|
|
124129
124158
|
}
|
|
124130
124159
|
}
|
|
124131
124160
|
}
|
|
124132
|
-
function createRedirectedBuilderProgram(
|
|
124161
|
+
function createRedirectedBuilderProgram(state, configFileParsingDiagnostics) {
|
|
124133
124162
|
return {
|
|
124134
|
-
|
|
124163
|
+
state: void 0,
|
|
124135
124164
|
saveEmitState: noop,
|
|
124136
124165
|
restoreEmitState: noop,
|
|
124137
124166
|
getProgram,
|
|
124138
|
-
getProgramOrUndefined: () =>
|
|
124139
|
-
releaseProgram: () =>
|
|
124140
|
-
getCompilerOptions: () =>
|
|
124167
|
+
getProgramOrUndefined: () => state.program,
|
|
124168
|
+
releaseProgram: () => state.program = void 0,
|
|
124169
|
+
getCompilerOptions: () => state.compilerOptions,
|
|
124141
124170
|
getSourceFile: (fileName) => getProgram().getSourceFile(fileName),
|
|
124142
124171
|
getSourceFiles: () => getProgram().getSourceFiles(),
|
|
124143
124172
|
getOptionsDiagnostics: (cancellationToken) => getProgram().getOptionsDiagnostics(cancellationToken),
|
|
@@ -124153,13 +124182,23 @@ function createRedirectedBuilderProgram(getState, configFileParsingDiagnostics)
|
|
|
124153
124182
|
close: noop
|
|
124154
124183
|
};
|
|
124155
124184
|
function getProgram() {
|
|
124156
|
-
return Debug.checkDefined(
|
|
124185
|
+
return Debug.checkDefined(state.program);
|
|
124157
124186
|
}
|
|
124158
124187
|
}
|
|
124159
124188
|
|
|
124160
124189
|
// src/compiler/builderPublic.ts
|
|
124161
124190
|
function createEmitAndSemanticDiagnosticsBuilderProgram(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences) {
|
|
124162
|
-
return createBuilderProgram(
|
|
124191
|
+
return createBuilderProgram(
|
|
124192
|
+
1 /* EmitAndSemanticDiagnosticsBuilderProgram */,
|
|
124193
|
+
getBuilderCreationParameters(
|
|
124194
|
+
newProgramOrRootNames,
|
|
124195
|
+
hostOrOptions,
|
|
124196
|
+
oldProgramOrHost,
|
|
124197
|
+
configFileParsingDiagnosticsOrOldProgram,
|
|
124198
|
+
configFileParsingDiagnostics,
|
|
124199
|
+
projectReferences
|
|
124200
|
+
)
|
|
124201
|
+
);
|
|
124163
124202
|
}
|
|
124164
124203
|
|
|
124165
124204
|
// src/compiler/resolutionCache.ts
|
|
@@ -125431,13 +125470,13 @@ function createTabularErrorsDisplay(filesInError, host) {
|
|
|
125431
125470
|
});
|
|
125432
125471
|
return tabularData;
|
|
125433
125472
|
}
|
|
125434
|
-
function
|
|
125435
|
-
return !!program.
|
|
125473
|
+
function isBuilderProgram(program) {
|
|
125474
|
+
return !!program.state;
|
|
125436
125475
|
}
|
|
125437
125476
|
function listFiles(program, write) {
|
|
125438
125477
|
const options = program.getCompilerOptions();
|
|
125439
125478
|
if (options.explainFiles) {
|
|
125440
|
-
explainFiles(
|
|
125479
|
+
explainFiles(isBuilderProgram(program) ? program.getProgram() : program, write);
|
|
125441
125480
|
} else if (options.listFiles || options.listFilesOnly) {
|
|
125442
125481
|
forEach(program.getSourceFiles(), (file) => {
|
|
125443
125482
|
write(file.fileName);
|
|
@@ -125937,8 +125976,8 @@ function readBuilderProgram(compilerOptions, host) {
|
|
|
125937
125976
|
if (!content) return void 0;
|
|
125938
125977
|
buildInfo = getBuildInfo(buildInfoPath, content);
|
|
125939
125978
|
}
|
|
125940
|
-
if (!buildInfo || buildInfo.version !== version || !buildInfo
|
|
125941
|
-
return
|
|
125979
|
+
if (!buildInfo || buildInfo.version !== version || !isIncrementalBuildInfo(buildInfo)) return void 0;
|
|
125980
|
+
return createBuilderProgramUsingIncrementalBuildInfo(buildInfo, buildInfoPath, host);
|
|
125942
125981
|
}
|
|
125943
125982
|
function createIncrementalCompilerHost(options, system = sys) {
|
|
125944
125983
|
const host = createCompilerHostWorker(
|
|
@@ -127653,7 +127692,7 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
|
|
|
127653
127692
|
let oldestOutputFileName;
|
|
127654
127693
|
let oldestOutputFileTime = maximumDate;
|
|
127655
127694
|
let buildInfoTime;
|
|
127656
|
-
let
|
|
127695
|
+
let incrementalBuildInfo;
|
|
127657
127696
|
let buildInfoVersionMap;
|
|
127658
127697
|
if (buildInfoPath) {
|
|
127659
127698
|
const buildInfoCacheEntry2 = getBuildInfoCacheEntry(state, buildInfoPath, resolvedPath);
|
|
@@ -127678,26 +127717,26 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
|
|
|
127678
127717
|
fileName: buildInfoPath
|
|
127679
127718
|
};
|
|
127680
127719
|
}
|
|
127681
|
-
if (buildInfo
|
|
127720
|
+
if (isIncrementalBuildInfo(buildInfo) && buildInfo.version !== version) {
|
|
127682
127721
|
return {
|
|
127683
127722
|
type: 13 /* TsVersionOutputOfDate */,
|
|
127684
127723
|
version: buildInfo.version
|
|
127685
127724
|
};
|
|
127686
127725
|
}
|
|
127687
|
-
if (buildInfo
|
|
127688
|
-
if (((_a = buildInfo.
|
|
127726
|
+
if (isIncrementalBuildInfo(buildInfo)) {
|
|
127727
|
+
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)) {
|
|
127689
127728
|
return {
|
|
127690
127729
|
type: 7 /* OutOfDateBuildInfo */,
|
|
127691
127730
|
buildInfoFile: buildInfoPath
|
|
127692
127731
|
};
|
|
127693
127732
|
}
|
|
127694
|
-
if (!project.options.noEmit && getPendingEmitKind(project.options, buildInfo.
|
|
127733
|
+
if (!project.options.noEmit && getPendingEmitKind(project.options, buildInfo.options || {})) {
|
|
127695
127734
|
return {
|
|
127696
127735
|
type: 8 /* OutOfDateOptions */,
|
|
127697
127736
|
buildInfoFile: buildInfoPath
|
|
127698
127737
|
};
|
|
127699
127738
|
}
|
|
127700
|
-
|
|
127739
|
+
incrementalBuildInfo = buildInfo;
|
|
127701
127740
|
}
|
|
127702
127741
|
oldestOutputFileTime = buildInfoTime;
|
|
127703
127742
|
oldestOutputFileName = buildInfoPath;
|
|
@@ -127714,12 +127753,12 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
|
|
|
127714
127753
|
reason: `${inputFile} does not exist`
|
|
127715
127754
|
};
|
|
127716
127755
|
}
|
|
127717
|
-
const inputPath =
|
|
127756
|
+
const inputPath = incrementalBuildInfo ? toPath2(state, inputFile) : void 0;
|
|
127718
127757
|
if (buildInfoTime && buildInfoTime < inputTime) {
|
|
127719
127758
|
let version2;
|
|
127720
127759
|
let currentVersion;
|
|
127721
|
-
if (
|
|
127722
|
-
if (!buildInfoVersionMap) buildInfoVersionMap = getBuildInfoFileVersionMap(
|
|
127760
|
+
if (incrementalBuildInfo) {
|
|
127761
|
+
if (!buildInfoVersionMap) buildInfoVersionMap = getBuildInfoFileVersionMap(incrementalBuildInfo, buildInfoPath, host);
|
|
127723
127762
|
const resolvedInputPath = buildInfoVersionMap.roots.get(inputPath);
|
|
127724
127763
|
version2 = buildInfoVersionMap.fileInfos.get(resolvedInputPath ?? inputPath);
|
|
127725
127764
|
const text = version2 ? state.readFileWithCache(resolvedInputPath ?? inputFile) : void 0;
|
|
@@ -127738,10 +127777,10 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
|
|
|
127738
127777
|
newestInputFileName = inputFile;
|
|
127739
127778
|
newestInputFileTime = inputTime;
|
|
127740
127779
|
}
|
|
127741
|
-
if (
|
|
127780
|
+
if (incrementalBuildInfo) seenRoots.add(inputPath);
|
|
127742
127781
|
}
|
|
127743
|
-
if (
|
|
127744
|
-
if (!buildInfoVersionMap) buildInfoVersionMap = getBuildInfoFileVersionMap(
|
|
127782
|
+
if (incrementalBuildInfo) {
|
|
127783
|
+
if (!buildInfoVersionMap) buildInfoVersionMap = getBuildInfoFileVersionMap(incrementalBuildInfo, buildInfoPath, host);
|
|
127745
127784
|
const existingRoot = forEachEntry(
|
|
127746
127785
|
buildInfoVersionMap.roots,
|
|
127747
127786
|
// File was root file when project was built but its not any more
|
|
@@ -127888,7 +127927,7 @@ function getLatestChangedDtsTime(state, options, resolvedConfigPath) {
|
|
|
127888
127927
|
if (!options.composite) return void 0;
|
|
127889
127928
|
const entry = Debug.checkDefined(state.buildInfoCache.get(resolvedConfigPath));
|
|
127890
127929
|
if (entry.latestChangedDtsTime !== void 0) return entry.latestChangedDtsTime || void 0;
|
|
127891
|
-
const latestChangedDtsTime = entry.buildInfo && entry.buildInfo
|
|
127930
|
+
const latestChangedDtsTime = entry.buildInfo && isIncrementalBuildInfo(entry.buildInfo) && entry.buildInfo.latestChangedDtsFile ? state.host.getModifiedTime(getNormalizedAbsolutePath(entry.buildInfo.latestChangedDtsFile, getDirectoryPath(entry.path))) : void 0;
|
|
127892
127931
|
entry.latestChangedDtsTime = latestChangedDtsTime || false;
|
|
127893
127932
|
return latestChangedDtsTime;
|
|
127894
127933
|
}
|