@typescript-deploys/pr-build 5.7.0-pr-59688-4 → 5.7.0-pr-59709-8

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 CHANGED
@@ -18,7 +18,7 @@ and limitations under the License.
18
18
 
19
19
  // src/compiler/corePublic.ts
20
20
  var versionMajorMinor = "5.7";
21
- var version = `${versionMajorMinor}.0-insiders.20240820`;
21
+ var version = `${versionMajorMinor}.0-insiders.20240822`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -19525,6 +19525,75 @@ function isSideEffectImport(node) {
19525
19525
  const ancestor = findAncestor(node, isImportDeclaration);
19526
19526
  return !!ancestor && !ancestor.importClause;
19527
19527
  }
19528
+ var unprefixedNodeCoreModulesList = [
19529
+ "assert",
19530
+ "assert/strict",
19531
+ "async_hooks",
19532
+ "buffer",
19533
+ "child_process",
19534
+ "cluster",
19535
+ "console",
19536
+ "constants",
19537
+ "crypto",
19538
+ "dgram",
19539
+ "diagnostics_channel",
19540
+ "dns",
19541
+ "dns/promises",
19542
+ "domain",
19543
+ "events",
19544
+ "fs",
19545
+ "fs/promises",
19546
+ "http",
19547
+ "http2",
19548
+ "https",
19549
+ "inspector",
19550
+ "inspector/promises",
19551
+ "module",
19552
+ "net",
19553
+ "os",
19554
+ "path",
19555
+ "path/posix",
19556
+ "path/win32",
19557
+ "perf_hooks",
19558
+ "process",
19559
+ "punycode",
19560
+ "querystring",
19561
+ "readline",
19562
+ "readline/promises",
19563
+ "repl",
19564
+ "stream",
19565
+ "stream/consumers",
19566
+ "stream/promises",
19567
+ "stream/web",
19568
+ "string_decoder",
19569
+ "sys",
19570
+ "test/mock_loader",
19571
+ "timers",
19572
+ "timers/promises",
19573
+ "tls",
19574
+ "trace_events",
19575
+ "tty",
19576
+ "url",
19577
+ "util",
19578
+ "util/types",
19579
+ "v8",
19580
+ "vm",
19581
+ "wasi",
19582
+ "worker_threads",
19583
+ "zlib"
19584
+ ];
19585
+ var unprefixedNodeCoreModules = new Set(unprefixedNodeCoreModulesList);
19586
+ var exclusivelyPrefixedNodeCoreModules = /* @__PURE__ */ new Set([
19587
+ "node:sea",
19588
+ "node:sqlite",
19589
+ "node:test",
19590
+ "node:test/reporters"
19591
+ ]);
19592
+ var nodeCoreModules = /* @__PURE__ */ new Set([
19593
+ ...unprefixedNodeCoreModulesList,
19594
+ ...unprefixedNodeCoreModulesList.map((name) => `node:${name}`),
19595
+ ...exclusivelyPrefixedNodeCoreModules
19596
+ ]);
19528
19597
 
19529
19598
  // src/compiler/factory/baseNodeFactory.ts
19530
19599
  function createBaseNodeFactory() {
@@ -38247,9 +38316,6 @@ function getErrorForNoInputFiles({ includeSpecs, excludeSpecs }, configFileName)
38247
38316
  function shouldReportNoInputFiles(fileNames, canJsonReportNoInutFiles, resolutionStack) {
38248
38317
  return fileNames.length === 0 && canJsonReportNoInutFiles && (!resolutionStack || resolutionStack.length === 0);
38249
38318
  }
38250
- function isSolutionConfig(config) {
38251
- return !config.fileNames.length && hasProperty(config.raw, "references");
38252
- }
38253
38319
  function canJsonReportNoInputFiles(raw) {
38254
38320
  return !hasProperty(raw, "files") && !hasProperty(raw, "references");
38255
38321
  }
@@ -67614,7 +67680,8 @@ function createTypeChecker(host) {
67614
67680
  const inferredCovariantType = inference.candidates ? getCovariantInference(inference, context.signature) : void 0;
67615
67681
  const inferredContravariantType = inference.contraCandidates ? getContravariantInference(inference) : void 0;
67616
67682
  if (inferredCovariantType || inferredContravariantType) {
67617
- const preferCovariantType = inferredCovariantType && (!inferredContravariantType || !(inferredCovariantType.flags & (131072 /* Never */ | 1 /* Any */)) && some(inference.contraCandidates, (t) => isTypeAssignableTo(inferredCovariantType, t)) && every(context.inferences, (other) => other !== inference && getConstraintOfTypeParameter(other.typeParameter) !== inference.typeParameter || every(other.candidates, (t) => isTypeAssignableTo(t, inferredCovariantType))));
67683
+ const compareTypes = inference.priority & 128 /* ReturnType */ ? isTypeSubtypeOf : isTypeAssignableTo;
67684
+ const preferCovariantType = inferredCovariantType && (!inferredContravariantType || !(inferredCovariantType.flags & (131072 /* Never */ | 1 /* Any */)) && some(inference.contraCandidates, (t) => compareTypes(inferredCovariantType, t)) && every(context.inferences, (other) => other !== inference && getConstraintOfTypeParameter(other.typeParameter) !== inference.typeParameter || every(other.candidates, (t) => compareTypes(t, inferredCovariantType))));
67618
67685
  inferredType = preferCovariantType ? inferredCovariantType : inferredContravariantType;
67619
67686
  fallbackType = preferCovariantType ? inferredContravariantType : inferredCovariantType;
67620
67687
  } else if (context.flags & 1 /* NoDefault */) {
@@ -119686,22 +119753,15 @@ function forEachProjectReference(projectReferences, resolvedProjectReferences, c
119686
119753
  const result = cbRef(projectReferences2, parent);
119687
119754
  if (result) return result;
119688
119755
  }
119689
- let skipChildren;
119690
- return forEach(
119691
- resolvedProjectReferences2,
119692
- (resolvedRef, index) => {
119693
- if (resolvedRef && (seenResolvedRefs == null ? void 0 : seenResolvedRefs.has(resolvedRef.sourceFile.path))) {
119694
- (skipChildren ?? (skipChildren = /* @__PURE__ */ new Set())).add(resolvedRef);
119695
- return void 0;
119696
- }
119697
- const result = cbResolvedRef(resolvedRef, parent, index);
119698
- if (result || !resolvedRef) return result;
119699
- (seenResolvedRefs || (seenResolvedRefs = /* @__PURE__ */ new Set())).add(resolvedRef.sourceFile.path);
119756
+ return forEach(resolvedProjectReferences2, (resolvedRef, index) => {
119757
+ if (resolvedRef && (seenResolvedRefs == null ? void 0 : seenResolvedRefs.has(resolvedRef.sourceFile.path))) {
119758
+ return void 0;
119700
119759
  }
119701
- ) || forEach(
119702
- resolvedProjectReferences2,
119703
- (resolvedRef) => resolvedRef && !(skipChildren == null ? void 0 : skipChildren.has(resolvedRef)) ? worker(resolvedRef.commandLine.projectReferences, resolvedRef.references, resolvedRef) : void 0
119704
- );
119760
+ const result = cbResolvedRef(resolvedRef, parent, index);
119761
+ if (result || !resolvedRef) return result;
119762
+ (seenResolvedRefs || (seenResolvedRefs = /* @__PURE__ */ new Set())).add(resolvedRef.sourceFile.path);
119763
+ return worker(resolvedRef.commandLine.projectReferences, resolvedRef.references, resolvedRef);
119764
+ });
119705
119765
  }
119706
119766
  }
119707
119767
  var inferredTypesContainingFile = "__inferred type names__.ts";
@@ -119799,13 +119859,7 @@ function isProgramUptoDate(program, rootFileNames, newOptions, getSourceVersion,
119799
119859
  if (oldResolvedRef.commandLine.options.configFile !== newParsedCommandLine.options.configFile) return false;
119800
119860
  if (!arrayIsEqualTo(oldResolvedRef.commandLine.fileNames, newParsedCommandLine.fileNames)) return false;
119801
119861
  (seenResolvedRefs || (seenResolvedRefs = [])).push(oldResolvedRef);
119802
- return !forEach(
119803
- oldResolvedRef.references,
119804
- (childResolvedRef, index) => !resolvedProjectReferenceUptoDate(
119805
- childResolvedRef,
119806
- oldResolvedRef.commandLine.projectReferences[index]
119807
- )
119808
- );
119862
+ return !forEach(oldResolvedRef.references, (childResolvedRef, index) => !resolvedProjectReferenceUptoDate(childResolvedRef, oldResolvedRef.commandLine.projectReferences[index]));
119809
119863
  }
119810
119864
  const refPath = resolveProjectReferencePath(oldRef);
119811
119865
  return !getParsedCommandLine(refPath);
@@ -120076,7 +120130,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
120076
120130
  const packageIdToSourceFile = /* @__PURE__ */ new Map();
120077
120131
  let sourceFileToPackageName = /* @__PURE__ */ new Map();
120078
120132
  let redirectTargetsMap = createMultiMap();
120079
- let usesUriStyleNodeCoreModules = false;
120133
+ let usesUriStyleNodeCoreModules;
120080
120134
  const filesByName = /* @__PURE__ */ new Map();
120081
120135
  let missingFileNames = /* @__PURE__ */ new Map();
120082
120136
  const filesByNameIgnoreCase = host.useCaseSensitiveFileNames() ? /* @__PURE__ */ new Map() : void 0;
@@ -121498,7 +121552,11 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
121498
121552
  );
121499
121553
  imports = append(imports, moduleNameExpr);
121500
121554
  if (!usesUriStyleNodeCoreModules && currentNodeModulesDepth === 0 && !file.isDeclarationFile) {
121501
- usesUriStyleNodeCoreModules = startsWith(moduleNameExpr.text, "node:");
121555
+ if (startsWith(moduleNameExpr.text, "node:") && !exclusivelyPrefixedNodeCoreModules.has(moduleNameExpr.text)) {
121556
+ usesUriStyleNodeCoreModules = true;
121557
+ } else if (usesUriStyleNodeCoreModules === void 0 && unprefixedNodeCoreModules.has(moduleNameExpr.text)) {
121558
+ usesUriStyleNodeCoreModules = false;
121559
+ }
121502
121560
  }
121503
121561
  }
121504
121562
  } else if (isModuleDeclaration(node)) {
@@ -122737,11 +122795,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
122737
122795
  case 1 /* SourceFromProjectReference */:
122738
122796
  case 2 /* OutputFromProjectReference */:
122739
122797
  const referencedResolvedRef = Debug.checkDefined(resolvedProjectReferences == null ? void 0 : resolvedProjectReferences[reason.index]);
122740
- const referenceInfo = forEachProjectReference(
122741
- projectReferences,
122742
- resolvedProjectReferences,
122743
- (resolvedRef, parent, index2) => resolvedRef === referencedResolvedRef ? { sourceFile: (parent == null ? void 0 : parent.sourceFile) || options.configFile, index: index2 } : void 0
122744
- );
122798
+ const referenceInfo = forEachProjectReference(projectReferences, resolvedProjectReferences, (resolvedRef, parent, index2) => resolvedRef === referencedResolvedRef ? { sourceFile: (parent == null ? void 0 : parent.sourceFile) || options.configFile, index: index2 } : void 0);
122745
122799
  if (!referenceInfo) return void 0;
122746
122800
  const { sourceFile, index } = referenceInfo;
122747
122801
  const referencesSyntax = forEachTsConfigPropArray(sourceFile, "references", (property) => isArrayLiteralExpression(property.initializer) ? property.initializer : void 0);
@@ -122776,31 +122830,27 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
122776
122830
  }
122777
122831
  function verifyProjectReferences() {
122778
122832
  const buildInfoPath = !options.suppressOutputPathCheck ? getTsBuildInfoEmitOutputFilePath(options) : void 0;
122779
- forEachProjectReference(
122780
- projectReferences,
122781
- resolvedProjectReferences,
122782
- (resolvedRef, parent, index) => {
122783
- const ref = (parent ? parent.commandLine.projectReferences : projectReferences)[index];
122784
- const parentFile = parent && parent.sourceFile;
122785
- verifyDeprecatedProjectReference(ref, parentFile, index);
122786
- if (!resolvedRef) {
122787
- createDiagnosticForReference(parentFile, index, Diagnostics.File_0_not_found, ref.path);
122788
- return;
122789
- }
122790
- const options2 = resolvedRef.commandLine.options;
122791
- if (!options2.composite || options2.noEmit) {
122792
- const inputs = parent ? parent.commandLine.fileNames : rootNames;
122793
- if (inputs.length) {
122794
- if (!options2.composite) createDiagnosticForReference(parentFile, index, Diagnostics.Referenced_project_0_must_have_setting_composite_Colon_true, ref.path);
122795
- if (options2.noEmit) createDiagnosticForReference(parentFile, index, Diagnostics.Referenced_project_0_may_not_disable_emit, ref.path);
122796
- }
122797
- }
122798
- if (!parent && buildInfoPath && buildInfoPath === getTsBuildInfoEmitOutputFilePath(options2)) {
122799
- createDiagnosticForReference(parentFile, index, Diagnostics.Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1, buildInfoPath, ref.path);
122800
- hasEmitBlockingDiagnostics.set(toPath3(buildInfoPath), true);
122833
+ forEachProjectReference(projectReferences, resolvedProjectReferences, (resolvedRef, parent, index) => {
122834
+ const ref = (parent ? parent.commandLine.projectReferences : projectReferences)[index];
122835
+ const parentFile = parent && parent.sourceFile;
122836
+ verifyDeprecatedProjectReference(ref, parentFile, index);
122837
+ if (!resolvedRef) {
122838
+ createDiagnosticForReference(parentFile, index, Diagnostics.File_0_not_found, ref.path);
122839
+ return;
122840
+ }
122841
+ const options2 = resolvedRef.commandLine.options;
122842
+ if (!options2.composite || options2.noEmit) {
122843
+ const inputs = parent ? parent.commandLine.fileNames : rootNames;
122844
+ if (inputs.length) {
122845
+ if (!options2.composite) createDiagnosticForReference(parentFile, index, Diagnostics.Referenced_project_0_must_have_setting_composite_Colon_true, ref.path);
122846
+ if (options2.noEmit) createDiagnosticForReference(parentFile, index, Diagnostics.Referenced_project_0_may_not_disable_emit, ref.path);
122801
122847
  }
122802
122848
  }
122803
- );
122849
+ if (!parent && buildInfoPath && buildInfoPath === getTsBuildInfoEmitOutputFilePath(options2)) {
122850
+ createDiagnosticForReference(parentFile, index, Diagnostics.Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1, buildInfoPath, ref.path);
122851
+ hasEmitBlockingDiagnostics.set(toPath3(buildInfoPath), true);
122852
+ }
122853
+ });
122804
122854
  }
122805
122855
  function createDiagnosticForOptionPathKeyValue(key, valueIndex, message, ...args) {
122806
122856
  let needCompilerDiagnostic = true;
@@ -127337,13 +127387,7 @@ function createWatchProgram(host) {
127337
127387
  Debug.assert(configFileName);
127338
127388
  updateLevel = 0 /* Update */;
127339
127389
  rootFileNames = getFileNamesFromConfigSpecs(compilerOptions.configFile.configFileSpecs, getNormalizedAbsolutePath(getDirectoryPath(configFileName), currentDirectory), compilerOptions, parseConfigFileHost, extraFileExtensions);
127340
- if (updateErrorForNoInputFiles(
127341
- rootFileNames,
127342
- getNormalizedAbsolutePath(configFileName, currentDirectory),
127343
- compilerOptions.configFile.configFileSpecs,
127344
- configFileParsingDiagnostics,
127345
- canConfigFileJsonReportNoInputFiles
127346
- )) {
127390
+ if (updateErrorForNoInputFiles(rootFileNames, getNormalizedAbsolutePath(configFileName, currentDirectory), compilerOptions.configFile.configFileSpecs, configFileParsingDiagnostics, canConfigFileJsonReportNoInputFiles)) {
127347
127391
  hasChangedConfigFileParsingErrors = true;
127348
127392
  }
127349
127393
  synchronizeProgram();
@@ -128304,13 +128348,7 @@ function getNextInvalidatedProjectCreateInfo(state, buildOrder, reportQueue) {
128304
128348
  watchPackageJsonFiles(state, project, projectPath, config);
128305
128349
  } else if (updateLevel === 1 /* RootNamesAndUpdate */) {
128306
128350
  config.fileNames = getFileNamesFromConfigSpecs(config.options.configFile.configFileSpecs, getDirectoryPath(project), config.options, state.parseConfigFileHost);
128307
- updateErrorForNoInputFiles(
128308
- config.fileNames,
128309
- project,
128310
- config.options.configFile.configFileSpecs,
128311
- config.errors,
128312
- canJsonReportNoInputFiles(config.raw)
128313
- );
128351
+ updateErrorForNoInputFiles(config.fileNames, project, config.options.configFile.configFileSpecs, config.errors, canJsonReportNoInputFiles(config.raw));
128314
128352
  watchInputFiles(state, project, projectPath, config);
128315
128353
  watchPackageJsonFiles(state, project, projectPath, config);
128316
128354
  }
@@ -128491,7 +128529,11 @@ function checkConfigFileUpToDateStatus(state, configFile, oldestOutputFileTime,
128491
128529
  }
128492
128530
  function getUpToDateStatusWorker(state, project, resolvedPath) {
128493
128531
  var _a, _b, _c, _d, _e;
128494
- if (isSolutionConfig(project)) return { type: 16 /* ContainerOnly */ };
128532
+ if (!project.fileNames.length && !canJsonReportNoInputFiles(project.raw)) {
128533
+ return {
128534
+ type: 16 /* ContainerOnly */
128535
+ };
128536
+ }
128495
128537
  let referenceStatuses;
128496
128538
  const force = !!state.options.force;
128497
128539
  if (project.projectReferences) {
@@ -2828,6 +2828,7 @@ declare namespace ts {
2828
2828
  private lastReportedFileNames;
2829
2829
  private lastReportedVersion;
2830
2830
  protected projectErrors: Diagnostic[] | undefined;
2831
+ protected isInitialLoadPending: () => boolean;
2831
2832
  private typingsCache;
2832
2833
  private typingWatchers;
2833
2834
  private readonly cancellationToken;
@@ -3276,7 +3277,6 @@ declare namespace ts {
3276
3277
  private deleteScriptInfo;
3277
3278
  private configFileExists;
3278
3279
  private createConfigFileWatcherForParsedConfig;
3279
- private ensureConfigFileWatcherForProject;
3280
3280
  private forEachConfigFileLocation;
3281
3281
  private getConfigFileNameForFileFromCache;
3282
3282
  private setConfigFileNameForFileInCache;
@@ -3290,7 +3290,6 @@ declare namespace ts {
3290
3290
  private updateNonInferredProjectFiles;
3291
3291
  private updateRootAndOptionsOfNonInferredProject;
3292
3292
  private reloadFileNamesOfParsedConfig;
3293
- private setProjectForReload;
3294
3293
  private clearSemanticCache;
3295
3294
  private getOrCreateInferredProjectForProjectRootPathIfEnabled;
3296
3295
  private getOrCreateSingleInferredProjectIfEnabled;
@@ -3337,8 +3336,6 @@ declare namespace ts {
3337
3336
  private getOrCreateOpenScriptInfo;
3338
3337
  private assignProjectToOpenedScriptInfo;
3339
3338
  private tryFindDefaultConfiguredProjectForOpenScriptInfo;
3340
- private isMatchedByConfig;
3341
- private tryFindDefaultConfiguredProjectForOpenScriptInfoOrClosedFileInfo;
3342
3339
  private tryFindDefaultConfiguredProjectAndLoadAncestorsForOpenScriptInfo;
3343
3340
  private ensureProjectChildren;
3344
3341
  private cleanupConfiguredProjects;