typescript 5.6.0-dev.20240605 → 5.6.0-dev.20240606
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 +88 -45
- package/lib/typescript.js +113 -50
- 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.20240606`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -118218,7 +118218,7 @@ function isIgnoredFileFromWildCardWatching({
|
|
|
118218
118218
|
}
|
|
118219
118219
|
return false;
|
|
118220
118220
|
function hasSourceFile(file) {
|
|
118221
|
-
return realProgram ? !!realProgram.getSourceFileByPath(file) : builderProgram ? builderProgram.
|
|
118221
|
+
return realProgram ? !!realProgram.getSourceFileByPath(file) : builderProgram ? builderProgram.state.fileInfos.has(file) : !!find(program, (rootFile) => toPath3(rootFile) === file);
|
|
118222
118222
|
}
|
|
118223
118223
|
function isSupportedScriptKind() {
|
|
118224
118224
|
if (!getScriptKind) return false;
|
|
@@ -118239,9 +118239,6 @@ function isIgnoredFileFromWildCardWatching({
|
|
|
118239
118239
|
}
|
|
118240
118240
|
}
|
|
118241
118241
|
}
|
|
118242
|
-
function isBuilderProgram(program) {
|
|
118243
|
-
return !!program.getState;
|
|
118244
|
-
}
|
|
118245
118242
|
function isEmittedFileOfProgram(program, file) {
|
|
118246
118243
|
if (!program) {
|
|
118247
118244
|
return false;
|
|
@@ -122799,6 +122796,13 @@ var BuilderState;
|
|
|
122799
122796
|
})(BuilderState || (BuilderState = {}));
|
|
122800
122797
|
|
|
122801
122798
|
// src/compiler/builder.ts
|
|
122799
|
+
function isBuilderProgramStateWithDefinedProgram(state) {
|
|
122800
|
+
return state.program !== void 0;
|
|
122801
|
+
}
|
|
122802
|
+
function toBuilderProgramStateWithDefinedProgram(state) {
|
|
122803
|
+
Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
|
|
122804
|
+
return state;
|
|
122805
|
+
}
|
|
122802
122806
|
function getBuilderFileEmit(options) {
|
|
122803
122807
|
let result = 1 /* Js */;
|
|
122804
122808
|
if (options.sourceMap) result = result | 2 /* JsMap */;
|
|
@@ -123063,7 +123067,11 @@ function getNextAffectedFile(state, cancellationToken, host) {
|
|
|
123063
123067
|
const affectedFile = affectedFiles[affectedFilesIndex];
|
|
123064
123068
|
if (!seenAffectedFiles.has(affectedFile.resolvedPath)) {
|
|
123065
123069
|
state.affectedFilesIndex = affectedFilesIndex;
|
|
123066
|
-
addToAffectedFilesPendingEmit(
|
|
123070
|
+
addToAffectedFilesPendingEmit(
|
|
123071
|
+
state,
|
|
123072
|
+
affectedFile.resolvedPath,
|
|
123073
|
+
getBuilderFileEmit(state.compilerOptions)
|
|
123074
|
+
);
|
|
123067
123075
|
handleDtsMayChangeOfAffectedFile(
|
|
123068
123076
|
state,
|
|
123069
123077
|
affectedFile,
|
|
@@ -123083,12 +123091,11 @@ function getNextAffectedFile(state, cancellationToken, host) {
|
|
|
123083
123091
|
if (nextKey.done) {
|
|
123084
123092
|
return void 0;
|
|
123085
123093
|
}
|
|
123086
|
-
const
|
|
123087
|
-
|
|
123088
|
-
if (compilerOptions.outFile) return program;
|
|
123094
|
+
const compilerOptions = state.program.getCompilerOptions();
|
|
123095
|
+
if (compilerOptions.outFile) return state.program;
|
|
123089
123096
|
state.affectedFiles = BuilderState.getFilesAffectedByWithOldState(
|
|
123090
123097
|
state,
|
|
123091
|
-
program,
|
|
123098
|
+
state.program,
|
|
123092
123099
|
nextKey.value,
|
|
123093
123100
|
cancellationToken,
|
|
123094
123101
|
host
|
|
@@ -123149,9 +123156,8 @@ function getNextPendingEmitDiagnosticsFile(state) {
|
|
|
123149
123156
|
function removeDiagnosticsOfLibraryFiles(state) {
|
|
123150
123157
|
if (!state.cleanedDiagnosticsOfLibFiles) {
|
|
123151
123158
|
state.cleanedDiagnosticsOfLibFiles = true;
|
|
123152
|
-
const
|
|
123153
|
-
|
|
123154
|
-
forEach(program.getSourceFiles(), (f) => program.isSourceFileDefaultLibrary(f) && !skipTypeChecking(f, options, program) && removeSemanticDiagnosticsOf(state, f.resolvedPath));
|
|
123159
|
+
const options = state.program.getCompilerOptions();
|
|
123160
|
+
forEach(state.program.getSourceFiles(), (f) => state.program.isSourceFileDefaultLibrary(f) && !skipTypeChecking(f, options, state.program) && removeSemanticDiagnosticsOf(state, f.resolvedPath));
|
|
123155
123161
|
}
|
|
123156
123162
|
}
|
|
123157
123163
|
function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken, host) {
|
|
@@ -123160,7 +123166,7 @@ function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken
|
|
|
123160
123166
|
removeDiagnosticsOfLibraryFiles(state);
|
|
123161
123167
|
BuilderState.updateShapeSignature(
|
|
123162
123168
|
state,
|
|
123163
|
-
|
|
123169
|
+
state.program,
|
|
123164
123170
|
affectedFile,
|
|
123165
123171
|
cancellationToken,
|
|
123166
123172
|
host
|
|
@@ -123178,12 +123184,11 @@ function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken
|
|
|
123178
123184
|
function handleDtsMayChangeOf(state, path, invalidateJsFiles, cancellationToken, host) {
|
|
123179
123185
|
removeSemanticDiagnosticsOf(state, path);
|
|
123180
123186
|
if (!state.changedFilesSet.has(path)) {
|
|
123181
|
-
const
|
|
123182
|
-
const sourceFile = program.getSourceFileByPath(path);
|
|
123187
|
+
const sourceFile = state.program.getSourceFileByPath(path);
|
|
123183
123188
|
if (sourceFile) {
|
|
123184
123189
|
BuilderState.updateShapeSignature(
|
|
123185
123190
|
state,
|
|
123186
|
-
program,
|
|
123191
|
+
state.program,
|
|
123187
123192
|
sourceFile,
|
|
123188
123193
|
cancellationToken,
|
|
123189
123194
|
host,
|
|
@@ -123191,9 +123196,17 @@ function handleDtsMayChangeOf(state, path, invalidateJsFiles, cancellationToken,
|
|
|
123191
123196
|
true
|
|
123192
123197
|
);
|
|
123193
123198
|
if (invalidateJsFiles) {
|
|
123194
|
-
addToAffectedFilesPendingEmit(
|
|
123199
|
+
addToAffectedFilesPendingEmit(
|
|
123200
|
+
state,
|
|
123201
|
+
path,
|
|
123202
|
+
getBuilderFileEmit(state.compilerOptions)
|
|
123203
|
+
);
|
|
123195
123204
|
} else if (getEmitDeclarations(state.compilerOptions)) {
|
|
123196
|
-
addToAffectedFilesPendingEmit(
|
|
123205
|
+
addToAffectedFilesPendingEmit(
|
|
123206
|
+
state,
|
|
123207
|
+
path,
|
|
123208
|
+
state.compilerOptions.declarationMap ? 24 /* AllDts */ : 8 /* Dts */
|
|
123209
|
+
);
|
|
123197
123210
|
}
|
|
123198
123211
|
}
|
|
123199
123212
|
}
|
|
@@ -123260,7 +123273,7 @@ function handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile
|
|
|
123260
123273
|
host
|
|
123261
123274
|
);
|
|
123262
123275
|
if (isChangedSignature(state, currentPath)) {
|
|
123263
|
-
const currentSourceFile =
|
|
123276
|
+
const currentSourceFile = state.program.getSourceFileByPath(currentPath);
|
|
123264
123277
|
queue.push(...BuilderState.getReferencedByPaths(state, currentSourceFile.resolvedPath));
|
|
123265
123278
|
}
|
|
123266
123279
|
}
|
|
@@ -123309,7 +123322,7 @@ function handleDtsMayChangeOfFileAndExportsOfFile(state, filePath, invalidateJsF
|
|
|
123309
123322
|
function getSemanticDiagnosticsOfFile(state, sourceFile, cancellationToken, semanticDiagnosticsPerFile) {
|
|
123310
123323
|
return concatenate(
|
|
123311
123324
|
getBinderAndCheckerDiagnosticsOfFile(state, sourceFile, cancellationToken, semanticDiagnosticsPerFile),
|
|
123312
|
-
|
|
123325
|
+
state.program.getProgramDiagnostics(sourceFile)
|
|
123313
123326
|
);
|
|
123314
123327
|
}
|
|
123315
123328
|
function getBinderAndCheckerDiagnosticsOfFile(state, sourceFile, cancellationToken, semanticDiagnosticsPerFile) {
|
|
@@ -123319,7 +123332,7 @@ function getBinderAndCheckerDiagnosticsOfFile(state, sourceFile, cancellationTok
|
|
|
123319
123332
|
if (cachedDiagnostics) {
|
|
123320
123333
|
return filterSemanticDiagnostics(cachedDiagnostics, state.compilerOptions);
|
|
123321
123334
|
}
|
|
123322
|
-
const diagnostics =
|
|
123335
|
+
const diagnostics = state.program.getBindAndCheckDiagnostics(sourceFile, cancellationToken);
|
|
123323
123336
|
semanticDiagnosticsPerFile.set(path, diagnostics);
|
|
123324
123337
|
return filterSemanticDiagnostics(diagnostics, state.compilerOptions);
|
|
123325
123338
|
}
|
|
@@ -123329,7 +123342,7 @@ function isProgramBundleEmitBuildInfo(info) {
|
|
|
123329
123342
|
}
|
|
123330
123343
|
function getBuildInfo2(state) {
|
|
123331
123344
|
var _a, _b;
|
|
123332
|
-
const currentDirectory =
|
|
123345
|
+
const currentDirectory = state.program.getCurrentDirectory();
|
|
123333
123346
|
const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(getTsBuildInfoEmitOutputFilePath(state.compilerOptions), currentDirectory));
|
|
123334
123347
|
const latestChangedDtsFile = state.latestChangedDtsFile ? relativeToBuildInfoEnsuringAbsolutePath(state.latestChangedDtsFile) : void 0;
|
|
123335
123348
|
const fileNames = [];
|
|
@@ -123671,24 +123684,27 @@ function computeSignature(text, host, data) {
|
|
|
123671
123684
|
return (host.createHash ?? generateDjb2Hash)(getTextHandlingSourceMapForSignature(text, data));
|
|
123672
123685
|
}
|
|
123673
123686
|
function createBuilderProgram(kind, { newProgram, host, oldProgram, configFileParsingDiagnostics }) {
|
|
123674
|
-
let oldState = oldProgram && oldProgram.
|
|
123687
|
+
let oldState = oldProgram && oldProgram.state;
|
|
123675
123688
|
if (oldState && newProgram === oldState.program && configFileParsingDiagnostics === newProgram.getConfigFileParsingDiagnostics()) {
|
|
123676
123689
|
newProgram = void 0;
|
|
123677
123690
|
oldState = void 0;
|
|
123678
123691
|
return oldProgram;
|
|
123679
123692
|
}
|
|
123680
123693
|
const state = createBuilderProgramState(newProgram, oldState);
|
|
123681
|
-
newProgram.getBuildInfo = () => getBuildInfo2(state);
|
|
123694
|
+
newProgram.getBuildInfo = () => getBuildInfo2(toBuilderProgramStateWithDefinedProgram(state));
|
|
123682
123695
|
newProgram = void 0;
|
|
123683
123696
|
oldProgram = void 0;
|
|
123684
123697
|
oldState = void 0;
|
|
123685
|
-
const
|
|
123686
|
-
|
|
123687
|
-
builderProgram.getState = getState;
|
|
123698
|
+
const builderProgram = createRedirectedBuilderProgram(state, configFileParsingDiagnostics);
|
|
123699
|
+
builderProgram.state = state;
|
|
123688
123700
|
builderProgram.saveEmitState = () => backupBuilderProgramEmitState(state);
|
|
123689
123701
|
builderProgram.restoreEmitState = (saved) => restoreBuilderProgramEmitState(state, saved);
|
|
123690
123702
|
builderProgram.hasChangedEmitSignature = () => !!state.hasChangedEmitSignature;
|
|
123691
|
-
builderProgram.getAllDependencies = (sourceFile) => BuilderState.getAllDependencies(
|
|
123703
|
+
builderProgram.getAllDependencies = (sourceFile) => BuilderState.getAllDependencies(
|
|
123704
|
+
state,
|
|
123705
|
+
Debug.checkDefined(state.program),
|
|
123706
|
+
sourceFile
|
|
123707
|
+
);
|
|
123692
123708
|
builderProgram.getSemanticDiagnostics = getSemanticDiagnostics;
|
|
123693
123709
|
builderProgram.emit = emit;
|
|
123694
123710
|
builderProgram.releaseProgram = () => releaseCache(state);
|
|
@@ -123703,8 +123719,12 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
123703
123719
|
}
|
|
123704
123720
|
return builderProgram;
|
|
123705
123721
|
function emitBuildInfo(writeFile2, cancellationToken) {
|
|
123722
|
+
Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
|
|
123706
123723
|
if (state.buildInfoEmitPending) {
|
|
123707
|
-
const result =
|
|
123724
|
+
const result = state.program.emitBuildInfo(
|
|
123725
|
+
writeFile2 || maybeBind(host, host.writeFile),
|
|
123726
|
+
cancellationToken
|
|
123727
|
+
);
|
|
123708
123728
|
state.buildInfoEmitPending = false;
|
|
123709
123729
|
return result;
|
|
123710
123730
|
}
|
|
@@ -123712,6 +123732,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
123712
123732
|
}
|
|
123713
123733
|
function emitNextAffectedFile(writeFile2, cancellationToken, emitOnlyDtsFiles, customTransformers) {
|
|
123714
123734
|
var _a, _b, _c, _d;
|
|
123735
|
+
Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
|
|
123715
123736
|
let affected = getNextAffectedFile(state, cancellationToken, host);
|
|
123716
123737
|
const programEmitKind = getBuilderFileEmit(state.compilerOptions);
|
|
123717
123738
|
let emitKind = emitOnlyDtsFiles ? programEmitKind & 24 /* AllDts */ : programEmitKind;
|
|
@@ -123752,7 +123773,10 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
123752
123773
|
if (!affected) {
|
|
123753
123774
|
if (!state.buildInfoEmitPending) return void 0;
|
|
123754
123775
|
const affected2 = state.program;
|
|
123755
|
-
const result2 = affected2.emitBuildInfo(
|
|
123776
|
+
const result2 = affected2.emitBuildInfo(
|
|
123777
|
+
writeFile2 || maybeBind(host, host.writeFile),
|
|
123778
|
+
cancellationToken
|
|
123779
|
+
);
|
|
123756
123780
|
state.buildInfoEmitPending = false;
|
|
123757
123781
|
return { result: result2, affected: affected2 };
|
|
123758
123782
|
}
|
|
@@ -123800,6 +123824,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
123800
123824
|
return { result, affected };
|
|
123801
123825
|
}
|
|
123802
123826
|
function getWriteFileCallback(writeFile2, customTransformers) {
|
|
123827
|
+
Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
|
|
123803
123828
|
if (!getEmitDeclarations(state.compilerOptions)) return writeFile2 || maybeBind(host, host.writeFile);
|
|
123804
123829
|
return (fileName, text, writeByteOrderMark, onError, sourceFiles, data) => {
|
|
123805
123830
|
var _a, _b, _c;
|
|
@@ -123866,6 +123891,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
123866
123891
|
};
|
|
123867
123892
|
}
|
|
123868
123893
|
function emit(targetSourceFile, writeFile2, cancellationToken, emitOnlyDtsFiles, customTransformers) {
|
|
123894
|
+
Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
|
|
123869
123895
|
if (kind === 1 /* EmitAndSemanticDiagnosticsBuilderProgram */) {
|
|
123870
123896
|
assertSourceFileOkWithoutNextAffectedCall(state, targetSourceFile);
|
|
123871
123897
|
}
|
|
@@ -123878,7 +123904,12 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
123878
123904
|
let diagnostics;
|
|
123879
123905
|
let emittedFiles = [];
|
|
123880
123906
|
let affectedEmitResult;
|
|
123881
|
-
while (affectedEmitResult = emitNextAffectedFile(
|
|
123907
|
+
while (affectedEmitResult = emitNextAffectedFile(
|
|
123908
|
+
writeFile2,
|
|
123909
|
+
cancellationToken,
|
|
123910
|
+
emitOnlyDtsFiles,
|
|
123911
|
+
customTransformers
|
|
123912
|
+
)) {
|
|
123882
123913
|
emitSkipped = emitSkipped || affectedEmitResult.result.emitSkipped;
|
|
123883
123914
|
diagnostics = addRange(diagnostics, affectedEmitResult.result.diagnostics);
|
|
123884
123915
|
emittedFiles = addRange(emittedFiles, affectedEmitResult.result.emittedFiles);
|
|
@@ -123894,7 +123925,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
123894
123925
|
clearAffectedFilesPendingEmit(state, emitOnlyDtsFiles);
|
|
123895
123926
|
}
|
|
123896
123927
|
}
|
|
123897
|
-
return
|
|
123928
|
+
return state.program.emit(
|
|
123898
123929
|
targetSourceFile,
|
|
123899
123930
|
getWriteFileCallback(writeFile2, customTransformers),
|
|
123900
123931
|
cancellationToken,
|
|
@@ -123903,6 +123934,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
123903
123934
|
);
|
|
123904
123935
|
}
|
|
123905
123936
|
function getSemanticDiagnosticsOfNextAffectedFile(cancellationToken, ignoreSourceFile) {
|
|
123937
|
+
Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
|
|
123906
123938
|
while (true) {
|
|
123907
123939
|
const affected = getNextAffectedFile(state, cancellationToken, host);
|
|
123908
123940
|
let result;
|
|
@@ -123940,6 +123972,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
123940
123972
|
}
|
|
123941
123973
|
}
|
|
123942
123974
|
function getSemanticDiagnostics(sourceFile, cancellationToken) {
|
|
123975
|
+
Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
|
|
123943
123976
|
assertSourceFileOkWithoutNextAffectedCall(state, sourceFile);
|
|
123944
123977
|
if (sourceFile) {
|
|
123945
123978
|
return getSemanticDiagnosticsOfFile(state, sourceFile, cancellationToken);
|
|
@@ -123950,7 +123983,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
123950
123983
|
if (affectedResult.affected === state.program) return affectedResult.result;
|
|
123951
123984
|
}
|
|
123952
123985
|
let diagnostics;
|
|
123953
|
-
for (const sourceFile2 of
|
|
123986
|
+
for (const sourceFile2 of state.program.getSourceFiles()) {
|
|
123954
123987
|
diagnostics = addRange(diagnostics, getSemanticDiagnosticsOfFile(state, sourceFile2, cancellationToken));
|
|
123955
123988
|
}
|
|
123956
123989
|
return diagnostics || emptyArray;
|
|
@@ -124035,7 +124068,7 @@ function createBuilderProgramUsingProgramBuildInfo(buildInfo, buildInfoPath, hos
|
|
|
124035
124068
|
};
|
|
124036
124069
|
}
|
|
124037
124070
|
return {
|
|
124038
|
-
|
|
124071
|
+
state,
|
|
124039
124072
|
saveEmitState: noop,
|
|
124040
124073
|
restoreEmitState: noop,
|
|
124041
124074
|
getProgram: notImplemented,
|
|
@@ -124129,15 +124162,15 @@ function getBuildInfoFileVersionMap(program, buildInfoPath, host) {
|
|
|
124129
124162
|
}
|
|
124130
124163
|
}
|
|
124131
124164
|
}
|
|
124132
|
-
function createRedirectedBuilderProgram(
|
|
124165
|
+
function createRedirectedBuilderProgram(state, configFileParsingDiagnostics) {
|
|
124133
124166
|
return {
|
|
124134
|
-
|
|
124167
|
+
state: void 0,
|
|
124135
124168
|
saveEmitState: noop,
|
|
124136
124169
|
restoreEmitState: noop,
|
|
124137
124170
|
getProgram,
|
|
124138
|
-
getProgramOrUndefined: () =>
|
|
124139
|
-
releaseProgram: () =>
|
|
124140
|
-
getCompilerOptions: () =>
|
|
124171
|
+
getProgramOrUndefined: () => state.program,
|
|
124172
|
+
releaseProgram: () => state.program = void 0,
|
|
124173
|
+
getCompilerOptions: () => state.compilerOptions,
|
|
124141
124174
|
getSourceFile: (fileName) => getProgram().getSourceFile(fileName),
|
|
124142
124175
|
getSourceFiles: () => getProgram().getSourceFiles(),
|
|
124143
124176
|
getOptionsDiagnostics: (cancellationToken) => getProgram().getOptionsDiagnostics(cancellationToken),
|
|
@@ -124153,13 +124186,23 @@ function createRedirectedBuilderProgram(getState, configFileParsingDiagnostics)
|
|
|
124153
124186
|
close: noop
|
|
124154
124187
|
};
|
|
124155
124188
|
function getProgram() {
|
|
124156
|
-
return Debug.checkDefined(
|
|
124189
|
+
return Debug.checkDefined(state.program);
|
|
124157
124190
|
}
|
|
124158
124191
|
}
|
|
124159
124192
|
|
|
124160
124193
|
// src/compiler/builderPublic.ts
|
|
124161
124194
|
function createEmitAndSemanticDiagnosticsBuilderProgram(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences) {
|
|
124162
|
-
return createBuilderProgram(
|
|
124195
|
+
return createBuilderProgram(
|
|
124196
|
+
1 /* EmitAndSemanticDiagnosticsBuilderProgram */,
|
|
124197
|
+
getBuilderCreationParameters(
|
|
124198
|
+
newProgramOrRootNames,
|
|
124199
|
+
hostOrOptions,
|
|
124200
|
+
oldProgramOrHost,
|
|
124201
|
+
configFileParsingDiagnosticsOrOldProgram,
|
|
124202
|
+
configFileParsingDiagnostics,
|
|
124203
|
+
projectReferences
|
|
124204
|
+
)
|
|
124205
|
+
);
|
|
124163
124206
|
}
|
|
124164
124207
|
|
|
124165
124208
|
// src/compiler/resolutionCache.ts
|
|
@@ -125431,13 +125474,13 @@ function createTabularErrorsDisplay(filesInError, host) {
|
|
|
125431
125474
|
});
|
|
125432
125475
|
return tabularData;
|
|
125433
125476
|
}
|
|
125434
|
-
function
|
|
125435
|
-
return !!program.
|
|
125477
|
+
function isBuilderProgram(program) {
|
|
125478
|
+
return !!program.state;
|
|
125436
125479
|
}
|
|
125437
125480
|
function listFiles(program, write) {
|
|
125438
125481
|
const options = program.getCompilerOptions();
|
|
125439
125482
|
if (options.explainFiles) {
|
|
125440
|
-
explainFiles(
|
|
125483
|
+
explainFiles(isBuilderProgram(program) ? program.getProgram() : program, write);
|
|
125441
125484
|
} else if (options.listFiles || options.listFilesOnly) {
|
|
125442
125485
|
forEach(program.getSourceFiles(), (file) => {
|
|
125443
125486
|
write(file.fileName);
|
package/lib/typescript.js
CHANGED
|
@@ -1263,7 +1263,7 @@ __export(typescript_exports, {
|
|
|
1263
1263
|
isBreakStatement: () => isBreakStatement,
|
|
1264
1264
|
isBuild: () => isBuild,
|
|
1265
1265
|
isBuildInfoFile: () => isBuildInfoFile,
|
|
1266
|
-
isBuilderProgram: () =>
|
|
1266
|
+
isBuilderProgram: () => isBuilderProgram,
|
|
1267
1267
|
isBundle: () => isBundle,
|
|
1268
1268
|
isCallChain: () => isCallChain,
|
|
1269
1269
|
isCallExpression: () => isCallExpression,
|
|
@@ -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.20240606`;
|
|
2379
2379
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2380
2380
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2381
2381
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -123190,7 +123190,7 @@ function isIgnoredFileFromWildCardWatching({
|
|
|
123190
123190
|
}
|
|
123191
123191
|
return false;
|
|
123192
123192
|
function hasSourceFile(file) {
|
|
123193
|
-
return realProgram ? !!realProgram.getSourceFileByPath(file) : builderProgram ? builderProgram.
|
|
123193
|
+
return realProgram ? !!realProgram.getSourceFileByPath(file) : builderProgram ? builderProgram.state.fileInfos.has(file) : !!find(program, (rootFile) => toPath3(rootFile) === file);
|
|
123194
123194
|
}
|
|
123195
123195
|
function isSupportedScriptKind() {
|
|
123196
123196
|
if (!getScriptKind2) return false;
|
|
@@ -123211,9 +123211,6 @@ function isIgnoredFileFromWildCardWatching({
|
|
|
123211
123211
|
}
|
|
123212
123212
|
}
|
|
123213
123213
|
}
|
|
123214
|
-
function isBuilderProgram(program) {
|
|
123215
|
-
return !!program.getState;
|
|
123216
|
-
}
|
|
123217
123214
|
function isEmittedFileOfProgram(program, file) {
|
|
123218
123215
|
if (!program) {
|
|
123219
123216
|
return false;
|
|
@@ -127837,6 +127834,13 @@ var BuilderFileEmit = /* @__PURE__ */ ((BuilderFileEmit2) => {
|
|
|
127837
127834
|
BuilderFileEmit2[BuilderFileEmit2["All"] = 31] = "All";
|
|
127838
127835
|
return BuilderFileEmit2;
|
|
127839
127836
|
})(BuilderFileEmit || {});
|
|
127837
|
+
function isBuilderProgramStateWithDefinedProgram(state) {
|
|
127838
|
+
return state.program !== void 0;
|
|
127839
|
+
}
|
|
127840
|
+
function toBuilderProgramStateWithDefinedProgram(state) {
|
|
127841
|
+
Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
|
|
127842
|
+
return state;
|
|
127843
|
+
}
|
|
127840
127844
|
function getBuilderFileEmit(options) {
|
|
127841
127845
|
let result = 1 /* Js */;
|
|
127842
127846
|
if (options.sourceMap) result = result | 2 /* JsMap */;
|
|
@@ -128101,7 +128105,11 @@ function getNextAffectedFile(state, cancellationToken, host) {
|
|
|
128101
128105
|
const affectedFile = affectedFiles[affectedFilesIndex];
|
|
128102
128106
|
if (!seenAffectedFiles.has(affectedFile.resolvedPath)) {
|
|
128103
128107
|
state.affectedFilesIndex = affectedFilesIndex;
|
|
128104
|
-
addToAffectedFilesPendingEmit(
|
|
128108
|
+
addToAffectedFilesPendingEmit(
|
|
128109
|
+
state,
|
|
128110
|
+
affectedFile.resolvedPath,
|
|
128111
|
+
getBuilderFileEmit(state.compilerOptions)
|
|
128112
|
+
);
|
|
128105
128113
|
handleDtsMayChangeOfAffectedFile(
|
|
128106
128114
|
state,
|
|
128107
128115
|
affectedFile,
|
|
@@ -128121,12 +128129,11 @@ function getNextAffectedFile(state, cancellationToken, host) {
|
|
|
128121
128129
|
if (nextKey.done) {
|
|
128122
128130
|
return void 0;
|
|
128123
128131
|
}
|
|
128124
|
-
const
|
|
128125
|
-
|
|
128126
|
-
if (compilerOptions.outFile) return program;
|
|
128132
|
+
const compilerOptions = state.program.getCompilerOptions();
|
|
128133
|
+
if (compilerOptions.outFile) return state.program;
|
|
128127
128134
|
state.affectedFiles = BuilderState.getFilesAffectedByWithOldState(
|
|
128128
128135
|
state,
|
|
128129
|
-
program,
|
|
128136
|
+
state.program,
|
|
128130
128137
|
nextKey.value,
|
|
128131
128138
|
cancellationToken,
|
|
128132
128139
|
host
|
|
@@ -128187,9 +128194,8 @@ function getNextPendingEmitDiagnosticsFile(state) {
|
|
|
128187
128194
|
function removeDiagnosticsOfLibraryFiles(state) {
|
|
128188
128195
|
if (!state.cleanedDiagnosticsOfLibFiles) {
|
|
128189
128196
|
state.cleanedDiagnosticsOfLibFiles = true;
|
|
128190
|
-
const
|
|
128191
|
-
|
|
128192
|
-
forEach(program.getSourceFiles(), (f) => program.isSourceFileDefaultLibrary(f) && !skipTypeChecking(f, options, program) && removeSemanticDiagnosticsOf(state, f.resolvedPath));
|
|
128197
|
+
const options = state.program.getCompilerOptions();
|
|
128198
|
+
forEach(state.program.getSourceFiles(), (f) => state.program.isSourceFileDefaultLibrary(f) && !skipTypeChecking(f, options, state.program) && removeSemanticDiagnosticsOf(state, f.resolvedPath));
|
|
128193
128199
|
}
|
|
128194
128200
|
}
|
|
128195
128201
|
function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken, host) {
|
|
@@ -128198,7 +128204,7 @@ function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken
|
|
|
128198
128204
|
removeDiagnosticsOfLibraryFiles(state);
|
|
128199
128205
|
BuilderState.updateShapeSignature(
|
|
128200
128206
|
state,
|
|
128201
|
-
|
|
128207
|
+
state.program,
|
|
128202
128208
|
affectedFile,
|
|
128203
128209
|
cancellationToken,
|
|
128204
128210
|
host
|
|
@@ -128216,12 +128222,11 @@ function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken
|
|
|
128216
128222
|
function handleDtsMayChangeOf(state, path, invalidateJsFiles, cancellationToken, host) {
|
|
128217
128223
|
removeSemanticDiagnosticsOf(state, path);
|
|
128218
128224
|
if (!state.changedFilesSet.has(path)) {
|
|
128219
|
-
const
|
|
128220
|
-
const sourceFile = program.getSourceFileByPath(path);
|
|
128225
|
+
const sourceFile = state.program.getSourceFileByPath(path);
|
|
128221
128226
|
if (sourceFile) {
|
|
128222
128227
|
BuilderState.updateShapeSignature(
|
|
128223
128228
|
state,
|
|
128224
|
-
program,
|
|
128229
|
+
state.program,
|
|
128225
128230
|
sourceFile,
|
|
128226
128231
|
cancellationToken,
|
|
128227
128232
|
host,
|
|
@@ -128229,9 +128234,17 @@ function handleDtsMayChangeOf(state, path, invalidateJsFiles, cancellationToken,
|
|
|
128229
128234
|
true
|
|
128230
128235
|
);
|
|
128231
128236
|
if (invalidateJsFiles) {
|
|
128232
|
-
addToAffectedFilesPendingEmit(
|
|
128237
|
+
addToAffectedFilesPendingEmit(
|
|
128238
|
+
state,
|
|
128239
|
+
path,
|
|
128240
|
+
getBuilderFileEmit(state.compilerOptions)
|
|
128241
|
+
);
|
|
128233
128242
|
} else if (getEmitDeclarations(state.compilerOptions)) {
|
|
128234
|
-
addToAffectedFilesPendingEmit(
|
|
128243
|
+
addToAffectedFilesPendingEmit(
|
|
128244
|
+
state,
|
|
128245
|
+
path,
|
|
128246
|
+
state.compilerOptions.declarationMap ? 24 /* AllDts */ : 8 /* Dts */
|
|
128247
|
+
);
|
|
128235
128248
|
}
|
|
128236
128249
|
}
|
|
128237
128250
|
}
|
|
@@ -128298,7 +128311,7 @@ function handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile
|
|
|
128298
128311
|
host
|
|
128299
128312
|
);
|
|
128300
128313
|
if (isChangedSignature(state, currentPath)) {
|
|
128301
|
-
const currentSourceFile =
|
|
128314
|
+
const currentSourceFile = state.program.getSourceFileByPath(currentPath);
|
|
128302
128315
|
queue.push(...BuilderState.getReferencedByPaths(state, currentSourceFile.resolvedPath));
|
|
128303
128316
|
}
|
|
128304
128317
|
}
|
|
@@ -128347,7 +128360,7 @@ function handleDtsMayChangeOfFileAndExportsOfFile(state, filePath, invalidateJsF
|
|
|
128347
128360
|
function getSemanticDiagnosticsOfFile(state, sourceFile, cancellationToken, semanticDiagnosticsPerFile) {
|
|
128348
128361
|
return concatenate(
|
|
128349
128362
|
getBinderAndCheckerDiagnosticsOfFile(state, sourceFile, cancellationToken, semanticDiagnosticsPerFile),
|
|
128350
|
-
|
|
128363
|
+
state.program.getProgramDiagnostics(sourceFile)
|
|
128351
128364
|
);
|
|
128352
128365
|
}
|
|
128353
128366
|
function getBinderAndCheckerDiagnosticsOfFile(state, sourceFile, cancellationToken, semanticDiagnosticsPerFile) {
|
|
@@ -128357,7 +128370,7 @@ function getBinderAndCheckerDiagnosticsOfFile(state, sourceFile, cancellationTok
|
|
|
128357
128370
|
if (cachedDiagnostics) {
|
|
128358
128371
|
return filterSemanticDiagnostics(cachedDiagnostics, state.compilerOptions);
|
|
128359
128372
|
}
|
|
128360
|
-
const diagnostics =
|
|
128373
|
+
const diagnostics = state.program.getBindAndCheckDiagnostics(sourceFile, cancellationToken);
|
|
128361
128374
|
semanticDiagnosticsPerFile.set(path, diagnostics);
|
|
128362
128375
|
return filterSemanticDiagnostics(diagnostics, state.compilerOptions);
|
|
128363
128376
|
}
|
|
@@ -128367,7 +128380,7 @@ function isProgramBundleEmitBuildInfo(info) {
|
|
|
128367
128380
|
}
|
|
128368
128381
|
function getBuildInfo2(state) {
|
|
128369
128382
|
var _a, _b;
|
|
128370
|
-
const currentDirectory =
|
|
128383
|
+
const currentDirectory = state.program.getCurrentDirectory();
|
|
128371
128384
|
const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(getTsBuildInfoEmitOutputFilePath(state.compilerOptions), currentDirectory));
|
|
128372
128385
|
const latestChangedDtsFile = state.latestChangedDtsFile ? relativeToBuildInfoEnsuringAbsolutePath(state.latestChangedDtsFile) : void 0;
|
|
128373
128386
|
const fileNames = [];
|
|
@@ -128714,24 +128727,27 @@ function computeSignature(text, host, data) {
|
|
|
128714
128727
|
return (host.createHash ?? generateDjb2Hash)(getTextHandlingSourceMapForSignature(text, data));
|
|
128715
128728
|
}
|
|
128716
128729
|
function createBuilderProgram(kind, { newProgram, host, oldProgram, configFileParsingDiagnostics }) {
|
|
128717
|
-
let oldState = oldProgram && oldProgram.
|
|
128730
|
+
let oldState = oldProgram && oldProgram.state;
|
|
128718
128731
|
if (oldState && newProgram === oldState.program && configFileParsingDiagnostics === newProgram.getConfigFileParsingDiagnostics()) {
|
|
128719
128732
|
newProgram = void 0;
|
|
128720
128733
|
oldState = void 0;
|
|
128721
128734
|
return oldProgram;
|
|
128722
128735
|
}
|
|
128723
128736
|
const state = createBuilderProgramState(newProgram, oldState);
|
|
128724
|
-
newProgram.getBuildInfo = () => getBuildInfo2(state);
|
|
128737
|
+
newProgram.getBuildInfo = () => getBuildInfo2(toBuilderProgramStateWithDefinedProgram(state));
|
|
128725
128738
|
newProgram = void 0;
|
|
128726
128739
|
oldProgram = void 0;
|
|
128727
128740
|
oldState = void 0;
|
|
128728
|
-
const
|
|
128729
|
-
|
|
128730
|
-
builderProgram.getState = getState;
|
|
128741
|
+
const builderProgram = createRedirectedBuilderProgram(state, configFileParsingDiagnostics);
|
|
128742
|
+
builderProgram.state = state;
|
|
128731
128743
|
builderProgram.saveEmitState = () => backupBuilderProgramEmitState(state);
|
|
128732
128744
|
builderProgram.restoreEmitState = (saved) => restoreBuilderProgramEmitState(state, saved);
|
|
128733
128745
|
builderProgram.hasChangedEmitSignature = () => !!state.hasChangedEmitSignature;
|
|
128734
|
-
builderProgram.getAllDependencies = (sourceFile) => BuilderState.getAllDependencies(
|
|
128746
|
+
builderProgram.getAllDependencies = (sourceFile) => BuilderState.getAllDependencies(
|
|
128747
|
+
state,
|
|
128748
|
+
Debug.checkDefined(state.program),
|
|
128749
|
+
sourceFile
|
|
128750
|
+
);
|
|
128735
128751
|
builderProgram.getSemanticDiagnostics = getSemanticDiagnostics;
|
|
128736
128752
|
builderProgram.emit = emit;
|
|
128737
128753
|
builderProgram.releaseProgram = () => releaseCache(state);
|
|
@@ -128746,8 +128762,12 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
128746
128762
|
}
|
|
128747
128763
|
return builderProgram;
|
|
128748
128764
|
function emitBuildInfo(writeFile2, cancellationToken) {
|
|
128765
|
+
Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
|
|
128749
128766
|
if (state.buildInfoEmitPending) {
|
|
128750
|
-
const result =
|
|
128767
|
+
const result = state.program.emitBuildInfo(
|
|
128768
|
+
writeFile2 || maybeBind(host, host.writeFile),
|
|
128769
|
+
cancellationToken
|
|
128770
|
+
);
|
|
128751
128771
|
state.buildInfoEmitPending = false;
|
|
128752
128772
|
return result;
|
|
128753
128773
|
}
|
|
@@ -128755,6 +128775,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
128755
128775
|
}
|
|
128756
128776
|
function emitNextAffectedFile(writeFile2, cancellationToken, emitOnlyDtsFiles, customTransformers) {
|
|
128757
128777
|
var _a, _b, _c, _d;
|
|
128778
|
+
Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
|
|
128758
128779
|
let affected = getNextAffectedFile(state, cancellationToken, host);
|
|
128759
128780
|
const programEmitKind = getBuilderFileEmit(state.compilerOptions);
|
|
128760
128781
|
let emitKind = emitOnlyDtsFiles ? programEmitKind & 24 /* AllDts */ : programEmitKind;
|
|
@@ -128795,7 +128816,10 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
128795
128816
|
if (!affected) {
|
|
128796
128817
|
if (!state.buildInfoEmitPending) return void 0;
|
|
128797
128818
|
const affected2 = state.program;
|
|
128798
|
-
const result2 = affected2.emitBuildInfo(
|
|
128819
|
+
const result2 = affected2.emitBuildInfo(
|
|
128820
|
+
writeFile2 || maybeBind(host, host.writeFile),
|
|
128821
|
+
cancellationToken
|
|
128822
|
+
);
|
|
128799
128823
|
state.buildInfoEmitPending = false;
|
|
128800
128824
|
return { result: result2, affected: affected2 };
|
|
128801
128825
|
}
|
|
@@ -128843,6 +128867,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
128843
128867
|
return { result, affected };
|
|
128844
128868
|
}
|
|
128845
128869
|
function getWriteFileCallback(writeFile2, customTransformers) {
|
|
128870
|
+
Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
|
|
128846
128871
|
if (!getEmitDeclarations(state.compilerOptions)) return writeFile2 || maybeBind(host, host.writeFile);
|
|
128847
128872
|
return (fileName, text, writeByteOrderMark, onError, sourceFiles, data) => {
|
|
128848
128873
|
var _a, _b, _c;
|
|
@@ -128909,6 +128934,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
128909
128934
|
};
|
|
128910
128935
|
}
|
|
128911
128936
|
function emit(targetSourceFile, writeFile2, cancellationToken, emitOnlyDtsFiles, customTransformers) {
|
|
128937
|
+
Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
|
|
128912
128938
|
if (kind === 1 /* EmitAndSemanticDiagnosticsBuilderProgram */) {
|
|
128913
128939
|
assertSourceFileOkWithoutNextAffectedCall(state, targetSourceFile);
|
|
128914
128940
|
}
|
|
@@ -128921,7 +128947,12 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
128921
128947
|
let diagnostics;
|
|
128922
128948
|
let emittedFiles = [];
|
|
128923
128949
|
let affectedEmitResult;
|
|
128924
|
-
while (affectedEmitResult = emitNextAffectedFile(
|
|
128950
|
+
while (affectedEmitResult = emitNextAffectedFile(
|
|
128951
|
+
writeFile2,
|
|
128952
|
+
cancellationToken,
|
|
128953
|
+
emitOnlyDtsFiles,
|
|
128954
|
+
customTransformers
|
|
128955
|
+
)) {
|
|
128925
128956
|
emitSkipped = emitSkipped || affectedEmitResult.result.emitSkipped;
|
|
128926
128957
|
diagnostics = addRange(diagnostics, affectedEmitResult.result.diagnostics);
|
|
128927
128958
|
emittedFiles = addRange(emittedFiles, affectedEmitResult.result.emittedFiles);
|
|
@@ -128937,7 +128968,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
128937
128968
|
clearAffectedFilesPendingEmit(state, emitOnlyDtsFiles);
|
|
128938
128969
|
}
|
|
128939
128970
|
}
|
|
128940
|
-
return
|
|
128971
|
+
return state.program.emit(
|
|
128941
128972
|
targetSourceFile,
|
|
128942
128973
|
getWriteFileCallback(writeFile2, customTransformers),
|
|
128943
128974
|
cancellationToken,
|
|
@@ -128946,6 +128977,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
128946
128977
|
);
|
|
128947
128978
|
}
|
|
128948
128979
|
function getSemanticDiagnosticsOfNextAffectedFile(cancellationToken, ignoreSourceFile) {
|
|
128980
|
+
Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
|
|
128949
128981
|
while (true) {
|
|
128950
128982
|
const affected = getNextAffectedFile(state, cancellationToken, host);
|
|
128951
128983
|
let result;
|
|
@@ -128983,6 +129015,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
128983
129015
|
}
|
|
128984
129016
|
}
|
|
128985
129017
|
function getSemanticDiagnostics(sourceFile, cancellationToken) {
|
|
129018
|
+
Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
|
|
128986
129019
|
assertSourceFileOkWithoutNextAffectedCall(state, sourceFile);
|
|
128987
129020
|
if (sourceFile) {
|
|
128988
129021
|
return getSemanticDiagnosticsOfFile(state, sourceFile, cancellationToken);
|
|
@@ -128993,7 +129026,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
128993
129026
|
if (affectedResult.affected === state.program) return affectedResult.result;
|
|
128994
129027
|
}
|
|
128995
129028
|
let diagnostics;
|
|
128996
|
-
for (const sourceFile2 of
|
|
129029
|
+
for (const sourceFile2 of state.program.getSourceFiles()) {
|
|
128997
129030
|
diagnostics = addRange(diagnostics, getSemanticDiagnosticsOfFile(state, sourceFile2, cancellationToken));
|
|
128998
129031
|
}
|
|
128999
129032
|
return diagnostics || emptyArray;
|
|
@@ -129078,7 +129111,7 @@ function createBuilderProgramUsingProgramBuildInfo(buildInfo, buildInfoPath, hos
|
|
|
129078
129111
|
};
|
|
129079
129112
|
}
|
|
129080
129113
|
return {
|
|
129081
|
-
|
|
129114
|
+
state,
|
|
129082
129115
|
saveEmitState: noop,
|
|
129083
129116
|
restoreEmitState: noop,
|
|
129084
129117
|
getProgram: notImplemented,
|
|
@@ -129172,15 +129205,15 @@ function getBuildInfoFileVersionMap(program, buildInfoPath, host) {
|
|
|
129172
129205
|
}
|
|
129173
129206
|
}
|
|
129174
129207
|
}
|
|
129175
|
-
function createRedirectedBuilderProgram(
|
|
129208
|
+
function createRedirectedBuilderProgram(state, configFileParsingDiagnostics) {
|
|
129176
129209
|
return {
|
|
129177
|
-
|
|
129210
|
+
state: void 0,
|
|
129178
129211
|
saveEmitState: noop,
|
|
129179
129212
|
restoreEmitState: noop,
|
|
129180
129213
|
getProgram,
|
|
129181
|
-
getProgramOrUndefined: () =>
|
|
129182
|
-
releaseProgram: () =>
|
|
129183
|
-
getCompilerOptions: () =>
|
|
129214
|
+
getProgramOrUndefined: () => state.program,
|
|
129215
|
+
releaseProgram: () => state.program = void 0,
|
|
129216
|
+
getCompilerOptions: () => state.compilerOptions,
|
|
129184
129217
|
getSourceFile: (fileName) => getProgram().getSourceFile(fileName),
|
|
129185
129218
|
getSourceFiles: () => getProgram().getSourceFiles(),
|
|
129186
129219
|
getOptionsDiagnostics: (cancellationToken) => getProgram().getOptionsDiagnostics(cancellationToken),
|
|
@@ -129196,20 +129229,50 @@ function createRedirectedBuilderProgram(getState, configFileParsingDiagnostics)
|
|
|
129196
129229
|
close: noop
|
|
129197
129230
|
};
|
|
129198
129231
|
function getProgram() {
|
|
129199
|
-
return Debug.checkDefined(
|
|
129232
|
+
return Debug.checkDefined(state.program);
|
|
129200
129233
|
}
|
|
129201
129234
|
}
|
|
129202
129235
|
|
|
129203
129236
|
// src/compiler/builderPublic.ts
|
|
129204
129237
|
function createSemanticDiagnosticsBuilderProgram(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences) {
|
|
129205
|
-
return createBuilderProgram(
|
|
129238
|
+
return createBuilderProgram(
|
|
129239
|
+
0 /* SemanticDiagnosticsBuilderProgram */,
|
|
129240
|
+
getBuilderCreationParameters(
|
|
129241
|
+
newProgramOrRootNames,
|
|
129242
|
+
hostOrOptions,
|
|
129243
|
+
oldProgramOrHost,
|
|
129244
|
+
configFileParsingDiagnosticsOrOldProgram,
|
|
129245
|
+
configFileParsingDiagnostics,
|
|
129246
|
+
projectReferences
|
|
129247
|
+
)
|
|
129248
|
+
);
|
|
129206
129249
|
}
|
|
129207
129250
|
function createEmitAndSemanticDiagnosticsBuilderProgram(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences) {
|
|
129208
|
-
return createBuilderProgram(
|
|
129251
|
+
return createBuilderProgram(
|
|
129252
|
+
1 /* EmitAndSemanticDiagnosticsBuilderProgram */,
|
|
129253
|
+
getBuilderCreationParameters(
|
|
129254
|
+
newProgramOrRootNames,
|
|
129255
|
+
hostOrOptions,
|
|
129256
|
+
oldProgramOrHost,
|
|
129257
|
+
configFileParsingDiagnosticsOrOldProgram,
|
|
129258
|
+
configFileParsingDiagnostics,
|
|
129259
|
+
projectReferences
|
|
129260
|
+
)
|
|
129261
|
+
);
|
|
129209
129262
|
}
|
|
129210
129263
|
function createAbstractBuilder(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences) {
|
|
129211
|
-
const { newProgram, configFileParsingDiagnostics: newConfigFileParsingDiagnostics } = getBuilderCreationParameters(
|
|
129212
|
-
|
|
129264
|
+
const { newProgram, configFileParsingDiagnostics: newConfigFileParsingDiagnostics } = getBuilderCreationParameters(
|
|
129265
|
+
newProgramOrRootNames,
|
|
129266
|
+
hostOrOptions,
|
|
129267
|
+
oldProgramOrHost,
|
|
129268
|
+
configFileParsingDiagnosticsOrOldProgram,
|
|
129269
|
+
configFileParsingDiagnostics,
|
|
129270
|
+
projectReferences
|
|
129271
|
+
);
|
|
129272
|
+
return createRedirectedBuilderProgram(
|
|
129273
|
+
{ program: newProgram, compilerOptions: newProgram.getCompilerOptions() },
|
|
129274
|
+
newConfigFileParsingDiagnostics
|
|
129275
|
+
);
|
|
129213
129276
|
}
|
|
129214
129277
|
|
|
129215
129278
|
// src/compiler/resolutionCache.ts
|
|
@@ -130484,13 +130547,13 @@ function createTabularErrorsDisplay(filesInError, host) {
|
|
|
130484
130547
|
});
|
|
130485
130548
|
return tabularData;
|
|
130486
130549
|
}
|
|
130487
|
-
function
|
|
130488
|
-
return !!program.
|
|
130550
|
+
function isBuilderProgram(program) {
|
|
130551
|
+
return !!program.state;
|
|
130489
130552
|
}
|
|
130490
130553
|
function listFiles(program, write) {
|
|
130491
130554
|
const options = program.getCompilerOptions();
|
|
130492
130555
|
if (options.explainFiles) {
|
|
130493
|
-
explainFiles(
|
|
130556
|
+
explainFiles(isBuilderProgram(program) ? program.getProgram() : program, write);
|
|
130494
130557
|
} else if (options.listFiles || options.listFilesOnly) {
|
|
130495
130558
|
forEach(program.getSourceFiles(), (file) => {
|
|
130496
130559
|
write(file.fileName);
|
|
@@ -179704,7 +179767,7 @@ __export(ts_exports2, {
|
|
|
179704
179767
|
isBreakStatement: () => isBreakStatement,
|
|
179705
179768
|
isBuild: () => isBuild,
|
|
179706
179769
|
isBuildInfoFile: () => isBuildInfoFile,
|
|
179707
|
-
isBuilderProgram: () =>
|
|
179770
|
+
isBuilderProgram: () => isBuilderProgram,
|
|
179708
179771
|
isBundle: () => isBundle,
|
|
179709
179772
|
isCallChain: () => isCallChain,
|
|
179710
179773
|
isCallExpression: () => isCallExpression,
|
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.20240606",
|
|
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": "b9d96df61f01375da6504f37a31151cfdce0645c"
|
|
116
116
|
}
|