typescript 5.6.0-dev.20240606 → 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 +73 -77
- package/lib/typescript.js +82 -86
- 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
|
}
|
|
@@ -123336,10 +123330,13 @@ function getBinderAndCheckerDiagnosticsOfFile(state, sourceFile, cancellationTok
|
|
|
123336
123330
|
semanticDiagnosticsPerFile.set(path, diagnostics);
|
|
123337
123331
|
return filterSemanticDiagnostics(diagnostics, state.compilerOptions);
|
|
123338
123332
|
}
|
|
123339
|
-
function
|
|
123333
|
+
function isIncrementalBundleEmitBuildInfo(info) {
|
|
123340
123334
|
var _a;
|
|
123341
123335
|
return !!((_a = info.options) == null ? void 0 : _a.outFile);
|
|
123342
123336
|
}
|
|
123337
|
+
function isIncrementalBuildInfo(info) {
|
|
123338
|
+
return !!info.fileNames;
|
|
123339
|
+
}
|
|
123343
123340
|
function getBuildInfo2(state) {
|
|
123344
123341
|
var _a, _b;
|
|
123345
123342
|
const currentDirectory = state.program.getCurrentDirectory();
|
|
@@ -123355,14 +123352,14 @@ function getBuildInfo2(state) {
|
|
|
123355
123352
|
tryAddRoot(key, fileId);
|
|
123356
123353
|
return value.impliedFormat ? { version: value.version, impliedFormat: value.impliedFormat, signature: void 0, affectsGlobalScope: void 0 } : value.version;
|
|
123357
123354
|
});
|
|
123358
|
-
|
|
123355
|
+
return {
|
|
123359
123356
|
fileNames,
|
|
123360
123357
|
fileInfos: fileInfos2,
|
|
123361
123358
|
root,
|
|
123362
123359
|
resolvedRoot: toResolvedRoot(),
|
|
123363
|
-
options:
|
|
123364
|
-
semanticDiagnosticsPerFile:
|
|
123365
|
-
emitDiagnosticsPerFile:
|
|
123360
|
+
options: toIncrementalBuildInfoCompilerOptions(state.compilerOptions),
|
|
123361
|
+
semanticDiagnosticsPerFile: toIncrementalBuildInfoDiagnostics(),
|
|
123362
|
+
emitDiagnosticsPerFile: toIncrementalBuildInfoEmitDiagnostics(),
|
|
123366
123363
|
changeFileSet: toChangeFileSet(),
|
|
123367
123364
|
outSignature: state.outSignature,
|
|
123368
123365
|
latestChangedDtsFile,
|
|
@@ -123372,10 +123369,10 @@ function getBuildInfo2(state) {
|
|
|
123372
123369
|
// Pending emit is same as deteremined by compilerOptions
|
|
123373
123370
|
state.programEmitPending
|
|
123374
123371
|
)
|
|
123375
|
-
)
|
|
123372
|
+
),
|
|
123376
123373
|
// Actual value
|
|
123374
|
+
version
|
|
123377
123375
|
};
|
|
123378
|
-
return createBuildInfo(program2);
|
|
123379
123376
|
}
|
|
123380
123377
|
let fileIdsList;
|
|
123381
123378
|
let fileNamesToFileIdListId;
|
|
@@ -123430,7 +123427,7 @@ function getBuildInfo2(state) {
|
|
|
123430
123427
|
toFileIdListId(state.referencedMap.getValues(key))
|
|
123431
123428
|
]);
|
|
123432
123429
|
}
|
|
123433
|
-
const semanticDiagnosticsPerFile =
|
|
123430
|
+
const semanticDiagnosticsPerFile = toIncrementalBuildInfoDiagnostics();
|
|
123434
123431
|
let affectedFilesPendingEmit;
|
|
123435
123432
|
if ((_b = state.affectedFilesPendingEmit) == null ? void 0 : _b.size) {
|
|
123436
123433
|
const fullEmitForOptions = getBuilderFileEmit(state.compilerOptions);
|
|
@@ -123454,22 +123451,22 @@ function getBuildInfo2(state) {
|
|
|
123454
123451
|
}
|
|
123455
123452
|
}
|
|
123456
123453
|
}
|
|
123457
|
-
|
|
123454
|
+
return {
|
|
123458
123455
|
fileNames,
|
|
123456
|
+
fileIdsList,
|
|
123459
123457
|
fileInfos,
|
|
123460
123458
|
root,
|
|
123461
123459
|
resolvedRoot: toResolvedRoot(),
|
|
123462
|
-
options:
|
|
123463
|
-
fileIdsList,
|
|
123460
|
+
options: toIncrementalBuildInfoCompilerOptions(state.compilerOptions),
|
|
123464
123461
|
referencedMap,
|
|
123465
123462
|
semanticDiagnosticsPerFile,
|
|
123466
|
-
emitDiagnosticsPerFile:
|
|
123463
|
+
emitDiagnosticsPerFile: toIncrementalBuildInfoEmitDiagnostics(),
|
|
123467
123464
|
affectedFilesPendingEmit,
|
|
123468
123465
|
changeFileSet: toChangeFileSet(),
|
|
123469
123466
|
emitSignatures,
|
|
123470
|
-
latestChangedDtsFile
|
|
123467
|
+
latestChangedDtsFile,
|
|
123468
|
+
version
|
|
123471
123469
|
};
|
|
123472
|
-
return createBuildInfo(program);
|
|
123473
123470
|
function relativeToBuildInfoEnsuringAbsolutePath(path) {
|
|
123474
123471
|
return relativeToBuildInfo(getNormalizedAbsolutePath(path, currentDirectory));
|
|
123475
123472
|
}
|
|
@@ -123517,13 +123514,13 @@ function getBuildInfo2(state) {
|
|
|
123517
123514
|
});
|
|
123518
123515
|
return result;
|
|
123519
123516
|
}
|
|
123520
|
-
function
|
|
123517
|
+
function toIncrementalBuildInfoCompilerOptions(options) {
|
|
123521
123518
|
let result;
|
|
123522
123519
|
const { optionsNameMap } = getOptionsNameMap();
|
|
123523
123520
|
for (const name of getOwnKeys(options).sort(compareStringsCaseSensitive)) {
|
|
123524
123521
|
const optionInfo = optionsNameMap.get(name.toLowerCase());
|
|
123525
123522
|
if (optionInfo == null ? void 0 : optionInfo.affectsBuildInfo) {
|
|
123526
|
-
(result || (result = {}))[name] =
|
|
123523
|
+
(result || (result = {}))[name] = toReusableCompilerOptionValue(
|
|
123527
123524
|
optionInfo,
|
|
123528
123525
|
options[name]
|
|
123529
123526
|
);
|
|
@@ -123531,7 +123528,7 @@ function getBuildInfo2(state) {
|
|
|
123531
123528
|
}
|
|
123532
123529
|
return result;
|
|
123533
123530
|
}
|
|
123534
|
-
function
|
|
123531
|
+
function toReusableCompilerOptionValue(option, value) {
|
|
123535
123532
|
if (option) {
|
|
123536
123533
|
Debug.assert(option.type !== "listOrElement");
|
|
123537
123534
|
if (option.type === "list") {
|
|
@@ -123545,7 +123542,7 @@ function getBuildInfo2(state) {
|
|
|
123545
123542
|
}
|
|
123546
123543
|
return value;
|
|
123547
123544
|
}
|
|
123548
|
-
function
|
|
123545
|
+
function toIncrementalBuildInfoDiagnostics() {
|
|
123549
123546
|
let result;
|
|
123550
123547
|
state.fileInfos.forEach((_value, key) => {
|
|
123551
123548
|
const value = state.semanticDiagnosticsPerFile.get(key);
|
|
@@ -123554,13 +123551,13 @@ function getBuildInfo2(state) {
|
|
|
123554
123551
|
} else if (value.length) {
|
|
123555
123552
|
result = append(result, [
|
|
123556
123553
|
toFileId(key),
|
|
123557
|
-
|
|
123554
|
+
toReusableDiagnostic(value, key)
|
|
123558
123555
|
]);
|
|
123559
123556
|
}
|
|
123560
123557
|
});
|
|
123561
123558
|
return result;
|
|
123562
123559
|
}
|
|
123563
|
-
function
|
|
123560
|
+
function toIncrementalBuildInfoEmitDiagnostics() {
|
|
123564
123561
|
var _a2;
|
|
123565
123562
|
let result;
|
|
123566
123563
|
if (!((_a2 = state.emitDiagnosticsPerFile) == null ? void 0 : _a2.size)) return result;
|
|
@@ -123568,51 +123565,51 @@ function getBuildInfo2(state) {
|
|
|
123568
123565
|
const value = state.emitDiagnosticsPerFile.get(key);
|
|
123569
123566
|
result = append(result, [
|
|
123570
123567
|
toFileId(key),
|
|
123571
|
-
|
|
123568
|
+
toReusableDiagnostic(value, key)
|
|
123572
123569
|
]);
|
|
123573
123570
|
}
|
|
123574
123571
|
return result;
|
|
123575
123572
|
}
|
|
123576
|
-
function
|
|
123573
|
+
function toReusableDiagnostic(diagnostics, diagnosticFilePath) {
|
|
123577
123574
|
Debug.assert(!!diagnostics.length);
|
|
123578
123575
|
return diagnostics.map((diagnostic) => {
|
|
123579
|
-
const result =
|
|
123576
|
+
const result = toReusableDiagnosticRelatedInformation(diagnostic, diagnosticFilePath);
|
|
123580
123577
|
result.reportsUnnecessary = diagnostic.reportsUnnecessary;
|
|
123581
123578
|
result.reportDeprecated = diagnostic.reportsDeprecated;
|
|
123582
123579
|
result.source = diagnostic.source;
|
|
123583
123580
|
result.skippedOn = diagnostic.skippedOn;
|
|
123584
123581
|
const { relatedInformation } = diagnostic;
|
|
123585
|
-
result.relatedInformation = relatedInformation ? relatedInformation.length ? relatedInformation.map((r) =>
|
|
123582
|
+
result.relatedInformation = relatedInformation ? relatedInformation.length ? relatedInformation.map((r) => toReusableDiagnosticRelatedInformation(r, diagnosticFilePath)) : [] : void 0;
|
|
123586
123583
|
return result;
|
|
123587
123584
|
});
|
|
123588
123585
|
}
|
|
123589
|
-
function
|
|
123586
|
+
function toReusableDiagnosticRelatedInformation(diagnostic, diagnosticFilePath) {
|
|
123590
123587
|
const { file } = diagnostic;
|
|
123591
123588
|
return {
|
|
123592
123589
|
...diagnostic,
|
|
123593
123590
|
file: file ? file.resolvedPath === diagnosticFilePath ? void 0 : relativeToBuildInfo(file.resolvedPath) : false,
|
|
123594
|
-
messageText: isString(diagnostic.messageText) ? diagnostic.messageText :
|
|
123591
|
+
messageText: isString(diagnostic.messageText) ? diagnostic.messageText : toReusableDiagnosticMessageChain(diagnostic.messageText)
|
|
123595
123592
|
};
|
|
123596
123593
|
}
|
|
123597
|
-
function
|
|
123594
|
+
function toReusableDiagnosticMessageChain(chain) {
|
|
123598
123595
|
if (chain.repopulateInfo) {
|
|
123599
123596
|
return {
|
|
123600
123597
|
info: chain.repopulateInfo(),
|
|
123601
|
-
next:
|
|
123598
|
+
next: toReusableDiagnosticMessageChainArray(chain.next)
|
|
123602
123599
|
};
|
|
123603
123600
|
}
|
|
123604
|
-
const next =
|
|
123601
|
+
const next = toReusableDiagnosticMessageChainArray(chain.next);
|
|
123605
123602
|
return next === chain.next ? chain : { ...chain, next };
|
|
123606
123603
|
}
|
|
123607
|
-
function
|
|
123604
|
+
function toReusableDiagnosticMessageChainArray(array) {
|
|
123608
123605
|
if (!array) return array;
|
|
123609
123606
|
return forEach(array, (chain, index) => {
|
|
123610
|
-
const reusable =
|
|
123607
|
+
const reusable = toReusableDiagnosticMessageChain(chain);
|
|
123611
123608
|
if (chain === reusable) return void 0;
|
|
123612
123609
|
const result = index > 0 ? array.slice(0, index - 1) : [];
|
|
123613
123610
|
result.push(reusable);
|
|
123614
123611
|
for (let i = index + 1; i < array.length; i++) {
|
|
123615
|
-
result.push(
|
|
123612
|
+
result.push(toReusableDiagnosticMessageChain(array[i]));
|
|
123616
123613
|
}
|
|
123617
123614
|
return result;
|
|
123618
123615
|
}) || array;
|
|
@@ -124004,43 +124001,42 @@ function toBuilderFileEmit(value, fullEmitForOptions) {
|
|
|
124004
124001
|
function toProgramEmitPending(value, options) {
|
|
124005
124002
|
return !value ? getBuilderFileEmit(options || {}) : value;
|
|
124006
124003
|
}
|
|
124007
|
-
function
|
|
124004
|
+
function createBuilderProgramUsingIncrementalBuildInfo(buildInfo, buildInfoPath, host) {
|
|
124008
124005
|
var _a, _b, _c, _d;
|
|
124009
|
-
const program = buildInfo.program;
|
|
124010
124006
|
const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory()));
|
|
124011
124007
|
const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames());
|
|
124012
124008
|
let state;
|
|
124013
|
-
const filePaths = (_a =
|
|
124009
|
+
const filePaths = (_a = buildInfo.fileNames) == null ? void 0 : _a.map(toPathInBuildInfoDirectory);
|
|
124014
124010
|
let filePathsSetList;
|
|
124015
|
-
const latestChangedDtsFile =
|
|
124011
|
+
const latestChangedDtsFile = buildInfo.latestChangedDtsFile ? toAbsolutePath(buildInfo.latestChangedDtsFile) : void 0;
|
|
124016
124012
|
const fileInfos = /* @__PURE__ */ new Map();
|
|
124017
|
-
const changedFilesSet = new Set(map(
|
|
124018
|
-
if (
|
|
124019
|
-
|
|
124013
|
+
const changedFilesSet = new Set(map(buildInfo.changeFileSet, toFilePath));
|
|
124014
|
+
if (isIncrementalBundleEmitBuildInfo(buildInfo)) {
|
|
124015
|
+
buildInfo.fileInfos.forEach((fileInfo, index) => {
|
|
124020
124016
|
const path = toFilePath(index + 1);
|
|
124021
124017
|
fileInfos.set(path, isString(fileInfo) ? { version: fileInfo, signature: void 0, affectsGlobalScope: void 0, impliedFormat: void 0 } : fileInfo);
|
|
124022
124018
|
});
|
|
124023
124019
|
state = {
|
|
124024
124020
|
fileInfos,
|
|
124025
|
-
compilerOptions:
|
|
124026
|
-
semanticDiagnosticsPerFile: toPerFileSemanticDiagnostics(
|
|
124027
|
-
emitDiagnosticsPerFile: toPerFileEmitDiagnostics(
|
|
124021
|
+
compilerOptions: buildInfo.options ? convertToOptionsWithAbsolutePaths(buildInfo.options, toAbsolutePath) : {},
|
|
124022
|
+
semanticDiagnosticsPerFile: toPerFileSemanticDiagnostics(buildInfo.semanticDiagnosticsPerFile),
|
|
124023
|
+
emitDiagnosticsPerFile: toPerFileEmitDiagnostics(buildInfo.emitDiagnosticsPerFile),
|
|
124028
124024
|
hasReusableDiagnostic: true,
|
|
124029
124025
|
changedFilesSet,
|
|
124030
124026
|
latestChangedDtsFile,
|
|
124031
|
-
outSignature:
|
|
124032
|
-
programEmitPending:
|
|
124027
|
+
outSignature: buildInfo.outSignature,
|
|
124028
|
+
programEmitPending: buildInfo.pendingEmit === void 0 ? void 0 : toProgramEmitPending(buildInfo.pendingEmit, buildInfo.options)
|
|
124033
124029
|
};
|
|
124034
124030
|
} else {
|
|
124035
|
-
filePathsSetList = (_b =
|
|
124036
|
-
const emitSignatures = ((_c =
|
|
124037
|
-
|
|
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) => {
|
|
124038
124034
|
const path = toFilePath(index + 1);
|
|
124039
124035
|
const stateFileInfo = toBuilderStateFileInfoForMultiEmit(fileInfo);
|
|
124040
124036
|
fileInfos.set(path, stateFileInfo);
|
|
124041
124037
|
if (emitSignatures && stateFileInfo.signature) emitSignatures.set(path, stateFileInfo.signature);
|
|
124042
124038
|
});
|
|
124043
|
-
(_d =
|
|
124039
|
+
(_d = buildInfo.emitSignatures) == null ? void 0 : _d.forEach((value) => {
|
|
124044
124040
|
if (isNumber(value)) emitSignatures.delete(toFilePath(value));
|
|
124045
124041
|
else {
|
|
124046
124042
|
const key = toFilePath(value[0]);
|
|
@@ -124053,15 +124049,15 @@ function createBuilderProgramUsingProgramBuildInfo(buildInfo, buildInfoPath, hos
|
|
|
124053
124049
|
);
|
|
124054
124050
|
}
|
|
124055
124051
|
});
|
|
124056
|
-
const fullEmitForOptions =
|
|
124052
|
+
const fullEmitForOptions = buildInfo.affectedFilesPendingEmit ? getBuilderFileEmit(buildInfo.options || {}) : void 0;
|
|
124057
124053
|
state = {
|
|
124058
124054
|
fileInfos,
|
|
124059
|
-
compilerOptions:
|
|
124060
|
-
referencedMap: toManyToManyPathMap(
|
|
124061
|
-
semanticDiagnosticsPerFile: toPerFileSemanticDiagnostics(
|
|
124062
|
-
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),
|
|
124063
124059
|
hasReusableDiagnostic: true,
|
|
124064
|
-
affectedFilesPendingEmit:
|
|
124060
|
+
affectedFilesPendingEmit: buildInfo.affectedFilesPendingEmit && arrayToMap(buildInfo.affectedFilesPendingEmit, (value) => toFilePath(isNumber(value) ? value : value[0]), (value) => toBuilderFileEmit(value, fullEmitForOptions)),
|
|
124065
124061
|
changedFilesSet,
|
|
124066
124062
|
latestChangedDtsFile,
|
|
124067
124063
|
emitSignatures: (emitSignatures == null ? void 0 : emitSignatures.size) ? emitSignatures : void 0
|
|
@@ -125980,8 +125976,8 @@ function readBuilderProgram(compilerOptions, host) {
|
|
|
125980
125976
|
if (!content) return void 0;
|
|
125981
125977
|
buildInfo = getBuildInfo(buildInfoPath, content);
|
|
125982
125978
|
}
|
|
125983
|
-
if (!buildInfo || buildInfo.version !== version || !buildInfo
|
|
125984
|
-
return
|
|
125979
|
+
if (!buildInfo || buildInfo.version !== version || !isIncrementalBuildInfo(buildInfo)) return void 0;
|
|
125980
|
+
return createBuilderProgramUsingIncrementalBuildInfo(buildInfo, buildInfoPath, host);
|
|
125985
125981
|
}
|
|
125986
125982
|
function createIncrementalCompilerHost(options, system = sys) {
|
|
125987
125983
|
const host = createCompilerHostWorker(
|
|
@@ -127696,7 +127692,7 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
|
|
|
127696
127692
|
let oldestOutputFileName;
|
|
127697
127693
|
let oldestOutputFileTime = maximumDate;
|
|
127698
127694
|
let buildInfoTime;
|
|
127699
|
-
let
|
|
127695
|
+
let incrementalBuildInfo;
|
|
127700
127696
|
let buildInfoVersionMap;
|
|
127701
127697
|
if (buildInfoPath) {
|
|
127702
127698
|
const buildInfoCacheEntry2 = getBuildInfoCacheEntry(state, buildInfoPath, resolvedPath);
|
|
@@ -127721,26 +127717,26 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
|
|
|
127721
127717
|
fileName: buildInfoPath
|
|
127722
127718
|
};
|
|
127723
127719
|
}
|
|
127724
|
-
if (buildInfo
|
|
127720
|
+
if (isIncrementalBuildInfo(buildInfo) && buildInfo.version !== version) {
|
|
127725
127721
|
return {
|
|
127726
127722
|
type: 13 /* TsVersionOutputOfDate */,
|
|
127727
127723
|
version: buildInfo.version
|
|
127728
127724
|
};
|
|
127729
127725
|
}
|
|
127730
|
-
if (buildInfo
|
|
127731
|
-
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)) {
|
|
127732
127728
|
return {
|
|
127733
127729
|
type: 7 /* OutOfDateBuildInfo */,
|
|
127734
127730
|
buildInfoFile: buildInfoPath
|
|
127735
127731
|
};
|
|
127736
127732
|
}
|
|
127737
|
-
if (!project.options.noEmit && getPendingEmitKind(project.options, buildInfo.
|
|
127733
|
+
if (!project.options.noEmit && getPendingEmitKind(project.options, buildInfo.options || {})) {
|
|
127738
127734
|
return {
|
|
127739
127735
|
type: 8 /* OutOfDateOptions */,
|
|
127740
127736
|
buildInfoFile: buildInfoPath
|
|
127741
127737
|
};
|
|
127742
127738
|
}
|
|
127743
|
-
|
|
127739
|
+
incrementalBuildInfo = buildInfo;
|
|
127744
127740
|
}
|
|
127745
127741
|
oldestOutputFileTime = buildInfoTime;
|
|
127746
127742
|
oldestOutputFileName = buildInfoPath;
|
|
@@ -127757,12 +127753,12 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
|
|
|
127757
127753
|
reason: `${inputFile} does not exist`
|
|
127758
127754
|
};
|
|
127759
127755
|
}
|
|
127760
|
-
const inputPath =
|
|
127756
|
+
const inputPath = incrementalBuildInfo ? toPath2(state, inputFile) : void 0;
|
|
127761
127757
|
if (buildInfoTime && buildInfoTime < inputTime) {
|
|
127762
127758
|
let version2;
|
|
127763
127759
|
let currentVersion;
|
|
127764
|
-
if (
|
|
127765
|
-
if (!buildInfoVersionMap) buildInfoVersionMap = getBuildInfoFileVersionMap(
|
|
127760
|
+
if (incrementalBuildInfo) {
|
|
127761
|
+
if (!buildInfoVersionMap) buildInfoVersionMap = getBuildInfoFileVersionMap(incrementalBuildInfo, buildInfoPath, host);
|
|
127766
127762
|
const resolvedInputPath = buildInfoVersionMap.roots.get(inputPath);
|
|
127767
127763
|
version2 = buildInfoVersionMap.fileInfos.get(resolvedInputPath ?? inputPath);
|
|
127768
127764
|
const text = version2 ? state.readFileWithCache(resolvedInputPath ?? inputFile) : void 0;
|
|
@@ -127781,10 +127777,10 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
|
|
|
127781
127777
|
newestInputFileName = inputFile;
|
|
127782
127778
|
newestInputFileTime = inputTime;
|
|
127783
127779
|
}
|
|
127784
|
-
if (
|
|
127780
|
+
if (incrementalBuildInfo) seenRoots.add(inputPath);
|
|
127785
127781
|
}
|
|
127786
|
-
if (
|
|
127787
|
-
if (!buildInfoVersionMap) buildInfoVersionMap = getBuildInfoFileVersionMap(
|
|
127782
|
+
if (incrementalBuildInfo) {
|
|
127783
|
+
if (!buildInfoVersionMap) buildInfoVersionMap = getBuildInfoFileVersionMap(incrementalBuildInfo, buildInfoPath, host);
|
|
127788
127784
|
const existingRoot = forEachEntry(
|
|
127789
127785
|
buildInfoVersionMap.roots,
|
|
127790
127786
|
// File was root file when project was built but its not any more
|
|
@@ -127931,7 +127927,7 @@ function getLatestChangedDtsTime(state, options, resolvedConfigPath) {
|
|
|
127931
127927
|
if (!options.composite) return void 0;
|
|
127932
127928
|
const entry = Debug.checkDefined(state.buildInfoCache.get(resolvedConfigPath));
|
|
127933
127929
|
if (entry.latestChangedDtsTime !== void 0) return entry.latestChangedDtsTime || void 0;
|
|
127934
|
-
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;
|
|
127935
127931
|
entry.latestChangedDtsTime = latestChangedDtsTime || false;
|
|
127936
127932
|
return latestChangedDtsTime;
|
|
127937
127933
|
}
|
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,
|
|
@@ -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
|
}
|
|
@@ -128374,10 +128368,13 @@ function getBinderAndCheckerDiagnosticsOfFile(state, sourceFile, cancellationTok
|
|
|
128374
128368
|
semanticDiagnosticsPerFile.set(path, diagnostics);
|
|
128375
128369
|
return filterSemanticDiagnostics(diagnostics, state.compilerOptions);
|
|
128376
128370
|
}
|
|
128377
|
-
function
|
|
128371
|
+
function isIncrementalBundleEmitBuildInfo(info) {
|
|
128378
128372
|
var _a;
|
|
128379
128373
|
return !!((_a = info.options) == null ? void 0 : _a.outFile);
|
|
128380
128374
|
}
|
|
128375
|
+
function isIncrementalBuildInfo(info) {
|
|
128376
|
+
return !!info.fileNames;
|
|
128377
|
+
}
|
|
128381
128378
|
function getBuildInfo2(state) {
|
|
128382
128379
|
var _a, _b;
|
|
128383
128380
|
const currentDirectory = state.program.getCurrentDirectory();
|
|
@@ -128393,14 +128390,14 @@ function getBuildInfo2(state) {
|
|
|
128393
128390
|
tryAddRoot(key, fileId);
|
|
128394
128391
|
return value.impliedFormat ? { version: value.version, impliedFormat: value.impliedFormat, signature: void 0, affectsGlobalScope: void 0 } : value.version;
|
|
128395
128392
|
});
|
|
128396
|
-
|
|
128393
|
+
return {
|
|
128397
128394
|
fileNames,
|
|
128398
128395
|
fileInfos: fileInfos2,
|
|
128399
128396
|
root,
|
|
128400
128397
|
resolvedRoot: toResolvedRoot(),
|
|
128401
|
-
options:
|
|
128402
|
-
semanticDiagnosticsPerFile:
|
|
128403
|
-
emitDiagnosticsPerFile:
|
|
128398
|
+
options: toIncrementalBuildInfoCompilerOptions(state.compilerOptions),
|
|
128399
|
+
semanticDiagnosticsPerFile: toIncrementalBuildInfoDiagnostics(),
|
|
128400
|
+
emitDiagnosticsPerFile: toIncrementalBuildInfoEmitDiagnostics(),
|
|
128404
128401
|
changeFileSet: toChangeFileSet(),
|
|
128405
128402
|
outSignature: state.outSignature,
|
|
128406
128403
|
latestChangedDtsFile,
|
|
@@ -128410,10 +128407,10 @@ function getBuildInfo2(state) {
|
|
|
128410
128407
|
// Pending emit is same as deteremined by compilerOptions
|
|
128411
128408
|
state.programEmitPending
|
|
128412
128409
|
)
|
|
128413
|
-
)
|
|
128410
|
+
),
|
|
128414
128411
|
// Actual value
|
|
128412
|
+
version
|
|
128415
128413
|
};
|
|
128416
|
-
return createBuildInfo(program2);
|
|
128417
128414
|
}
|
|
128418
128415
|
let fileIdsList;
|
|
128419
128416
|
let fileNamesToFileIdListId;
|
|
@@ -128468,7 +128465,7 @@ function getBuildInfo2(state) {
|
|
|
128468
128465
|
toFileIdListId(state.referencedMap.getValues(key))
|
|
128469
128466
|
]);
|
|
128470
128467
|
}
|
|
128471
|
-
const semanticDiagnosticsPerFile =
|
|
128468
|
+
const semanticDiagnosticsPerFile = toIncrementalBuildInfoDiagnostics();
|
|
128472
128469
|
let affectedFilesPendingEmit;
|
|
128473
128470
|
if ((_b = state.affectedFilesPendingEmit) == null ? void 0 : _b.size) {
|
|
128474
128471
|
const fullEmitForOptions = getBuilderFileEmit(state.compilerOptions);
|
|
@@ -128492,22 +128489,22 @@ function getBuildInfo2(state) {
|
|
|
128492
128489
|
}
|
|
128493
128490
|
}
|
|
128494
128491
|
}
|
|
128495
|
-
|
|
128492
|
+
return {
|
|
128496
128493
|
fileNames,
|
|
128494
|
+
fileIdsList,
|
|
128497
128495
|
fileInfos,
|
|
128498
128496
|
root,
|
|
128499
128497
|
resolvedRoot: toResolvedRoot(),
|
|
128500
|
-
options:
|
|
128501
|
-
fileIdsList,
|
|
128498
|
+
options: toIncrementalBuildInfoCompilerOptions(state.compilerOptions),
|
|
128502
128499
|
referencedMap,
|
|
128503
128500
|
semanticDiagnosticsPerFile,
|
|
128504
|
-
emitDiagnosticsPerFile:
|
|
128501
|
+
emitDiagnosticsPerFile: toIncrementalBuildInfoEmitDiagnostics(),
|
|
128505
128502
|
affectedFilesPendingEmit,
|
|
128506
128503
|
changeFileSet: toChangeFileSet(),
|
|
128507
128504
|
emitSignatures,
|
|
128508
|
-
latestChangedDtsFile
|
|
128505
|
+
latestChangedDtsFile,
|
|
128506
|
+
version
|
|
128509
128507
|
};
|
|
128510
|
-
return createBuildInfo(program);
|
|
128511
128508
|
function relativeToBuildInfoEnsuringAbsolutePath(path) {
|
|
128512
128509
|
return relativeToBuildInfo(getNormalizedAbsolutePath(path, currentDirectory));
|
|
128513
128510
|
}
|
|
@@ -128555,13 +128552,13 @@ function getBuildInfo2(state) {
|
|
|
128555
128552
|
});
|
|
128556
128553
|
return result;
|
|
128557
128554
|
}
|
|
128558
|
-
function
|
|
128555
|
+
function toIncrementalBuildInfoCompilerOptions(options) {
|
|
128559
128556
|
let result;
|
|
128560
128557
|
const { optionsNameMap } = getOptionsNameMap();
|
|
128561
128558
|
for (const name of getOwnKeys(options).sort(compareStringsCaseSensitive)) {
|
|
128562
128559
|
const optionInfo = optionsNameMap.get(name.toLowerCase());
|
|
128563
128560
|
if (optionInfo == null ? void 0 : optionInfo.affectsBuildInfo) {
|
|
128564
|
-
(result || (result = {}))[name] =
|
|
128561
|
+
(result || (result = {}))[name] = toReusableCompilerOptionValue(
|
|
128565
128562
|
optionInfo,
|
|
128566
128563
|
options[name]
|
|
128567
128564
|
);
|
|
@@ -128569,7 +128566,7 @@ function getBuildInfo2(state) {
|
|
|
128569
128566
|
}
|
|
128570
128567
|
return result;
|
|
128571
128568
|
}
|
|
128572
|
-
function
|
|
128569
|
+
function toReusableCompilerOptionValue(option, value) {
|
|
128573
128570
|
if (option) {
|
|
128574
128571
|
Debug.assert(option.type !== "listOrElement");
|
|
128575
128572
|
if (option.type === "list") {
|
|
@@ -128583,7 +128580,7 @@ function getBuildInfo2(state) {
|
|
|
128583
128580
|
}
|
|
128584
128581
|
return value;
|
|
128585
128582
|
}
|
|
128586
|
-
function
|
|
128583
|
+
function toIncrementalBuildInfoDiagnostics() {
|
|
128587
128584
|
let result;
|
|
128588
128585
|
state.fileInfos.forEach((_value, key) => {
|
|
128589
128586
|
const value = state.semanticDiagnosticsPerFile.get(key);
|
|
@@ -128592,13 +128589,13 @@ function getBuildInfo2(state) {
|
|
|
128592
128589
|
} else if (value.length) {
|
|
128593
128590
|
result = append(result, [
|
|
128594
128591
|
toFileId(key),
|
|
128595
|
-
|
|
128592
|
+
toReusableDiagnostic(value, key)
|
|
128596
128593
|
]);
|
|
128597
128594
|
}
|
|
128598
128595
|
});
|
|
128599
128596
|
return result;
|
|
128600
128597
|
}
|
|
128601
|
-
function
|
|
128598
|
+
function toIncrementalBuildInfoEmitDiagnostics() {
|
|
128602
128599
|
var _a2;
|
|
128603
128600
|
let result;
|
|
128604
128601
|
if (!((_a2 = state.emitDiagnosticsPerFile) == null ? void 0 : _a2.size)) return result;
|
|
@@ -128606,51 +128603,51 @@ function getBuildInfo2(state) {
|
|
|
128606
128603
|
const value = state.emitDiagnosticsPerFile.get(key);
|
|
128607
128604
|
result = append(result, [
|
|
128608
128605
|
toFileId(key),
|
|
128609
|
-
|
|
128606
|
+
toReusableDiagnostic(value, key)
|
|
128610
128607
|
]);
|
|
128611
128608
|
}
|
|
128612
128609
|
return result;
|
|
128613
128610
|
}
|
|
128614
|
-
function
|
|
128611
|
+
function toReusableDiagnostic(diagnostics, diagnosticFilePath) {
|
|
128615
128612
|
Debug.assert(!!diagnostics.length);
|
|
128616
128613
|
return diagnostics.map((diagnostic) => {
|
|
128617
|
-
const result =
|
|
128614
|
+
const result = toReusableDiagnosticRelatedInformation(diagnostic, diagnosticFilePath);
|
|
128618
128615
|
result.reportsUnnecessary = diagnostic.reportsUnnecessary;
|
|
128619
128616
|
result.reportDeprecated = diagnostic.reportsDeprecated;
|
|
128620
128617
|
result.source = diagnostic.source;
|
|
128621
128618
|
result.skippedOn = diagnostic.skippedOn;
|
|
128622
128619
|
const { relatedInformation } = diagnostic;
|
|
128623
|
-
result.relatedInformation = relatedInformation ? relatedInformation.length ? relatedInformation.map((r) =>
|
|
128620
|
+
result.relatedInformation = relatedInformation ? relatedInformation.length ? relatedInformation.map((r) => toReusableDiagnosticRelatedInformation(r, diagnosticFilePath)) : [] : void 0;
|
|
128624
128621
|
return result;
|
|
128625
128622
|
});
|
|
128626
128623
|
}
|
|
128627
|
-
function
|
|
128624
|
+
function toReusableDiagnosticRelatedInformation(diagnostic, diagnosticFilePath) {
|
|
128628
128625
|
const { file } = diagnostic;
|
|
128629
128626
|
return {
|
|
128630
128627
|
...diagnostic,
|
|
128631
128628
|
file: file ? file.resolvedPath === diagnosticFilePath ? void 0 : relativeToBuildInfo(file.resolvedPath) : false,
|
|
128632
|
-
messageText: isString(diagnostic.messageText) ? diagnostic.messageText :
|
|
128629
|
+
messageText: isString(diagnostic.messageText) ? diagnostic.messageText : toReusableDiagnosticMessageChain(diagnostic.messageText)
|
|
128633
128630
|
};
|
|
128634
128631
|
}
|
|
128635
|
-
function
|
|
128632
|
+
function toReusableDiagnosticMessageChain(chain) {
|
|
128636
128633
|
if (chain.repopulateInfo) {
|
|
128637
128634
|
return {
|
|
128638
128635
|
info: chain.repopulateInfo(),
|
|
128639
|
-
next:
|
|
128636
|
+
next: toReusableDiagnosticMessageChainArray(chain.next)
|
|
128640
128637
|
};
|
|
128641
128638
|
}
|
|
128642
|
-
const next =
|
|
128639
|
+
const next = toReusableDiagnosticMessageChainArray(chain.next);
|
|
128643
128640
|
return next === chain.next ? chain : { ...chain, next };
|
|
128644
128641
|
}
|
|
128645
|
-
function
|
|
128642
|
+
function toReusableDiagnosticMessageChainArray(array) {
|
|
128646
128643
|
if (!array) return array;
|
|
128647
128644
|
return forEach(array, (chain, index) => {
|
|
128648
|
-
const reusable =
|
|
128645
|
+
const reusable = toReusableDiagnosticMessageChain(chain);
|
|
128649
128646
|
if (chain === reusable) return void 0;
|
|
128650
128647
|
const result = index > 0 ? array.slice(0, index - 1) : [];
|
|
128651
128648
|
result.push(reusable);
|
|
128652
128649
|
for (let i = index + 1; i < array.length; i++) {
|
|
128653
|
-
result.push(
|
|
128650
|
+
result.push(toReusableDiagnosticMessageChain(array[i]));
|
|
128654
128651
|
}
|
|
128655
128652
|
return result;
|
|
128656
128653
|
}) || array;
|
|
@@ -129047,43 +129044,42 @@ function toBuilderFileEmit(value, fullEmitForOptions) {
|
|
|
129047
129044
|
function toProgramEmitPending(value, options) {
|
|
129048
129045
|
return !value ? getBuilderFileEmit(options || {}) : value;
|
|
129049
129046
|
}
|
|
129050
|
-
function
|
|
129047
|
+
function createBuilderProgramUsingIncrementalBuildInfo(buildInfo, buildInfoPath, host) {
|
|
129051
129048
|
var _a, _b, _c, _d;
|
|
129052
|
-
const program = buildInfo.program;
|
|
129053
129049
|
const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory()));
|
|
129054
129050
|
const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames());
|
|
129055
129051
|
let state;
|
|
129056
|
-
const filePaths = (_a =
|
|
129052
|
+
const filePaths = (_a = buildInfo.fileNames) == null ? void 0 : _a.map(toPathInBuildInfoDirectory);
|
|
129057
129053
|
let filePathsSetList;
|
|
129058
|
-
const latestChangedDtsFile =
|
|
129054
|
+
const latestChangedDtsFile = buildInfo.latestChangedDtsFile ? toAbsolutePath(buildInfo.latestChangedDtsFile) : void 0;
|
|
129059
129055
|
const fileInfos = /* @__PURE__ */ new Map();
|
|
129060
|
-
const changedFilesSet = new Set(map(
|
|
129061
|
-
if (
|
|
129062
|
-
|
|
129056
|
+
const changedFilesSet = new Set(map(buildInfo.changeFileSet, toFilePath));
|
|
129057
|
+
if (isIncrementalBundleEmitBuildInfo(buildInfo)) {
|
|
129058
|
+
buildInfo.fileInfos.forEach((fileInfo, index) => {
|
|
129063
129059
|
const path = toFilePath(index + 1);
|
|
129064
129060
|
fileInfos.set(path, isString(fileInfo) ? { version: fileInfo, signature: void 0, affectsGlobalScope: void 0, impliedFormat: void 0 } : fileInfo);
|
|
129065
129061
|
});
|
|
129066
129062
|
state = {
|
|
129067
129063
|
fileInfos,
|
|
129068
|
-
compilerOptions:
|
|
129069
|
-
semanticDiagnosticsPerFile: toPerFileSemanticDiagnostics(
|
|
129070
|
-
emitDiagnosticsPerFile: toPerFileEmitDiagnostics(
|
|
129064
|
+
compilerOptions: buildInfo.options ? convertToOptionsWithAbsolutePaths(buildInfo.options, toAbsolutePath) : {},
|
|
129065
|
+
semanticDiagnosticsPerFile: toPerFileSemanticDiagnostics(buildInfo.semanticDiagnosticsPerFile),
|
|
129066
|
+
emitDiagnosticsPerFile: toPerFileEmitDiagnostics(buildInfo.emitDiagnosticsPerFile),
|
|
129071
129067
|
hasReusableDiagnostic: true,
|
|
129072
129068
|
changedFilesSet,
|
|
129073
129069
|
latestChangedDtsFile,
|
|
129074
|
-
outSignature:
|
|
129075
|
-
programEmitPending:
|
|
129070
|
+
outSignature: buildInfo.outSignature,
|
|
129071
|
+
programEmitPending: buildInfo.pendingEmit === void 0 ? void 0 : toProgramEmitPending(buildInfo.pendingEmit, buildInfo.options)
|
|
129076
129072
|
};
|
|
129077
129073
|
} else {
|
|
129078
|
-
filePathsSetList = (_b =
|
|
129079
|
-
const emitSignatures = ((_c =
|
|
129080
|
-
|
|
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) => {
|
|
129081
129077
|
const path = toFilePath(index + 1);
|
|
129082
129078
|
const stateFileInfo = toBuilderStateFileInfoForMultiEmit(fileInfo);
|
|
129083
129079
|
fileInfos.set(path, stateFileInfo);
|
|
129084
129080
|
if (emitSignatures && stateFileInfo.signature) emitSignatures.set(path, stateFileInfo.signature);
|
|
129085
129081
|
});
|
|
129086
|
-
(_d =
|
|
129082
|
+
(_d = buildInfo.emitSignatures) == null ? void 0 : _d.forEach((value) => {
|
|
129087
129083
|
if (isNumber(value)) emitSignatures.delete(toFilePath(value));
|
|
129088
129084
|
else {
|
|
129089
129085
|
const key = toFilePath(value[0]);
|
|
@@ -129096,15 +129092,15 @@ function createBuilderProgramUsingProgramBuildInfo(buildInfo, buildInfoPath, hos
|
|
|
129096
129092
|
);
|
|
129097
129093
|
}
|
|
129098
129094
|
});
|
|
129099
|
-
const fullEmitForOptions =
|
|
129095
|
+
const fullEmitForOptions = buildInfo.affectedFilesPendingEmit ? getBuilderFileEmit(buildInfo.options || {}) : void 0;
|
|
129100
129096
|
state = {
|
|
129101
129097
|
fileInfos,
|
|
129102
|
-
compilerOptions:
|
|
129103
|
-
referencedMap: toManyToManyPathMap(
|
|
129104
|
-
semanticDiagnosticsPerFile: toPerFileSemanticDiagnostics(
|
|
129105
|
-
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),
|
|
129106
129102
|
hasReusableDiagnostic: true,
|
|
129107
|
-
affectedFilesPendingEmit:
|
|
129103
|
+
affectedFilesPendingEmit: buildInfo.affectedFilesPendingEmit && arrayToMap(buildInfo.affectedFilesPendingEmit, (value) => toFilePath(isNumber(value) ? value : value[0]), (value) => toBuilderFileEmit(value, fullEmitForOptions)),
|
|
129108
129104
|
changedFilesSet,
|
|
129109
129105
|
latestChangedDtsFile,
|
|
129110
129106
|
emitSignatures: (emitSignatures == null ? void 0 : emitSignatures.size) ? emitSignatures : void 0
|
|
@@ -131053,8 +131049,8 @@ function readBuilderProgram(compilerOptions, host) {
|
|
|
131053
131049
|
if (!content) return void 0;
|
|
131054
131050
|
buildInfo = getBuildInfo(buildInfoPath, content);
|
|
131055
131051
|
}
|
|
131056
|
-
if (!buildInfo || buildInfo.version !== version || !buildInfo
|
|
131057
|
-
return
|
|
131052
|
+
if (!buildInfo || buildInfo.version !== version || !isIncrementalBuildInfo(buildInfo)) return void 0;
|
|
131053
|
+
return createBuilderProgramUsingIncrementalBuildInfo(buildInfo, buildInfoPath, host);
|
|
131058
131054
|
}
|
|
131059
131055
|
function createIncrementalCompilerHost(options, system = sys) {
|
|
131060
131056
|
const host = createCompilerHostWorker(
|
|
@@ -132819,7 +132815,7 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
|
|
|
132819
132815
|
let oldestOutputFileName;
|
|
132820
132816
|
let oldestOutputFileTime = maximumDate;
|
|
132821
132817
|
let buildInfoTime;
|
|
132822
|
-
let
|
|
132818
|
+
let incrementalBuildInfo;
|
|
132823
132819
|
let buildInfoVersionMap;
|
|
132824
132820
|
if (buildInfoPath) {
|
|
132825
132821
|
const buildInfoCacheEntry2 = getBuildInfoCacheEntry(state, buildInfoPath, resolvedPath);
|
|
@@ -132844,26 +132840,26 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
|
|
|
132844
132840
|
fileName: buildInfoPath
|
|
132845
132841
|
};
|
|
132846
132842
|
}
|
|
132847
|
-
if (buildInfo
|
|
132843
|
+
if (isIncrementalBuildInfo(buildInfo) && buildInfo.version !== version) {
|
|
132848
132844
|
return {
|
|
132849
132845
|
type: 13 /* TsVersionOutputOfDate */,
|
|
132850
132846
|
version: buildInfo.version
|
|
132851
132847
|
};
|
|
132852
132848
|
}
|
|
132853
|
-
if (buildInfo
|
|
132854
|
-
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)) {
|
|
132855
132851
|
return {
|
|
132856
132852
|
type: 7 /* OutOfDateBuildInfo */,
|
|
132857
132853
|
buildInfoFile: buildInfoPath
|
|
132858
132854
|
};
|
|
132859
132855
|
}
|
|
132860
|
-
if (!project.options.noEmit && getPendingEmitKind(project.options, buildInfo.
|
|
132856
|
+
if (!project.options.noEmit && getPendingEmitKind(project.options, buildInfo.options || {})) {
|
|
132861
132857
|
return {
|
|
132862
132858
|
type: 8 /* OutOfDateOptions */,
|
|
132863
132859
|
buildInfoFile: buildInfoPath
|
|
132864
132860
|
};
|
|
132865
132861
|
}
|
|
132866
|
-
|
|
132862
|
+
incrementalBuildInfo = buildInfo;
|
|
132867
132863
|
}
|
|
132868
132864
|
oldestOutputFileTime = buildInfoTime;
|
|
132869
132865
|
oldestOutputFileName = buildInfoPath;
|
|
@@ -132880,12 +132876,12 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
|
|
|
132880
132876
|
reason: `${inputFile} does not exist`
|
|
132881
132877
|
};
|
|
132882
132878
|
}
|
|
132883
|
-
const inputPath =
|
|
132879
|
+
const inputPath = incrementalBuildInfo ? toPath2(state, inputFile) : void 0;
|
|
132884
132880
|
if (buildInfoTime && buildInfoTime < inputTime) {
|
|
132885
132881
|
let version2;
|
|
132886
132882
|
let currentVersion;
|
|
132887
|
-
if (
|
|
132888
|
-
if (!buildInfoVersionMap) buildInfoVersionMap = getBuildInfoFileVersionMap(
|
|
132883
|
+
if (incrementalBuildInfo) {
|
|
132884
|
+
if (!buildInfoVersionMap) buildInfoVersionMap = getBuildInfoFileVersionMap(incrementalBuildInfo, buildInfoPath, host);
|
|
132889
132885
|
const resolvedInputPath = buildInfoVersionMap.roots.get(inputPath);
|
|
132890
132886
|
version2 = buildInfoVersionMap.fileInfos.get(resolvedInputPath ?? inputPath);
|
|
132891
132887
|
const text = version2 ? state.readFileWithCache(resolvedInputPath ?? inputFile) : void 0;
|
|
@@ -132904,10 +132900,10 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
|
|
|
132904
132900
|
newestInputFileName = inputFile;
|
|
132905
132901
|
newestInputFileTime = inputTime;
|
|
132906
132902
|
}
|
|
132907
|
-
if (
|
|
132903
|
+
if (incrementalBuildInfo) seenRoots.add(inputPath);
|
|
132908
132904
|
}
|
|
132909
|
-
if (
|
|
132910
|
-
if (!buildInfoVersionMap) buildInfoVersionMap = getBuildInfoFileVersionMap(
|
|
132905
|
+
if (incrementalBuildInfo) {
|
|
132906
|
+
if (!buildInfoVersionMap) buildInfoVersionMap = getBuildInfoFileVersionMap(incrementalBuildInfo, buildInfoPath, host);
|
|
132911
132907
|
const existingRoot = forEachEntry(
|
|
132912
132908
|
buildInfoVersionMap.roots,
|
|
132913
132909
|
// File was root file when project was built but its not any more
|
|
@@ -133054,7 +133050,7 @@ function getLatestChangedDtsTime(state, options, resolvedConfigPath) {
|
|
|
133054
133050
|
if (!options.composite) return void 0;
|
|
133055
133051
|
const entry = Debug.checkDefined(state.buildInfoCache.get(resolvedConfigPath));
|
|
133056
133052
|
if (entry.latestChangedDtsTime !== void 0) return entry.latestChangedDtsTime || void 0;
|
|
133057
|
-
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;
|
|
133058
133054
|
entry.latestChangedDtsTime = latestChangedDtsTime || false;
|
|
133059
133055
|
return latestChangedDtsTime;
|
|
133060
133056
|
}
|
|
@@ -178881,9 +178877,8 @@ __export(ts_exports2, {
|
|
|
178881
178877
|
createBaseNodeFactory: () => createBaseNodeFactory,
|
|
178882
178878
|
createBinaryExpressionTrampoline: () => createBinaryExpressionTrampoline,
|
|
178883
178879
|
createBindingHelper: () => createBindingHelper,
|
|
178884
|
-
createBuildInfo: () => createBuildInfo,
|
|
178885
178880
|
createBuilderProgram: () => createBuilderProgram,
|
|
178886
|
-
|
|
178881
|
+
createBuilderProgramUsingIncrementalBuildInfo: () => createBuilderProgramUsingIncrementalBuildInfo,
|
|
178887
178882
|
createBuilderStatusReporter: () => createBuilderStatusReporter,
|
|
178888
178883
|
createCacheWithRedirects: () => createCacheWithRedirects,
|
|
178889
178884
|
createCacheableExportInfoMap: () => createCacheableExportInfoMap,
|
|
@@ -179974,6 +179969,8 @@ __export(ts_exports2, {
|
|
|
179974
179969
|
isInTemplateString: () => isInTemplateString,
|
|
179975
179970
|
isInTopLevelContext: () => isInTopLevelContext,
|
|
179976
179971
|
isInTypeQuery: () => isInTypeQuery,
|
|
179972
|
+
isIncrementalBuildInfo: () => isIncrementalBuildInfo,
|
|
179973
|
+
isIncrementalBundleEmitBuildInfo: () => isIncrementalBundleEmitBuildInfo,
|
|
179977
179974
|
isIncrementalCompilation: () => isIncrementalCompilation,
|
|
179978
179975
|
isIndexSignatureDeclaration: () => isIndexSignatureDeclaration,
|
|
179979
179976
|
isIndexedAccessTypeNode: () => isIndexedAccessTypeNode,
|
|
@@ -180210,7 +180207,6 @@ __export(ts_exports2, {
|
|
|
180210
180207
|
isPrivateIdentifierClassElementDeclaration: () => isPrivateIdentifierClassElementDeclaration,
|
|
180211
180208
|
isPrivateIdentifierPropertyAccessExpression: () => isPrivateIdentifierPropertyAccessExpression,
|
|
180212
180209
|
isPrivateIdentifierSymbol: () => isPrivateIdentifierSymbol,
|
|
180213
|
-
isProgramBundleEmitBuildInfo: () => isProgramBundleEmitBuildInfo,
|
|
180214
180210
|
isProgramUptoDate: () => isProgramUptoDate,
|
|
180215
180211
|
isPrologueDirective: () => isPrologueDirective,
|
|
180216
180212
|
isPropertyAccessChain: () => isPropertyAccessChain,
|
|
@@ -193317,9 +193313,8 @@ if (typeof console !== "undefined") {
|
|
|
193317
193313
|
createBaseNodeFactory,
|
|
193318
193314
|
createBinaryExpressionTrampoline,
|
|
193319
193315
|
createBindingHelper,
|
|
193320
|
-
createBuildInfo,
|
|
193321
193316
|
createBuilderProgram,
|
|
193322
|
-
|
|
193317
|
+
createBuilderProgramUsingIncrementalBuildInfo,
|
|
193323
193318
|
createBuilderStatusReporter,
|
|
193324
193319
|
createCacheWithRedirects,
|
|
193325
193320
|
createCacheableExportInfoMap,
|
|
@@ -194410,6 +194405,8 @@ if (typeof console !== "undefined") {
|
|
|
194410
194405
|
isInTemplateString,
|
|
194411
194406
|
isInTopLevelContext,
|
|
194412
194407
|
isInTypeQuery,
|
|
194408
|
+
isIncrementalBuildInfo,
|
|
194409
|
+
isIncrementalBundleEmitBuildInfo,
|
|
194413
194410
|
isIncrementalCompilation,
|
|
194414
194411
|
isIndexSignatureDeclaration,
|
|
194415
194412
|
isIndexedAccessTypeNode,
|
|
@@ -194646,7 +194643,6 @@ if (typeof console !== "undefined") {
|
|
|
194646
194643
|
isPrivateIdentifierClassElementDeclaration,
|
|
194647
194644
|
isPrivateIdentifierPropertyAccessExpression,
|
|
194648
194645
|
isPrivateIdentifierSymbol,
|
|
194649
|
-
isProgramBundleEmitBuildInfo,
|
|
194650
194646
|
isProgramUptoDate,
|
|
194651
194647
|
isPrologueDirective,
|
|
194652
194648
|
isPropertyAccessChain,
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "typescript",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "5.6.0-dev.
|
|
5
|
+
"version": "5.6.0-dev.20240607",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -112,5 +112,5 @@
|
|
|
112
112
|
"node": "20.1.0",
|
|
113
113
|
"npm": "8.19.4"
|
|
114
114
|
},
|
|
115
|
-
"gitHead": "
|
|
115
|
+
"gitHead": "d8086f14b6b97c0df34a0cc2f56d4b5926a0c299"
|
|
116
116
|
}
|