typescript 5.6.0-dev.20240627 → 5.6.0-dev.20240628

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.6";
21
- var version = `${versionMajorMinor}.0-dev.20240627`;
21
+ var version = `${versionMajorMinor}.0-dev.20240628`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -4902,6 +4902,7 @@ var sys = (() => {
4902
4902
  writeFile: writeFile2,
4903
4903
  watchFile: watchFile2,
4904
4904
  watchDirectory,
4905
+ preferNonRecursiveWatch: !fsSupportsRecursiveFsWatch,
4905
4906
  resolvePath: (path) => _path.resolve(path),
4906
4907
  fileExists,
4907
4908
  directoryExists,
@@ -124306,7 +124307,7 @@ function canWatchAffectedPackageJsonOrNodeModulesOfAtTypes(fileOrDirPath) {
124306
124307
  function canWatchAffectingLocation(filePath) {
124307
124308
  return canWatchAffectedPackageJsonOrNodeModulesOfAtTypes(filePath);
124308
124309
  }
124309
- function getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath, rootDir, rootPath, rootPathComponents, getCurrentDirectory) {
124310
+ function getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath, rootDir, rootPath, rootPathComponents, getCurrentDirectory, preferNonRecursiveWatch) {
124310
124311
  const failedLookupPathComponents = getPathComponents(failedLookupLocationPath);
124311
124312
  failedLookupLocation = isRootedDiskPath(failedLookupLocation) ? normalizePath(failedLookupLocation) : getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory());
124312
124313
  const failedLookupComponents = getPathComponents(failedLookupLocation);
@@ -124338,10 +124339,11 @@ function getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLoo
124338
124339
  perceivedOsRootLength,
124339
124340
  nodeModulesIndex,
124340
124341
  rootPathComponents,
124341
- lastNodeModulesIndex
124342
+ lastNodeModulesIndex,
124343
+ preferNonRecursiveWatch
124342
124344
  );
124343
124345
  }
124344
- function getDirectoryToWatchFromFailedLookupLocationDirectory(dirComponents, dirPathComponents, dirPathComponentsLength, perceivedOsRootLength, nodeModulesIndex, rootPathComponents, lastNodeModulesIndex) {
124346
+ function getDirectoryToWatchFromFailedLookupLocationDirectory(dirComponents, dirPathComponents, dirPathComponentsLength, perceivedOsRootLength, nodeModulesIndex, rootPathComponents, lastNodeModulesIndex, preferNonRecursiveWatch) {
124345
124347
  if (nodeModulesIndex !== -1) {
124346
124348
  return getDirectoryOfFailedLookupWatch(
124347
124349
  dirComponents,
@@ -124352,11 +124354,13 @@ function getDirectoryToWatchFromFailedLookupLocationDirectory(dirComponents, dir
124352
124354
  }
124353
124355
  let nonRecursive = true;
124354
124356
  let length2 = dirPathComponentsLength;
124355
- for (let i = 0; i < dirPathComponentsLength; i++) {
124356
- if (dirPathComponents[i] !== rootPathComponents[i]) {
124357
- nonRecursive = false;
124358
- length2 = Math.max(i + 1, perceivedOsRootLength + 1);
124359
- break;
124357
+ if (!preferNonRecursiveWatch) {
124358
+ for (let i = 0; i < dirPathComponentsLength; i++) {
124359
+ if (dirPathComponents[i] !== rootPathComponents[i]) {
124360
+ nonRecursive = false;
124361
+ length2 = Math.max(i + 1, perceivedOsRootLength + 1);
124362
+ break;
124363
+ }
124360
124364
  }
124361
124365
  }
124362
124366
  return getDirectoryOfFailedLookupWatch(
@@ -124384,7 +124388,7 @@ function getDirectoryOfFailedLookupWatch(dirComponents, dirPathComponents, lengt
124384
124388
  packageDirPath: packageDirLength !== void 0 ? getPathFromPathComponents(dirPathComponents, packageDirLength) : void 0
124385
124389
  };
124386
124390
  }
124387
- function getDirectoryToWatchFailedLookupLocationFromTypeRoot(typeRoot, typeRootPath, rootPath, rootPathComponents, getCurrentDirectory, filterCustomPath) {
124391
+ function getDirectoryToWatchFailedLookupLocationFromTypeRoot(typeRoot, typeRootPath, rootPath, rootPathComponents, getCurrentDirectory, preferNonRecursiveWatch, filterCustomPath) {
124388
124392
  const typeRootPathComponents = getPathComponents(typeRootPath);
124389
124393
  if (isInDirectoryPath(rootPathComponents, typeRootPathComponents)) {
124390
124394
  return rootPath;
@@ -124397,7 +124401,8 @@ function getDirectoryToWatchFailedLookupLocationFromTypeRoot(typeRoot, typeRootP
124397
124401
  perceivedOsRootLengthForWatching(typeRootPathComponents, typeRootPathComponents.length),
124398
124402
  typeRootPathComponents.indexOf("node_modules"),
124399
124403
  rootPathComponents,
124400
- typeRootPathComponents.lastIndexOf("node_modules")
124404
+ typeRootPathComponents.lastIndexOf("node_modules"),
124405
+ preferNonRecursiveWatch
124401
124406
  );
124402
124407
  return toWatch && filterCustomPath(toWatch.dirPath) ? toWatch.dirPath : void 0;
124403
124408
  }
@@ -124906,7 +124911,8 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
124906
124911
  rootDir,
124907
124912
  rootPath,
124908
124913
  rootPathComponents,
124909
- getCurrentDirectory
124914
+ getCurrentDirectory,
124915
+ resolutionHost.preferNonRecursiveWatch
124910
124916
  );
124911
124917
  if (toWatch) {
124912
124918
  const { dir, dirPath, nonRecursive, packageDir, packageDirPath } = toWatch;
@@ -125105,7 +125111,8 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
125105
125111
  rootDir,
125106
125112
  rootPath,
125107
125113
  rootPathComponents,
125108
- getCurrentDirectory
125114
+ getCurrentDirectory,
125115
+ resolutionHost.preferNonRecursiveWatch
125109
125116
  );
125110
125117
  if (toWatch) {
125111
125118
  const { dirPath, packageDirPath } = toWatch;
@@ -125333,6 +125340,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
125333
125340
  rootPath,
125334
125341
  rootPathComponents,
125335
125342
  getCurrentDirectory,
125343
+ resolutionHost.preferNonRecursiveWatch,
125336
125344
  (dirPath2) => directoryWatchesOfFailedLookups.has(dirPath2) || dirPathToSymlinkPackageRefCount.has(dirPath2)
125337
125345
  );
125338
125346
  if (dirPath) {
@@ -125801,7 +125809,8 @@ function createWatchHost(system = sys, reportWatchStatus2) {
125801
125809
  watchFile: maybeBind(system, system.watchFile) || returnNoopFileWatcher,
125802
125810
  watchDirectory: maybeBind(system, system.watchDirectory) || returnNoopFileWatcher,
125803
125811
  setTimeout: maybeBind(system, system.setTimeout) || noop,
125804
- clearTimeout: maybeBind(system, system.clearTimeout) || noop
125812
+ clearTimeout: maybeBind(system, system.clearTimeout) || noop,
125813
+ preferNonRecursiveWatch: system.preferNonRecursiveWatch
125805
125814
  };
125806
125815
  }
125807
125816
  var WatchType = {
@@ -126107,6 +126116,7 @@ function createWatchProgram(host) {
126107
126116
  compilerHost.toPath = toPath3;
126108
126117
  compilerHost.getCompilationSettings = () => compilerOptions;
126109
126118
  compilerHost.useSourceOfProjectReferenceRedirect = maybeBind(host, host.useSourceOfProjectReferenceRedirect);
126119
+ compilerHost.preferNonRecursiveWatch = host.preferNonRecursiveWatch;
126110
126120
  compilerHost.watchDirectoryOfFailedLookupLocation = (dir, cb, flags) => watchDirectory(dir, cb, flags, watchOptions, WatchType.FailedLookupLocations);
126111
126121
  compilerHost.watchAffectingFileLocation = (file, cb) => watchFile2(file, cb, 2e3 /* High */, watchOptions, WatchType.AffectingFileLocation);
126112
126122
  compilerHost.watchTypeRootsDirectory = (dir, cb, flags) => watchDirectory(dir, cb, flags, watchOptions, WatchType.TypeRoots);
@@ -2651,6 +2651,7 @@ declare namespace ts {
2651
2651
  interface ServerHost extends System {
2652
2652
  watchFile(path: string, callback: FileWatcherCallback, pollingInterval?: number, options?: WatchOptions): FileWatcher;
2653
2653
  watchDirectory(path: string, callback: DirectoryWatcherCallback, recursive?: boolean, options?: WatchOptions): FileWatcher;
2654
+ preferNonRecursiveWatch?: boolean;
2654
2655
  setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): any;
2655
2656
  clearTimeout(timeoutId: any): void;
2656
2657
  setImmediate(callback: (...args: any[]) => void, ...args: any[]): any;
@@ -9591,6 +9592,7 @@ declare namespace ts {
9591
9592
  setTimeout?(callback: (...args: any[]) => void, ms: number, ...args: any[]): any;
9592
9593
  /** If provided, will be used to reset existing delayed compilation */
9593
9594
  clearTimeout?(timeoutId: any): void;
9595
+ preferNonRecursiveWatch?: boolean;
9594
9596
  }
9595
9597
  interface ProgramHost<T extends BuilderProgram> {
9596
9598
  /**