typescript 5.6.0-dev.20240614 → 5.6.0-dev.20240616
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 +107 -117
- package/lib/typescript.js +190 -151
- 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.20240616`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -7162,8 +7162,6 @@ var Diagnostics = {
|
|
|
7162
7162
|
Building_project_0: diag(6358, 3 /* Message */, "Building_project_0_6358", "Building project '{0}'..."),
|
|
7163
7163
|
Updating_output_timestamps_of_project_0: diag(6359, 3 /* Message */, "Updating_output_timestamps_of_project_0_6359", "Updating output timestamps of project '{0}'..."),
|
|
7164
7164
|
Project_0_is_up_to_date: diag(6361, 3 /* Message */, "Project_0_is_up_to_date_6361", "Project '{0}' is up to date"),
|
|
7165
|
-
Skipping_build_of_project_0_because_its_dependency_1_has_errors: diag(6362, 3 /* Message */, "Skipping_build_of_project_0_because_its_dependency_1_has_errors_6362", "Skipping build of project '{0}' because its dependency '{1}' has errors"),
|
|
7166
|
-
Project_0_can_t_be_built_because_its_dependency_1_has_errors: diag(6363, 3 /* Message */, "Project_0_can_t_be_built_because_its_dependency_1_has_errors_6363", "Project '{0}' can't be built because its dependency '{1}' has errors"),
|
|
7167
7165
|
Build_one_or_more_projects_and_their_dependencies_if_out_of_date: diag(6364, 3 /* Message */, "Build_one_or_more_projects_and_their_dependencies_if_out_of_date_6364", "Build one or more projects and their dependencies, if out of date"),
|
|
7168
7166
|
Delete_the_outputs_of_all_projects: diag(6365, 3 /* Message */, "Delete_the_outputs_of_all_projects_6365", "Delete the outputs of all projects."),
|
|
7169
7167
|
Show_what_would_be_built_or_deleted_if_specified_with_clean: diag(6367, 3 /* Message */, "Show_what_would_be_built_or_deleted_if_specified_with_clean_6367", "Show what would be built (or deleted, if specified with '--clean')"),
|
|
@@ -7175,8 +7173,6 @@ var Diagnostics = {
|
|
|
7175
7173
|
Composite_projects_may_not_disable_incremental_compilation: diag(6379, 1 /* Error */, "Composite_projects_may_not_disable_incremental_compilation_6379", "Composite projects may not disable incremental compilation."),
|
|
7176
7174
|
Specify_file_to_store_incremental_compilation_information: diag(6380, 3 /* Message */, "Specify_file_to_store_incremental_compilation_information_6380", "Specify file to store incremental compilation information"),
|
|
7177
7175
|
Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2: diag(6381, 3 /* Message */, "Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_curren_6381", "Project '{0}' is out of date because output for it was generated with version '{1}' that differs with current version '{2}'"),
|
|
7178
|
-
Skipping_build_of_project_0_because_its_dependency_1_was_not_built: diag(6382, 3 /* Message */, "Skipping_build_of_project_0_because_its_dependency_1_was_not_built_6382", "Skipping build of project '{0}' because its dependency '{1}' was not built"),
|
|
7179
|
-
Project_0_can_t_be_built_because_its_dependency_1_was_not_built: diag(6383, 3 /* Message */, "Project_0_can_t_be_built_because_its_dependency_1_was_not_built_6383", "Project '{0}' can't be built because its dependency '{1}' was not built"),
|
|
7180
7176
|
Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it: diag(6384, 3 /* Message */, "Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_di_6384", "Have recompiles in '--incremental' and '--watch' assume that changes within a file will only affect files directly depending on it."),
|
|
7181
7177
|
_0_is_deprecated: diag(
|
|
7182
7178
|
6385,
|
|
@@ -18296,7 +18292,25 @@ function rangeOfTypeParameters(sourceFile, typeParameters) {
|
|
|
18296
18292
|
return { pos, end };
|
|
18297
18293
|
}
|
|
18298
18294
|
function skipTypeChecking(sourceFile, options, host) {
|
|
18299
|
-
return
|
|
18295
|
+
return skipTypeCheckingWorker(
|
|
18296
|
+
sourceFile,
|
|
18297
|
+
options,
|
|
18298
|
+
host,
|
|
18299
|
+
/*ignoreNoCheck*/
|
|
18300
|
+
false
|
|
18301
|
+
);
|
|
18302
|
+
}
|
|
18303
|
+
function skipTypeCheckingIgnoringNoCheck(sourceFile, options, host) {
|
|
18304
|
+
return skipTypeCheckingWorker(
|
|
18305
|
+
sourceFile,
|
|
18306
|
+
options,
|
|
18307
|
+
host,
|
|
18308
|
+
/*ignoreNoCheck*/
|
|
18309
|
+
true
|
|
18310
|
+
);
|
|
18311
|
+
}
|
|
18312
|
+
function skipTypeCheckingWorker(sourceFile, options, host, ignoreNoCheck) {
|
|
18313
|
+
return options.skipLibCheck && sourceFile.isDeclarationFile || options.skipDefaultLibCheck && sourceFile.hasNoDefaultLib || !ignoreNoCheck && options.noCheck || host.isSourceOfProjectReferenceRedirect(sourceFile.fileName) || !canIncludeBindAndCheckDiagnostics(sourceFile, options);
|
|
18300
18314
|
}
|
|
18301
18315
|
function canIncludeBindAndCheckDiagnostics(sourceFile, options) {
|
|
18302
18316
|
if (!!sourceFile.checkJsDirective && sourceFile.checkJsDirective.enabled === false) return false;
|
|
@@ -35689,6 +35703,25 @@ var commonOptionsWithBuild = [
|
|
|
35689
35703
|
description: Diagnostics.Include_sourcemap_files_inside_the_emitted_JavaScript,
|
|
35690
35704
|
defaultValueDescription: false
|
|
35691
35705
|
},
|
|
35706
|
+
{
|
|
35707
|
+
name: "noCheck",
|
|
35708
|
+
type: "boolean",
|
|
35709
|
+
showInSimplifiedHelpView: false,
|
|
35710
|
+
category: Diagnostics.Compiler_Diagnostics,
|
|
35711
|
+
description: Diagnostics.Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported,
|
|
35712
|
+
transpileOptionValue: true,
|
|
35713
|
+
defaultValueDescription: false
|
|
35714
|
+
// Not setting affectsSemanticDiagnostics or affectsBuildInfo because we dont want all diagnostics to go away, its handled in builder
|
|
35715
|
+
},
|
|
35716
|
+
{
|
|
35717
|
+
name: "noEmit",
|
|
35718
|
+
type: "boolean",
|
|
35719
|
+
showInSimplifiedHelpView: true,
|
|
35720
|
+
category: Diagnostics.Emit,
|
|
35721
|
+
description: Diagnostics.Disable_emitting_files_from_a_compilation,
|
|
35722
|
+
transpileOptionValue: void 0,
|
|
35723
|
+
defaultValueDescription: false
|
|
35724
|
+
},
|
|
35692
35725
|
{
|
|
35693
35726
|
name: "assumeChangesOnlyAffectDirectDependencies",
|
|
35694
35727
|
type: "boolean",
|
|
@@ -35953,29 +35986,6 @@ var commandOptionsWithoutBuild = [
|
|
|
35953
35986
|
defaultValueDescription: false,
|
|
35954
35987
|
description: Diagnostics.Disable_emitting_comments
|
|
35955
35988
|
},
|
|
35956
|
-
{
|
|
35957
|
-
name: "noCheck",
|
|
35958
|
-
type: "boolean",
|
|
35959
|
-
showInSimplifiedHelpView: false,
|
|
35960
|
-
category: Diagnostics.Compiler_Diagnostics,
|
|
35961
|
-
description: Diagnostics.Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported,
|
|
35962
|
-
transpileOptionValue: true,
|
|
35963
|
-
defaultValueDescription: false,
|
|
35964
|
-
affectsSemanticDiagnostics: true,
|
|
35965
|
-
affectsBuildInfo: true,
|
|
35966
|
-
extraValidation() {
|
|
35967
|
-
return [Diagnostics.Unknown_compiler_option_0, "noCheck"];
|
|
35968
|
-
}
|
|
35969
|
-
},
|
|
35970
|
-
{
|
|
35971
|
-
name: "noEmit",
|
|
35972
|
-
type: "boolean",
|
|
35973
|
-
showInSimplifiedHelpView: true,
|
|
35974
|
-
category: Diagnostics.Emit,
|
|
35975
|
-
description: Diagnostics.Disable_emitting_files_from_a_compilation,
|
|
35976
|
-
transpileOptionValue: void 0,
|
|
35977
|
-
defaultValueDescription: false
|
|
35978
|
-
},
|
|
35979
35989
|
{
|
|
35980
35990
|
name: "importHelpers",
|
|
35981
35991
|
type: "boolean",
|
|
@@ -51718,7 +51728,7 @@ function createTypeChecker(host) {
|
|
|
51718
51728
|
}
|
|
51719
51729
|
if (isJSDocTypeLiteral(node)) {
|
|
51720
51730
|
return factory.createTypeLiteralNode(map(node.jsDocPropertyTags, (t) => {
|
|
51721
|
-
const name = isIdentifier(t.name) ? t.name : t.name.right;
|
|
51731
|
+
const name = visitNode(isIdentifier(t.name) ? t.name : t.name.right, visitExistingNodeTreeSymbols, isIdentifier);
|
|
51722
51732
|
const typeViaParent = getTypeOfPropertyOfType(getTypeFromTypeNode2(context, node), name.escapedText);
|
|
51723
51733
|
const overrideTypeNode = typeViaParent && t.typeExpression && getTypeFromTypeNode2(context, t.typeExpression.type) !== typeViaParent ? typeToTypeNodeHelper(typeViaParent, context) : void 0;
|
|
51724
51734
|
return factory.createPropertySignature(
|
|
@@ -51762,7 +51772,7 @@ function createTypeChecker(host) {
|
|
|
51762
51772
|
void 0,
|
|
51763
51773
|
getEffectiveDotDotDotForParameter(p),
|
|
51764
51774
|
setTextRange2(context, factory.createIdentifier(getNameForJSDocFunctionParameter(p, i)), p),
|
|
51765
|
-
p.questionToken,
|
|
51775
|
+
factory.cloneNode(p.questionToken),
|
|
51766
51776
|
visitNode(p.type, visitExistingNodeTreeSymbols, isTypeNode),
|
|
51767
51777
|
/*initializer*/
|
|
51768
51778
|
void 0
|
|
@@ -51777,7 +51787,7 @@ function createTypeChecker(host) {
|
|
|
51777
51787
|
void 0,
|
|
51778
51788
|
getEffectiveDotDotDotForParameter(p),
|
|
51779
51789
|
setTextRange2(context, factory.createIdentifier(getNameForJSDocFunctionParameter(p, i)), p),
|
|
51780
|
-
p.questionToken,
|
|
51790
|
+
factory.cloneNode(p.questionToken),
|
|
51781
51791
|
visitNode(p.type, visitExistingNodeTreeSymbols, isTypeNode),
|
|
51782
51792
|
/*initializer*/
|
|
51783
51793
|
void 0
|
|
@@ -51796,7 +51806,7 @@ function createTypeChecker(host) {
|
|
|
51796
51806
|
if (isTypeParameterDeclaration(node)) {
|
|
51797
51807
|
return factory.updateTypeParameterDeclaration(
|
|
51798
51808
|
node,
|
|
51799
|
-
node.modifiers,
|
|
51809
|
+
visitNodes2(node.modifiers, visitExistingNodeTreeSymbols, isModifier),
|
|
51800
51810
|
setTextRange2(context, typeParameterToName(getDeclaredTypeOfSymbol(getSymbolOfDeclaration(node)), context), node),
|
|
51801
51811
|
visitNode(node.constraint, visitExistingNodeTreeSymbols, isTypeNode),
|
|
51802
51812
|
visitNode(node.default, visitExistingNodeTreeSymbols, isTypeNode)
|
|
@@ -51828,8 +51838,8 @@ function createTypeChecker(host) {
|
|
|
51828
51838
|
return factory.updateImportTypeNode(
|
|
51829
51839
|
node,
|
|
51830
51840
|
factory.updateLiteralTypeNode(node.argument, rewriteModuleSpecifier(node, node.argument.literal)),
|
|
51831
|
-
node.attributes,
|
|
51832
|
-
node.qualifier,
|
|
51841
|
+
visitNode(node.attributes, visitExistingNodeTreeSymbols, isImportAttributes),
|
|
51842
|
+
visitNode(node.qualifier, visitExistingNodeTreeSymbols, isEntityName),
|
|
51833
51843
|
visitNodes2(node.typeArguments, visitExistingNodeTreeSymbols, isTypeNode),
|
|
51834
51844
|
node.isTypeOf
|
|
51835
51845
|
);
|
|
@@ -51903,9 +51913,9 @@ function createTypeChecker(host) {
|
|
|
51903
51913
|
hadError = hadError || introducesError;
|
|
51904
51914
|
parameterName = result;
|
|
51905
51915
|
} else {
|
|
51906
|
-
parameterName = node.parameterName;
|
|
51916
|
+
parameterName = factory.cloneNode(node.parameterName);
|
|
51907
51917
|
}
|
|
51908
|
-
return factory.updateTypePredicateNode(node, node.assertsModifier, parameterName, visitNode(node.type, visitExistingNodeTreeSymbols, isTypeNode));
|
|
51918
|
+
return factory.updateTypePredicateNode(node, factory.cloneNode(node.assertsModifier), parameterName, visitNode(node.type, visitExistingNodeTreeSymbols, isTypeNode));
|
|
51909
51919
|
}
|
|
51910
51920
|
if (isTupleTypeNode(node) || isTypeLiteralNode(node) || isMappedTypeNode(node)) {
|
|
51911
51921
|
const visited = visitEachChild2(node, visitExistingNodeTreeSymbols);
|
|
@@ -64641,7 +64651,7 @@ function createTypeChecker(host) {
|
|
|
64641
64651
|
const sourceArity = getTypeReferenceArity(source2);
|
|
64642
64652
|
const targetArity = getTypeReferenceArity(target2);
|
|
64643
64653
|
const sourceRestFlag = isTupleType(source2) ? source2.target.combinedFlags & 4 /* Rest */ : 4 /* Rest */;
|
|
64644
|
-
const
|
|
64654
|
+
const targetHasRestElement = !!(target2.target.combinedFlags & 12 /* Variable */);
|
|
64645
64655
|
const sourceMinLength = isTupleType(source2) ? source2.target.minLength : 0;
|
|
64646
64656
|
const targetMinLength = target2.target.minLength;
|
|
64647
64657
|
if (!sourceRestFlag && sourceArity < targetMinLength) {
|
|
@@ -64650,13 +64660,13 @@ function createTypeChecker(host) {
|
|
|
64650
64660
|
}
|
|
64651
64661
|
return 0 /* False */;
|
|
64652
64662
|
}
|
|
64653
|
-
if (!
|
|
64663
|
+
if (!targetHasRestElement && targetArity < sourceMinLength) {
|
|
64654
64664
|
if (reportErrors2) {
|
|
64655
64665
|
reportError(Diagnostics.Source_has_0_element_s_but_target_allows_only_1, sourceMinLength, targetArity);
|
|
64656
64666
|
}
|
|
64657
64667
|
return 0 /* False */;
|
|
64658
64668
|
}
|
|
64659
|
-
if (!
|
|
64669
|
+
if (!targetHasRestElement && (sourceRestFlag || targetArity < sourceArity)) {
|
|
64660
64670
|
if (reportErrors2) {
|
|
64661
64671
|
if (sourceMinLength < targetMinLength) {
|
|
64662
64672
|
reportError(Diagnostics.Target_requires_0_element_s_but_source_may_have_fewer, targetMinLength);
|
|
@@ -64670,7 +64680,6 @@ function createTypeChecker(host) {
|
|
|
64670
64680
|
const targetTypeArguments = getTypeArguments(target2);
|
|
64671
64681
|
const targetStartCount = getStartElementCount(target2.target, 11 /* NonRest */);
|
|
64672
64682
|
const targetEndCount = getEndElementCount(target2.target, 11 /* NonRest */);
|
|
64673
|
-
const targetHasRestElement = target2.target.hasRestElement;
|
|
64674
64683
|
let canExcludeDiscriminants = !!excludedProperties;
|
|
64675
64684
|
for (let sourcePosition = 0; sourcePosition < sourceArity; sourcePosition++) {
|
|
64676
64685
|
const sourceFlags = isTupleType(source2) ? source2.target.elementFlags[sourcePosition] : 4 /* Rest */;
|
|
@@ -65910,6 +65919,7 @@ function createTypeChecker(host) {
|
|
|
65910
65919
|
return type;
|
|
65911
65920
|
}
|
|
65912
65921
|
function reportWideningErrorsInType(type) {
|
|
65922
|
+
var _a;
|
|
65913
65923
|
let errorReported = false;
|
|
65914
65924
|
if (getObjectFlags(type) & 65536 /* ContainsWideningType */) {
|
|
65915
65925
|
if (type.flags & 1048576 /* Union */) {
|
|
@@ -65917,27 +65927,28 @@ function createTypeChecker(host) {
|
|
|
65917
65927
|
errorReported = true;
|
|
65918
65928
|
} else {
|
|
65919
65929
|
for (const t of type.types) {
|
|
65920
|
-
|
|
65921
|
-
errorReported = true;
|
|
65922
|
-
}
|
|
65930
|
+
errorReported || (errorReported = reportWideningErrorsInType(t));
|
|
65923
65931
|
}
|
|
65924
65932
|
}
|
|
65925
|
-
}
|
|
65926
|
-
if (isArrayOrTupleType(type)) {
|
|
65933
|
+
} else if (isArrayOrTupleType(type)) {
|
|
65927
65934
|
for (const t of getTypeArguments(type)) {
|
|
65928
|
-
|
|
65929
|
-
errorReported = true;
|
|
65930
|
-
}
|
|
65935
|
+
errorReported || (errorReported = reportWideningErrorsInType(t));
|
|
65931
65936
|
}
|
|
65932
|
-
}
|
|
65933
|
-
if (isObjectLiteralType(type)) {
|
|
65937
|
+
} else if (isObjectLiteralType(type)) {
|
|
65934
65938
|
for (const p of getPropertiesOfObjectType(type)) {
|
|
65935
65939
|
const t = getTypeOfSymbol(p);
|
|
65936
65940
|
if (getObjectFlags(t) & 65536 /* ContainsWideningType */) {
|
|
65937
|
-
|
|
65938
|
-
|
|
65941
|
+
errorReported = reportWideningErrorsInType(t);
|
|
65942
|
+
if (!errorReported) {
|
|
65943
|
+
const valueDeclaration = (_a = p.declarations) == null ? void 0 : _a.find((d) => {
|
|
65944
|
+
var _a2;
|
|
65945
|
+
return ((_a2 = d.symbol.valueDeclaration) == null ? void 0 : _a2.parent) === type.symbol.valueDeclaration;
|
|
65946
|
+
});
|
|
65947
|
+
if (valueDeclaration) {
|
|
65948
|
+
error(valueDeclaration, Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, symbolToString(p), typeToString(getWidenedType(t)));
|
|
65949
|
+
errorReported = true;
|
|
65950
|
+
}
|
|
65939
65951
|
}
|
|
65940
|
-
errorReported = true;
|
|
65941
65952
|
}
|
|
65942
65953
|
}
|
|
65943
65954
|
}
|
|
@@ -122804,6 +122815,7 @@ function createBuilderProgramState(newProgram, oldState) {
|
|
|
122804
122815
|
}
|
|
122805
122816
|
state.changedFilesSet = /* @__PURE__ */ new Set();
|
|
122806
122817
|
state.latestChangedDtsFile = compilerOptions.composite ? oldState == null ? void 0 : oldState.latestChangedDtsFile : void 0;
|
|
122818
|
+
state.checkPending = state.compilerOptions.noCheck ? true : void 0;
|
|
122807
122819
|
const useOldState = BuilderState.canReuseOldState(state.referencedMap, oldState);
|
|
122808
122820
|
const oldCompilerOptions = useOldState ? oldState.compilerOptions : void 0;
|
|
122809
122821
|
let canCopySemanticDiagnostics = useOldState && !compilerOptionsAffectSemanticDiagnostics(compilerOptions, oldCompilerOptions);
|
|
@@ -122901,6 +122913,7 @@ function createBuilderProgramState(newProgram, oldState) {
|
|
|
122901
122913
|
state.buildInfoEmitPending = true;
|
|
122902
122914
|
}
|
|
122903
122915
|
}
|
|
122916
|
+
if (useOldState && state.semanticDiagnosticsPerFile.size !== state.fileInfos.size && oldState.checkPending !== state.checkPending) state.buildInfoEmitPending = true;
|
|
122904
122917
|
return state;
|
|
122905
122918
|
function addFileToChangeSet(path) {
|
|
122906
122919
|
state.changedFilesSet.add(path);
|
|
@@ -123084,7 +123097,7 @@ function removeDiagnosticsOfLibraryFiles(state) {
|
|
|
123084
123097
|
if (!state.cleanedDiagnosticsOfLibFiles) {
|
|
123085
123098
|
state.cleanedDiagnosticsOfLibFiles = true;
|
|
123086
123099
|
const options = state.program.getCompilerOptions();
|
|
123087
|
-
forEach(state.program.getSourceFiles(), (f) => state.program.isSourceFileDefaultLibrary(f) && !
|
|
123100
|
+
forEach(state.program.getSourceFiles(), (f) => state.program.isSourceFileDefaultLibrary(f) && !skipTypeCheckingIgnoringNoCheck(f, options, state.program) && removeSemanticDiagnosticsOf(state, f.resolvedPath));
|
|
123088
123101
|
}
|
|
123089
123102
|
}
|
|
123090
123103
|
function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken, host) {
|
|
@@ -123247,6 +123260,7 @@ function handleDtsMayChangeOfFileAndExportsOfFile(state, filePath, invalidateJsF
|
|
|
123247
123260
|
return void 0;
|
|
123248
123261
|
}
|
|
123249
123262
|
function getSemanticDiagnosticsOfFile(state, sourceFile, cancellationToken, semanticDiagnosticsPerFile) {
|
|
123263
|
+
if (state.compilerOptions.noCheck) return emptyArray;
|
|
123250
123264
|
return concatenate(
|
|
123251
123265
|
getBinderAndCheckerDiagnosticsOfFile(state, sourceFile, cancellationToken, semanticDiagnosticsPerFile),
|
|
123252
123266
|
state.program.getProgramDiagnostics(sourceFile)
|
|
@@ -123313,6 +123327,7 @@ function getBuildInfo2(state) {
|
|
|
123313
123327
|
const buildInfo2 = {
|
|
123314
123328
|
root: arrayFrom(rootFileNames, (r) => relativeToBuildInfo(r)),
|
|
123315
123329
|
errors: state.hasErrors ? true : void 0,
|
|
123330
|
+
checkPending: state.checkPending,
|
|
123316
123331
|
version
|
|
123317
123332
|
};
|
|
123318
123333
|
return buildInfo2;
|
|
@@ -123343,6 +123358,7 @@ function getBuildInfo2(state) {
|
|
|
123343
123358
|
),
|
|
123344
123359
|
// Actual value
|
|
123345
123360
|
errors: state.hasErrors ? true : void 0,
|
|
123361
|
+
checkPending: state.checkPending,
|
|
123346
123362
|
version
|
|
123347
123363
|
};
|
|
123348
123364
|
return buildInfo2;
|
|
@@ -123438,6 +123454,7 @@ function getBuildInfo2(state) {
|
|
|
123438
123454
|
emitSignatures,
|
|
123439
123455
|
latestChangedDtsFile,
|
|
123440
123456
|
errors: state.hasErrors ? true : void 0,
|
|
123457
|
+
checkPending: state.checkPending,
|
|
123441
123458
|
version
|
|
123442
123459
|
};
|
|
123443
123460
|
return buildInfo;
|
|
@@ -123898,8 +123915,13 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
123898
123915
|
while (true) {
|
|
123899
123916
|
const affected = getNextAffectedFile(state, cancellationToken, host);
|
|
123900
123917
|
let result;
|
|
123901
|
-
if (!affected)
|
|
123902
|
-
|
|
123918
|
+
if (!affected) {
|
|
123919
|
+
if (state.checkPending && !state.compilerOptions.noCheck) {
|
|
123920
|
+
state.checkPending = void 0;
|
|
123921
|
+
state.buildInfoEmitPending = true;
|
|
123922
|
+
}
|
|
123923
|
+
return void 0;
|
|
123924
|
+
} else if (affected !== state.program) {
|
|
123903
123925
|
const affectedSourceFile = affected;
|
|
123904
123926
|
if (!ignoreSourceFile || !ignoreSourceFile(affectedSourceFile)) {
|
|
123905
123927
|
result = getSemanticDiagnosticsOfFile(state, affectedSourceFile, cancellationToken);
|
|
@@ -123926,6 +123948,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
123926
123948
|
result = diagnostics || emptyArray;
|
|
123927
123949
|
state.changedFilesSet.clear();
|
|
123928
123950
|
state.programEmitPending = getBuilderFileEmit(state.compilerOptions);
|
|
123951
|
+
if (!state.compilerOptions.noCheck) state.checkPending = void 0;
|
|
123929
123952
|
state.buildInfoEmitPending = true;
|
|
123930
123953
|
}
|
|
123931
123954
|
return { result, affected };
|
|
@@ -123946,6 +123969,10 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
123946
123969
|
for (const sourceFile2 of state.program.getSourceFiles()) {
|
|
123947
123970
|
diagnostics = addRange(diagnostics, getSemanticDiagnosticsOfFile(state, sourceFile2, cancellationToken));
|
|
123948
123971
|
}
|
|
123972
|
+
if (state.checkPending && !state.compilerOptions.noCheck) {
|
|
123973
|
+
state.checkPending = void 0;
|
|
123974
|
+
state.buildInfoEmitPending = true;
|
|
123975
|
+
}
|
|
123949
123976
|
return diagnostics || emptyArray;
|
|
123950
123977
|
}
|
|
123951
123978
|
}
|
|
@@ -123987,7 +124014,8 @@ function createBuilderProgramUsingIncrementalBuildInfo(buildInfo, buildInfoPath,
|
|
|
123987
124014
|
latestChangedDtsFile,
|
|
123988
124015
|
outSignature: buildInfo.outSignature,
|
|
123989
124016
|
programEmitPending: buildInfo.pendingEmit === void 0 ? void 0 : toProgramEmitPending(buildInfo.pendingEmit, buildInfo.options),
|
|
123990
|
-
hasErrors: buildInfo.errors
|
|
124017
|
+
hasErrors: buildInfo.errors,
|
|
124018
|
+
checkPending: buildInfo.checkPending
|
|
123991
124019
|
};
|
|
123992
124020
|
} else {
|
|
123993
124021
|
filePathsSetList = (_b = buildInfo.fileIdsList) == null ? void 0 : _b.map((fileIds) => new Set(fileIds.map(toFilePath)));
|
|
@@ -124022,7 +124050,8 @@ function createBuilderProgramUsingIncrementalBuildInfo(buildInfo, buildInfoPath,
|
|
|
124022
124050
|
affectedFilesPendingEmit: buildInfo.affectedFilesPendingEmit && arrayToMap(buildInfo.affectedFilesPendingEmit, (value) => toFilePath(isNumber(value) ? value : value[0]), (value) => toBuilderFileEmit(value, fullEmitForOptions)),
|
|
124023
124051
|
latestChangedDtsFile,
|
|
124024
124052
|
emitSignatures: (emitSignatures == null ? void 0 : emitSignatures.size) ? emitSignatures : void 0,
|
|
124025
|
-
hasErrors: buildInfo.errors
|
|
124053
|
+
hasErrors: buildInfo.errors,
|
|
124054
|
+
checkPending: buildInfo.checkPending
|
|
124026
124055
|
};
|
|
124027
124056
|
}
|
|
124028
124057
|
return {
|
|
@@ -127252,17 +127281,17 @@ function createBuildOrUpdateInvalidedProject(state, project, projectPath, projec
|
|
|
127252
127281
|
updateOutputTimestampsWorker(state, config, projectPath, Diagnostics.Updating_unchanged_output_timestamps_of_project_0, emittedOutputs);
|
|
127253
127282
|
}
|
|
127254
127283
|
state.projectErrorsReported.set(projectPath, true);
|
|
127284
|
+
buildResult = ((_c = program.hasChangedEmitSignature) == null ? void 0 : _c.call(program)) ? 0 /* None */ : 2 /* DeclarationOutputUnchanged */;
|
|
127255
127285
|
if (!diagnostics.length) {
|
|
127256
127286
|
state.diagnostics.delete(projectPath);
|
|
127257
127287
|
state.projectStatus.set(projectPath, {
|
|
127258
127288
|
type: 1 /* UpToDate */,
|
|
127259
127289
|
oldestOutputFileName: firstOrUndefinedIterator(emittedOutputs.values()) ?? getFirstProjectOutput(config, !host.useCaseSensitiveFileNames())
|
|
127260
127290
|
});
|
|
127261
|
-
buildResult = ((_c = program.hasChangedEmitSignature) == null ? void 0 : _c.call(program)) ? 0 /* None */ : 2 /* DeclarationOutputUnchanged */;
|
|
127262
127291
|
} else {
|
|
127263
127292
|
state.diagnostics.set(projectPath, diagnostics);
|
|
127264
127293
|
state.projectStatus.set(projectPath, { type: 0 /* Unbuildable */, reason: `it had errors` });
|
|
127265
|
-
buildResult
|
|
127294
|
+
buildResult |= 4 /* AnyErrors */;
|
|
127266
127295
|
}
|
|
127267
127296
|
afterProgramDone(state, program);
|
|
127268
127297
|
step = 2 /* QueueReferencingProjects */;
|
|
@@ -127332,7 +127361,7 @@ function getNextInvalidatedProjectCreateInfo(state, buildOrder, reportQueue) {
|
|
|
127332
127361
|
}
|
|
127333
127362
|
continue;
|
|
127334
127363
|
}
|
|
127335
|
-
if (status.type === 2 /* UpToDateWithUpstreamTypes */ || status.type ===
|
|
127364
|
+
if (status.type === 2 /* UpToDateWithUpstreamTypes */ || status.type === 14 /* UpToDateWithInputFileText */) {
|
|
127336
127365
|
reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config));
|
|
127337
127366
|
return {
|
|
127338
127367
|
kind: 1 /* UpdateOutputFileStamps */,
|
|
@@ -127344,21 +127373,7 @@ function getNextInvalidatedProjectCreateInfo(state, buildOrder, reportQueue) {
|
|
|
127344
127373
|
};
|
|
127345
127374
|
}
|
|
127346
127375
|
}
|
|
127347
|
-
if (status.type ===
|
|
127348
|
-
verboseReportProjectStatus(state, project, status);
|
|
127349
|
-
reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config));
|
|
127350
|
-
projectPendingBuild.delete(projectPath);
|
|
127351
|
-
if (options.verbose) {
|
|
127352
|
-
reportStatus(
|
|
127353
|
-
state,
|
|
127354
|
-
status.upstreamProjectBlocked ? Diagnostics.Skipping_build_of_project_0_because_its_dependency_1_was_not_built : Diagnostics.Skipping_build_of_project_0_because_its_dependency_1_has_errors,
|
|
127355
|
-
project,
|
|
127356
|
-
status.upstreamProjectName
|
|
127357
|
-
);
|
|
127358
|
-
}
|
|
127359
|
-
continue;
|
|
127360
|
-
}
|
|
127361
|
-
if (status.type === 16 /* ContainerOnly */) {
|
|
127376
|
+
if (status.type === 15 /* ContainerOnly */) {
|
|
127362
127377
|
verboseReportProjectStatus(state, project, status);
|
|
127363
127378
|
reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config));
|
|
127364
127379
|
projectPendingBuild.delete(projectPath);
|
|
@@ -127500,38 +127515,25 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
|
|
|
127500
127515
|
var _a, _b, _c;
|
|
127501
127516
|
if (!project.fileNames.length && !canJsonReportNoInputFiles(project.raw)) {
|
|
127502
127517
|
return {
|
|
127503
|
-
type:
|
|
127518
|
+
type: 15 /* ContainerOnly */
|
|
127504
127519
|
};
|
|
127505
127520
|
}
|
|
127506
127521
|
let referenceStatuses;
|
|
127507
127522
|
const force = !!state.options.force;
|
|
127508
127523
|
if (project.projectReferences) {
|
|
127509
|
-
state.projectStatus.set(resolvedPath, { type:
|
|
127524
|
+
state.projectStatus.set(resolvedPath, { type: 12 /* ComputingUpstream */ });
|
|
127510
127525
|
for (const ref of project.projectReferences) {
|
|
127511
127526
|
const resolvedRef = resolveProjectReferencePath(ref);
|
|
127512
127527
|
const resolvedRefPath = toResolvedConfigFilePath(state, resolvedRef);
|
|
127513
127528
|
const resolvedConfig = parseConfigFile(state, resolvedRef, resolvedRefPath);
|
|
127514
127529
|
const refStatus = getUpToDateStatus(state, resolvedConfig, resolvedRefPath);
|
|
127515
|
-
if (refStatus.type ===
|
|
127530
|
+
if (refStatus.type === 12 /* ComputingUpstream */ || refStatus.type === 15 /* ContainerOnly */) {
|
|
127516
127531
|
continue;
|
|
127517
127532
|
}
|
|
127518
|
-
if (refStatus.type === 0 /* Unbuildable */ || refStatus.type === 12 /* UpstreamBlocked */) {
|
|
127519
|
-
return {
|
|
127520
|
-
type: 12 /* UpstreamBlocked */,
|
|
127521
|
-
upstreamProjectName: ref.path,
|
|
127522
|
-
upstreamProjectBlocked: refStatus.type === 12 /* UpstreamBlocked */
|
|
127523
|
-
};
|
|
127524
|
-
}
|
|
127525
|
-
if (refStatus.type !== 1 /* UpToDate */) {
|
|
127526
|
-
return {
|
|
127527
|
-
type: 11 /* UpstreamOutOfDate */,
|
|
127528
|
-
upstreamProjectName: ref.path
|
|
127529
|
-
};
|
|
127530
|
-
}
|
|
127531
127533
|
if (!force) (referenceStatuses || (referenceStatuses = [])).push({ ref, refStatus, resolvedRefPath, resolvedConfig });
|
|
127532
127534
|
}
|
|
127533
127535
|
}
|
|
127534
|
-
if (force) return { type:
|
|
127536
|
+
if (force) return { type: 16 /* ForceBuild */ };
|
|
127535
127537
|
const { host } = state;
|
|
127536
127538
|
const buildInfoPath = getTsBuildInfoEmitOutputFilePath(project.options);
|
|
127537
127539
|
const isIncremental = isIncrementalCompilation(project.options);
|
|
@@ -127560,18 +127562,19 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
|
|
|
127560
127562
|
const incrementalBuildInfo = isIncremental && isIncrementalBuildInfo(buildInfo) ? buildInfo : void 0;
|
|
127561
127563
|
if ((incrementalBuildInfo || !isIncremental) && buildInfo.version !== version) {
|
|
127562
127564
|
return {
|
|
127563
|
-
type:
|
|
127565
|
+
type: 13 /* TsVersionOutputOfDate */,
|
|
127564
127566
|
version: buildInfo.version
|
|
127565
127567
|
};
|
|
127566
127568
|
}
|
|
127567
|
-
if (buildInfo.errors
|
|
127569
|
+
if (!project.options.noCheck && (buildInfo.errors || // TODO: syntax errors????
|
|
127570
|
+
buildInfo.checkPending)) {
|
|
127568
127571
|
return {
|
|
127569
127572
|
type: 8 /* OutOfDateBuildInfoWithErrors */,
|
|
127570
127573
|
buildInfoFile: buildInfoPath
|
|
127571
127574
|
};
|
|
127572
127575
|
}
|
|
127573
127576
|
if (incrementalBuildInfo) {
|
|
127574
|
-
if (((_a = incrementalBuildInfo.semanticDiagnosticsPerFile) == null ? void 0 : _a.length) || !project.options.noEmit && getEmitDeclarations(project.options) && ((_b = incrementalBuildInfo.emitDiagnosticsPerFile) == null ? void 0 : _b.length)) {
|
|
127577
|
+
if (!project.options.noCheck && (((_a = incrementalBuildInfo.semanticDiagnosticsPerFile) == null ? void 0 : _a.length) || !project.options.noEmit && getEmitDeclarations(project.options) && ((_b = incrementalBuildInfo.emitDiagnosticsPerFile) == null ? void 0 : _b.length))) {
|
|
127575
127578
|
return {
|
|
127576
127579
|
type: 8 /* OutOfDateBuildInfoWithErrors */,
|
|
127577
127580
|
buildInfoFile: buildInfoPath
|
|
@@ -127719,7 +127722,7 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
|
|
|
127719
127722
|
);
|
|
127720
127723
|
if (dependentPackageFileStatus) return dependentPackageFileStatus;
|
|
127721
127724
|
return {
|
|
127722
|
-
type: pseudoUpToDate ? 2 /* UpToDateWithUpstreamTypes */ : pseudoInputUpToDate ?
|
|
127725
|
+
type: pseudoUpToDate ? 2 /* UpToDateWithUpstreamTypes */ : pseudoInputUpToDate ? 14 /* UpToDateWithInputFileText */ : 1 /* UpToDate */,
|
|
127723
127726
|
newestInputFileTime,
|
|
127724
127727
|
newestInputFileName,
|
|
127725
127728
|
oldestOutputFileName
|
|
@@ -127802,7 +127805,6 @@ function updateOutputTimestamps(state, proj, resolvedPath) {
|
|
|
127802
127805
|
});
|
|
127803
127806
|
}
|
|
127804
127807
|
function queueReferencingProjects(state, project, projectPath, projectIndex, config, buildOrder, buildResult) {
|
|
127805
|
-
if (buildResult & 4 /* AnyErrors */) return;
|
|
127806
127808
|
if (!config.options.composite) return;
|
|
127807
127809
|
for (let index = projectIndex + 1; index < buildOrder.length; index++) {
|
|
127808
127810
|
const nextProject = buildOrder[index];
|
|
@@ -127821,7 +127823,7 @@ function queueReferencingProjects(state, project, projectPath, projectIndex, con
|
|
|
127821
127823
|
status.type = 2 /* UpToDateWithUpstreamTypes */;
|
|
127822
127824
|
break;
|
|
127823
127825
|
}
|
|
127824
|
-
case
|
|
127826
|
+
case 14 /* UpToDateWithInputFileText */:
|
|
127825
127827
|
case 2 /* UpToDateWithUpstreamTypes */:
|
|
127826
127828
|
if (!(buildResult & 2 /* DeclarationOutputUnchanged */)) {
|
|
127827
127829
|
state.projectStatus.set(nextProjectPath, {
|
|
@@ -127831,11 +127833,6 @@ function queueReferencingProjects(state, project, projectPath, projectIndex, con
|
|
|
127831
127833
|
});
|
|
127832
127834
|
}
|
|
127833
127835
|
break;
|
|
127834
|
-
case 12 /* UpstreamBlocked */:
|
|
127835
|
-
if (toResolvedConfigFilePath(state, resolveProjectName(state, status.upstreamProjectName)) === projectPath) {
|
|
127836
|
-
clearProjectStatus(state, nextProjectPath);
|
|
127837
|
-
}
|
|
127838
|
-
break;
|
|
127839
127836
|
}
|
|
127840
127837
|
}
|
|
127841
127838
|
addProjToQueue(state, nextProjectPath, 0 /* Update */);
|
|
@@ -128296,7 +128293,7 @@ function reportUpToDateStatus(state, configFileName, status) {
|
|
|
128296
128293
|
Diagnostics.Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies,
|
|
128297
128294
|
relName(state, configFileName)
|
|
128298
128295
|
);
|
|
128299
|
-
case
|
|
128296
|
+
case 14 /* UpToDateWithInputFileText */:
|
|
128300
128297
|
return reportStatus(
|
|
128301
128298
|
state,
|
|
128302
128299
|
Diagnostics.Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_files,
|
|
@@ -128309,13 +128306,6 @@ function reportUpToDateStatus(state, configFileName, status) {
|
|
|
128309
128306
|
relName(state, configFileName),
|
|
128310
128307
|
relName(state, status.upstreamProjectName)
|
|
128311
128308
|
);
|
|
128312
|
-
case 12 /* UpstreamBlocked */:
|
|
128313
|
-
return reportStatus(
|
|
128314
|
-
state,
|
|
128315
|
-
status.upstreamProjectBlocked ? Diagnostics.Project_0_can_t_be_built_because_its_dependency_1_was_not_built : Diagnostics.Project_0_can_t_be_built_because_its_dependency_1_has_errors,
|
|
128316
|
-
relName(state, configFileName),
|
|
128317
|
-
relName(state, status.upstreamProjectName)
|
|
128318
|
-
);
|
|
128319
128309
|
case 0 /* Unbuildable */:
|
|
128320
128310
|
return reportStatus(
|
|
128321
128311
|
state,
|
|
@@ -128323,7 +128313,7 @@ function reportUpToDateStatus(state, configFileName, status) {
|
|
|
128323
128313
|
relName(state, configFileName),
|
|
128324
128314
|
status.reason
|
|
128325
128315
|
);
|
|
128326
|
-
case
|
|
128316
|
+
case 13 /* TsVersionOutputOfDate */:
|
|
128327
128317
|
return reportStatus(
|
|
128328
128318
|
state,
|
|
128329
128319
|
Diagnostics.Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2,
|
|
@@ -128331,14 +128321,14 @@ function reportUpToDateStatus(state, configFileName, status) {
|
|
|
128331
128321
|
status.version,
|
|
128332
128322
|
version
|
|
128333
128323
|
);
|
|
128334
|
-
case
|
|
128324
|
+
case 16 /* ForceBuild */:
|
|
128335
128325
|
return reportStatus(
|
|
128336
128326
|
state,
|
|
128337
128327
|
Diagnostics.Project_0_is_being_forcibly_rebuilt,
|
|
128338
128328
|
relName(state, configFileName)
|
|
128339
128329
|
);
|
|
128340
|
-
case
|
|
128341
|
-
case
|
|
128330
|
+
case 15 /* ContainerOnly */:
|
|
128331
|
+
case 12 /* ComputingUpstream */:
|
|
128342
128332
|
break;
|
|
128343
128333
|
default:
|
|
128344
128334
|
assertType(status);
|