claude-use 0.4.0 → 0.6.0
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/README.md +10 -1
- package/dist/cli.cjs +1023 -942
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -38,7 +38,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
38
38
|
var require_resolve_from = __commonJS({
|
|
39
39
|
"node_modules/.pnpm/resolve-from@4.0.0/node_modules/resolve-from/index.js"(exports2, module2) {
|
|
40
40
|
"use strict";
|
|
41
|
-
var
|
|
41
|
+
var path22 = require("path");
|
|
42
42
|
var Module = require("module");
|
|
43
43
|
var fs9 = require("fs");
|
|
44
44
|
var resolveFrom = (fromDir, moduleId, silent) => {
|
|
@@ -52,14 +52,14 @@ var require_resolve_from = __commonJS({
|
|
|
52
52
|
fromDir = fs9.realpathSync(fromDir);
|
|
53
53
|
} catch (err) {
|
|
54
54
|
if (err.code === "ENOENT") {
|
|
55
|
-
fromDir =
|
|
55
|
+
fromDir = path22.resolve(fromDir);
|
|
56
56
|
} else if (silent) {
|
|
57
57
|
return null;
|
|
58
58
|
} else {
|
|
59
59
|
throw err;
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
const fromFile =
|
|
62
|
+
const fromFile = path22.join(fromDir, "noop.js");
|
|
63
63
|
const resolveFileName = () => Module._resolveFilename(moduleId, {
|
|
64
64
|
id: fromFile,
|
|
65
65
|
filename: fromFile,
|
|
@@ -131,7 +131,7 @@ var require_parent_module = __commonJS({
|
|
|
131
131
|
var require_import_fresh = __commonJS({
|
|
132
132
|
"node_modules/.pnpm/import-fresh@3.3.1/node_modules/import-fresh/index.js"(exports2, module2) {
|
|
133
133
|
"use strict";
|
|
134
|
-
var
|
|
134
|
+
var path22 = require("path");
|
|
135
135
|
var resolveFrom = require_resolve_from();
|
|
136
136
|
var parentModule = require_parent_module();
|
|
137
137
|
module2.exports = (moduleId) => {
|
|
@@ -139,7 +139,7 @@ var require_import_fresh = __commonJS({
|
|
|
139
139
|
throw new TypeError("Expected a string");
|
|
140
140
|
}
|
|
141
141
|
const parentPath = parentModule(__filename);
|
|
142
|
-
const cwd = parentPath ?
|
|
142
|
+
const cwd = parentPath ? path22.dirname(parentPath) : __dirname;
|
|
143
143
|
const filePath = resolveFrom(cwd, moduleId);
|
|
144
144
|
const oldModule = require.cache[filePath];
|
|
145
145
|
if (oldModule && oldModule.parent) {
|
|
@@ -11893,17 +11893,17 @@ ${lanes.join("\n")}
|
|
|
11893
11893
|
}
|
|
11894
11894
|
function createSingleWatcherPerName(cache, useCaseSensitiveFileNames2, name, callback, createWatcher) {
|
|
11895
11895
|
const toCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames2);
|
|
11896
|
-
const
|
|
11897
|
-
const existing = cache.get(
|
|
11896
|
+
const path22 = toCanonicalFileName(name);
|
|
11897
|
+
const existing = cache.get(path22);
|
|
11898
11898
|
if (existing) {
|
|
11899
11899
|
existing.callbacks.push(callback);
|
|
11900
11900
|
} else {
|
|
11901
|
-
cache.set(
|
|
11901
|
+
cache.set(path22, {
|
|
11902
11902
|
watcher: createWatcher(
|
|
11903
11903
|
// Cant infer types correctly so lets satisfy checker
|
|
11904
11904
|
((param1, param2, param3) => {
|
|
11905
11905
|
var _a3;
|
|
11906
|
-
return (_a3 = cache.get(
|
|
11906
|
+
return (_a3 = cache.get(path22)) == null ? void 0 : _a3.callbacks.slice().forEach((cb) => cb(param1, param2, param3));
|
|
11907
11907
|
})
|
|
11908
11908
|
),
|
|
11909
11909
|
callbacks: [callback]
|
|
@@ -11911,10 +11911,10 @@ ${lanes.join("\n")}
|
|
|
11911
11911
|
}
|
|
11912
11912
|
return {
|
|
11913
11913
|
close: () => {
|
|
11914
|
-
const watcher = cache.get(
|
|
11914
|
+
const watcher = cache.get(path22);
|
|
11915
11915
|
if (!watcher) return;
|
|
11916
11916
|
if (!orderedRemoveItem(watcher.callbacks, callback) || watcher.callbacks.length) return;
|
|
11917
|
-
cache.delete(
|
|
11917
|
+
cache.delete(path22);
|
|
11918
11918
|
closeFileWatcherOf(watcher);
|
|
11919
11919
|
}
|
|
11920
11920
|
};
|
|
@@ -12166,13 +12166,13 @@ ${lanes.join("\n")}
|
|
|
12166
12166
|
(newChildWatches || (newChildWatches = [])).push(childWatcher);
|
|
12167
12167
|
}
|
|
12168
12168
|
}
|
|
12169
|
-
function isIgnoredPath(
|
|
12170
|
-
return some(ignoredPaths, (searchPath) => isInPath(
|
|
12169
|
+
function isIgnoredPath(path22, options) {
|
|
12170
|
+
return some(ignoredPaths, (searchPath) => isInPath(path22, searchPath)) || isIgnoredByWatchOptions(path22, options, useCaseSensitiveFileNames2, getCurrentDirectory);
|
|
12171
12171
|
}
|
|
12172
|
-
function isInPath(
|
|
12173
|
-
if (
|
|
12172
|
+
function isInPath(path22, searchPath) {
|
|
12173
|
+
if (path22.includes(searchPath)) return true;
|
|
12174
12174
|
if (useCaseSensitiveFileNames2) return false;
|
|
12175
|
-
return toCanonicalFilePath(
|
|
12175
|
+
return toCanonicalFilePath(path22).includes(searchPath);
|
|
12176
12176
|
}
|
|
12177
12177
|
}
|
|
12178
12178
|
var FileSystemEntryKind = /* @__PURE__ */ ((FileSystemEntryKind2) => {
|
|
@@ -12550,13 +12550,13 @@ ${lanes.join("\n")}
|
|
|
12550
12550
|
}
|
|
12551
12551
|
function patchWriteFileEnsuringDirectory(sys2) {
|
|
12552
12552
|
const originalWriteFile = sys2.writeFile;
|
|
12553
|
-
sys2.writeFile = (
|
|
12554
|
-
|
|
12553
|
+
sys2.writeFile = (path22, data, writeBom) => writeFileEnsuringDirectories(
|
|
12554
|
+
path22,
|
|
12555
12555
|
data,
|
|
12556
12556
|
!!writeBom,
|
|
12557
|
-
(
|
|
12558
|
-
(
|
|
12559
|
-
(
|
|
12557
|
+
(path23, data2, writeByteOrderMark) => originalWriteFile.call(sys2, path23, data2, writeByteOrderMark),
|
|
12558
|
+
(path23) => sys2.createDirectory(path23),
|
|
12559
|
+
(path23) => sys2.directoryExists(path23)
|
|
12560
12560
|
);
|
|
12561
12561
|
}
|
|
12562
12562
|
var sys = (() => {
|
|
@@ -12595,7 +12595,7 @@ ${lanes.join("\n")}
|
|
|
12595
12595
|
// Node 4.0 `fs.watch` function supports the "recursive" option on both OSX and Windows
|
|
12596
12596
|
// (ref: https://github.com/nodejs/node/pull/2649 and https://github.com/Microsoft/TypeScript/issues/4643)
|
|
12597
12597
|
fsSupportsRecursiveFsWatch,
|
|
12598
|
-
getAccessibleSortedChildDirectories: (
|
|
12598
|
+
getAccessibleSortedChildDirectories: (path22) => getAccessibleFileSystemEntries(path22).directories,
|
|
12599
12599
|
realpath,
|
|
12600
12600
|
tscWatchFile: process.env.TSC_WATCHFILE,
|
|
12601
12601
|
useNonPollingWatchers: !!process.env.TSC_NONPOLLING_WATCHER,
|
|
@@ -12622,7 +12622,7 @@ ${lanes.join("\n")}
|
|
|
12622
12622
|
watchFile: watchFile2,
|
|
12623
12623
|
watchDirectory,
|
|
12624
12624
|
preferNonRecursiveWatch: !fsSupportsRecursiveFsWatch,
|
|
12625
|
-
resolvePath: (
|
|
12625
|
+
resolvePath: (path22) => _path.resolve(path22),
|
|
12626
12626
|
fileExists,
|
|
12627
12627
|
directoryExists,
|
|
12628
12628
|
getAccessibleFileSystemEntries,
|
|
@@ -12657,8 +12657,8 @@ ${lanes.join("\n")}
|
|
|
12657
12657
|
}
|
|
12658
12658
|
return process.memoryUsage().heapUsed;
|
|
12659
12659
|
},
|
|
12660
|
-
getFileSize(
|
|
12661
|
-
const stat = statSync(
|
|
12660
|
+
getFileSize(path22) {
|
|
12661
|
+
const stat = statSync(path22);
|
|
12662
12662
|
if (stat == null ? void 0 : stat.isFile()) {
|
|
12663
12663
|
return stat.size;
|
|
12664
12664
|
}
|
|
@@ -12702,14 +12702,14 @@ ${lanes.join("\n")}
|
|
|
12702
12702
|
}
|
|
12703
12703
|
};
|
|
12704
12704
|
return nodeSystem;
|
|
12705
|
-
function statSync(
|
|
12705
|
+
function statSync(path22) {
|
|
12706
12706
|
try {
|
|
12707
|
-
return _fs.statSync(
|
|
12707
|
+
return _fs.statSync(path22, statSyncOptions);
|
|
12708
12708
|
} catch {
|
|
12709
12709
|
return void 0;
|
|
12710
12710
|
}
|
|
12711
12711
|
}
|
|
12712
|
-
function enableCPUProfiler(
|
|
12712
|
+
function enableCPUProfiler(path22, cb) {
|
|
12713
12713
|
if (activeSession) {
|
|
12714
12714
|
cb();
|
|
12715
12715
|
return false;
|
|
@@ -12724,7 +12724,7 @@ ${lanes.join("\n")}
|
|
|
12724
12724
|
session.post("Profiler.enable", () => {
|
|
12725
12725
|
session.post("Profiler.start", () => {
|
|
12726
12726
|
activeSession = session;
|
|
12727
|
-
profilePath =
|
|
12727
|
+
profilePath = path22;
|
|
12728
12728
|
cb();
|
|
12729
12729
|
});
|
|
12730
12730
|
});
|
|
@@ -12868,9 +12868,9 @@ ${lanes.join("\n")}
|
|
|
12868
12868
|
}
|
|
12869
12869
|
}
|
|
12870
12870
|
}
|
|
12871
|
-
function getAccessibleFileSystemEntries(
|
|
12871
|
+
function getAccessibleFileSystemEntries(path22) {
|
|
12872
12872
|
try {
|
|
12873
|
-
const entries = _fs.readdirSync(
|
|
12873
|
+
const entries = _fs.readdirSync(path22 || ".", { withFileTypes: true });
|
|
12874
12874
|
const files = [];
|
|
12875
12875
|
const directories = [];
|
|
12876
12876
|
for (const dirent of entries) {
|
|
@@ -12880,7 +12880,7 @@ ${lanes.join("\n")}
|
|
|
12880
12880
|
}
|
|
12881
12881
|
let stat;
|
|
12882
12882
|
if (typeof dirent === "string" || dirent.isSymbolicLink()) {
|
|
12883
|
-
const name = combinePaths(
|
|
12883
|
+
const name = combinePaths(path22, entry);
|
|
12884
12884
|
stat = statSync(name);
|
|
12885
12885
|
if (!stat) {
|
|
12886
12886
|
continue;
|
|
@@ -12901,11 +12901,11 @@ ${lanes.join("\n")}
|
|
|
12901
12901
|
return emptyFileSystemEntries;
|
|
12902
12902
|
}
|
|
12903
12903
|
}
|
|
12904
|
-
function readDirectory(
|
|
12905
|
-
return matchFiles(
|
|
12904
|
+
function readDirectory(path22, extensions, excludes, includes, depth) {
|
|
12905
|
+
return matchFiles(path22, extensions, excludes, includes, useCaseSensitiveFileNames2, process.cwd(), depth, getAccessibleFileSystemEntries, realpath);
|
|
12906
12906
|
}
|
|
12907
|
-
function fileSystemEntryExists(
|
|
12908
|
-
const stat = statSync(
|
|
12907
|
+
function fileSystemEntryExists(path22, entryKind) {
|
|
12908
|
+
const stat = statSync(path22);
|
|
12909
12909
|
if (!stat) {
|
|
12910
12910
|
return false;
|
|
12911
12911
|
}
|
|
@@ -12918,47 +12918,47 @@ ${lanes.join("\n")}
|
|
|
12918
12918
|
return false;
|
|
12919
12919
|
}
|
|
12920
12920
|
}
|
|
12921
|
-
function fileExists(
|
|
12921
|
+
function fileExists(path22) {
|
|
12922
12922
|
return fileSystemEntryExists(
|
|
12923
|
-
|
|
12923
|
+
path22,
|
|
12924
12924
|
0
|
|
12925
12925
|
/* File */
|
|
12926
12926
|
);
|
|
12927
12927
|
}
|
|
12928
|
-
function directoryExists(
|
|
12928
|
+
function directoryExists(path22) {
|
|
12929
12929
|
return fileSystemEntryExists(
|
|
12930
|
-
|
|
12930
|
+
path22,
|
|
12931
12931
|
1
|
|
12932
12932
|
/* Directory */
|
|
12933
12933
|
);
|
|
12934
12934
|
}
|
|
12935
|
-
function getDirectories(
|
|
12936
|
-
return getAccessibleFileSystemEntries(
|
|
12935
|
+
function getDirectories(path22) {
|
|
12936
|
+
return getAccessibleFileSystemEntries(path22).directories.slice();
|
|
12937
12937
|
}
|
|
12938
|
-
function fsRealPathHandlingLongPath(
|
|
12939
|
-
return
|
|
12938
|
+
function fsRealPathHandlingLongPath(path22) {
|
|
12939
|
+
return path22.length < 260 ? _fs.realpathSync.native(path22) : _fs.realpathSync(path22);
|
|
12940
12940
|
}
|
|
12941
|
-
function realpath(
|
|
12941
|
+
function realpath(path22) {
|
|
12942
12942
|
try {
|
|
12943
|
-
return fsRealpath(
|
|
12943
|
+
return fsRealpath(path22);
|
|
12944
12944
|
} catch {
|
|
12945
|
-
return
|
|
12945
|
+
return path22;
|
|
12946
12946
|
}
|
|
12947
12947
|
}
|
|
12948
|
-
function getModifiedTime3(
|
|
12948
|
+
function getModifiedTime3(path22) {
|
|
12949
12949
|
var _a3;
|
|
12950
|
-
return (_a3 = statSync(
|
|
12950
|
+
return (_a3 = statSync(path22)) == null ? void 0 : _a3.mtime;
|
|
12951
12951
|
}
|
|
12952
|
-
function setModifiedTime(
|
|
12952
|
+
function setModifiedTime(path22, time3) {
|
|
12953
12953
|
try {
|
|
12954
|
-
_fs.utimesSync(
|
|
12954
|
+
_fs.utimesSync(path22, time3, time3);
|
|
12955
12955
|
} catch {
|
|
12956
12956
|
return;
|
|
12957
12957
|
}
|
|
12958
12958
|
}
|
|
12959
|
-
function deleteFile(
|
|
12959
|
+
function deleteFile(path22) {
|
|
12960
12960
|
try {
|
|
12961
|
-
return _fs.unlinkSync(
|
|
12961
|
+
return _fs.unlinkSync(path22);
|
|
12962
12962
|
} catch {
|
|
12963
12963
|
return;
|
|
12964
12964
|
}
|
|
@@ -12998,41 +12998,41 @@ ${lanes.join("\n")}
|
|
|
12998
12998
|
function isAnyDirectorySeparator(charCode) {
|
|
12999
12999
|
return charCode === 47 || charCode === 92;
|
|
13000
13000
|
}
|
|
13001
|
-
function isUrl(
|
|
13002
|
-
return getEncodedRootLength(
|
|
13001
|
+
function isUrl(path22) {
|
|
13002
|
+
return getEncodedRootLength(path22) < 0;
|
|
13003
13003
|
}
|
|
13004
|
-
function isRootedDiskPath(
|
|
13005
|
-
return getEncodedRootLength(
|
|
13004
|
+
function isRootedDiskPath(path22) {
|
|
13005
|
+
return getEncodedRootLength(path22) > 0;
|
|
13006
13006
|
}
|
|
13007
|
-
function isDiskPathRoot(
|
|
13008
|
-
const rootLength = getEncodedRootLength(
|
|
13009
|
-
return rootLength > 0 && rootLength ===
|
|
13007
|
+
function isDiskPathRoot(path22) {
|
|
13008
|
+
const rootLength = getEncodedRootLength(path22);
|
|
13009
|
+
return rootLength > 0 && rootLength === path22.length;
|
|
13010
13010
|
}
|
|
13011
|
-
function pathIsAbsolute(
|
|
13012
|
-
return getEncodedRootLength(
|
|
13011
|
+
function pathIsAbsolute(path22) {
|
|
13012
|
+
return getEncodedRootLength(path22) !== 0;
|
|
13013
13013
|
}
|
|
13014
|
-
function pathIsRelative(
|
|
13015
|
-
return /^\.\.?(?:$|[\\/])/.test(
|
|
13014
|
+
function pathIsRelative(path22) {
|
|
13015
|
+
return /^\.\.?(?:$|[\\/])/.test(path22);
|
|
13016
13016
|
}
|
|
13017
|
-
function pathIsBareSpecifier(
|
|
13018
|
-
return !pathIsAbsolute(
|
|
13017
|
+
function pathIsBareSpecifier(path22) {
|
|
13018
|
+
return !pathIsAbsolute(path22) && !pathIsRelative(path22);
|
|
13019
13019
|
}
|
|
13020
13020
|
function hasExtension(fileName) {
|
|
13021
13021
|
return getBaseFileName(fileName).includes(".");
|
|
13022
13022
|
}
|
|
13023
|
-
function fileExtensionIs(
|
|
13024
|
-
return
|
|
13023
|
+
function fileExtensionIs(path22, extension) {
|
|
13024
|
+
return path22.length > extension.length && endsWith(path22, extension);
|
|
13025
13025
|
}
|
|
13026
|
-
function fileExtensionIsOneOf(
|
|
13026
|
+
function fileExtensionIsOneOf(path22, extensions) {
|
|
13027
13027
|
for (const extension of extensions) {
|
|
13028
|
-
if (fileExtensionIs(
|
|
13028
|
+
if (fileExtensionIs(path22, extension)) {
|
|
13029
13029
|
return true;
|
|
13030
13030
|
}
|
|
13031
13031
|
}
|
|
13032
13032
|
return false;
|
|
13033
13033
|
}
|
|
13034
|
-
function hasTrailingDirectorySeparator(
|
|
13035
|
-
return
|
|
13034
|
+
function hasTrailingDirectorySeparator(path22) {
|
|
13035
|
+
return path22.length > 0 && isAnyDirectorySeparator(path22.charCodeAt(path22.length - 1));
|
|
13036
13036
|
}
|
|
13037
13037
|
function isVolumeCharacter(charCode) {
|
|
13038
13038
|
return charCode >= 97 && charCode <= 122 || charCode >= 65 && charCode <= 90;
|
|
@@ -13046,111 +13046,111 @@ ${lanes.join("\n")}
|
|
|
13046
13046
|
}
|
|
13047
13047
|
return -1;
|
|
13048
13048
|
}
|
|
13049
|
-
function getEncodedRootLength(
|
|
13050
|
-
if (!
|
|
13051
|
-
const ch0 =
|
|
13049
|
+
function getEncodedRootLength(path22) {
|
|
13050
|
+
if (!path22) return 0;
|
|
13051
|
+
const ch0 = path22.charCodeAt(0);
|
|
13052
13052
|
if (ch0 === 47 || ch0 === 92) {
|
|
13053
|
-
if (
|
|
13054
|
-
const p1 =
|
|
13055
|
-
if (p1 < 0) return
|
|
13053
|
+
if (path22.charCodeAt(1) !== ch0) return 1;
|
|
13054
|
+
const p1 = path22.indexOf(ch0 === 47 ? directorySeparator : altDirectorySeparator, 2);
|
|
13055
|
+
if (p1 < 0) return path22.length;
|
|
13056
13056
|
return p1 + 1;
|
|
13057
13057
|
}
|
|
13058
|
-
if (isVolumeCharacter(ch0) &&
|
|
13059
|
-
const ch2 =
|
|
13058
|
+
if (isVolumeCharacter(ch0) && path22.charCodeAt(1) === 58) {
|
|
13059
|
+
const ch2 = path22.charCodeAt(2);
|
|
13060
13060
|
if (ch2 === 47 || ch2 === 92) return 3;
|
|
13061
|
-
if (
|
|
13061
|
+
if (path22.length === 2) return 2;
|
|
13062
13062
|
}
|
|
13063
|
-
const schemeEnd =
|
|
13063
|
+
const schemeEnd = path22.indexOf(urlSchemeSeparator);
|
|
13064
13064
|
if (schemeEnd !== -1) {
|
|
13065
13065
|
const authorityStart = schemeEnd + urlSchemeSeparator.length;
|
|
13066
|
-
const authorityEnd =
|
|
13066
|
+
const authorityEnd = path22.indexOf(directorySeparator, authorityStart);
|
|
13067
13067
|
if (authorityEnd !== -1) {
|
|
13068
|
-
const scheme =
|
|
13069
|
-
const authority =
|
|
13070
|
-
if (scheme === "file" && (authority === "" || authority === "localhost") && isVolumeCharacter(
|
|
13071
|
-
const volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(
|
|
13068
|
+
const scheme = path22.slice(0, schemeEnd);
|
|
13069
|
+
const authority = path22.slice(authorityStart, authorityEnd);
|
|
13070
|
+
if (scheme === "file" && (authority === "" || authority === "localhost") && isVolumeCharacter(path22.charCodeAt(authorityEnd + 1))) {
|
|
13071
|
+
const volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(path22, authorityEnd + 2);
|
|
13072
13072
|
if (volumeSeparatorEnd !== -1) {
|
|
13073
|
-
if (
|
|
13073
|
+
if (path22.charCodeAt(volumeSeparatorEnd) === 47) {
|
|
13074
13074
|
return ~(volumeSeparatorEnd + 1);
|
|
13075
13075
|
}
|
|
13076
|
-
if (volumeSeparatorEnd ===
|
|
13076
|
+
if (volumeSeparatorEnd === path22.length) {
|
|
13077
13077
|
return ~volumeSeparatorEnd;
|
|
13078
13078
|
}
|
|
13079
13079
|
}
|
|
13080
13080
|
}
|
|
13081
13081
|
return ~(authorityEnd + 1);
|
|
13082
13082
|
}
|
|
13083
|
-
return ~
|
|
13083
|
+
return ~path22.length;
|
|
13084
13084
|
}
|
|
13085
13085
|
return 0;
|
|
13086
13086
|
}
|
|
13087
|
-
function getRootLength(
|
|
13088
|
-
const rootLength = getEncodedRootLength(
|
|
13087
|
+
function getRootLength(path22) {
|
|
13088
|
+
const rootLength = getEncodedRootLength(path22);
|
|
13089
13089
|
return rootLength < 0 ? ~rootLength : rootLength;
|
|
13090
13090
|
}
|
|
13091
|
-
function getDirectoryPath(
|
|
13092
|
-
|
|
13093
|
-
const rootLength = getRootLength(
|
|
13094
|
-
if (rootLength ===
|
|
13095
|
-
|
|
13096
|
-
return
|
|
13097
|
-
}
|
|
13098
|
-
function getBaseFileName(
|
|
13099
|
-
|
|
13100
|
-
const rootLength = getRootLength(
|
|
13101
|
-
if (rootLength ===
|
|
13102
|
-
|
|
13103
|
-
const name =
|
|
13091
|
+
function getDirectoryPath(path22) {
|
|
13092
|
+
path22 = normalizeSlashes(path22);
|
|
13093
|
+
const rootLength = getRootLength(path22);
|
|
13094
|
+
if (rootLength === path22.length) return path22;
|
|
13095
|
+
path22 = removeTrailingDirectorySeparator(path22);
|
|
13096
|
+
return path22.slice(0, Math.max(rootLength, path22.lastIndexOf(directorySeparator)));
|
|
13097
|
+
}
|
|
13098
|
+
function getBaseFileName(path22, extensions, ignoreCase) {
|
|
13099
|
+
path22 = normalizeSlashes(path22);
|
|
13100
|
+
const rootLength = getRootLength(path22);
|
|
13101
|
+
if (rootLength === path22.length) return "";
|
|
13102
|
+
path22 = removeTrailingDirectorySeparator(path22);
|
|
13103
|
+
const name = path22.slice(Math.max(getRootLength(path22), path22.lastIndexOf(directorySeparator) + 1));
|
|
13104
13104
|
const extension = extensions !== void 0 && ignoreCase !== void 0 ? getAnyExtensionFromPath(name, extensions, ignoreCase) : void 0;
|
|
13105
13105
|
return extension ? name.slice(0, name.length - extension.length) : name;
|
|
13106
13106
|
}
|
|
13107
|
-
function tryGetExtensionFromPath(
|
|
13107
|
+
function tryGetExtensionFromPath(path22, extension, stringEqualityComparer) {
|
|
13108
13108
|
if (!startsWith(extension, ".")) extension = "." + extension;
|
|
13109
|
-
if (
|
|
13110
|
-
const pathExtension =
|
|
13109
|
+
if (path22.length >= extension.length && path22.charCodeAt(path22.length - extension.length) === 46) {
|
|
13110
|
+
const pathExtension = path22.slice(path22.length - extension.length);
|
|
13111
13111
|
if (stringEqualityComparer(pathExtension, extension)) {
|
|
13112
13112
|
return pathExtension;
|
|
13113
13113
|
}
|
|
13114
13114
|
}
|
|
13115
13115
|
}
|
|
13116
|
-
function getAnyExtensionFromPathWorker(
|
|
13116
|
+
function getAnyExtensionFromPathWorker(path22, extensions, stringEqualityComparer) {
|
|
13117
13117
|
if (typeof extensions === "string") {
|
|
13118
|
-
return tryGetExtensionFromPath(
|
|
13118
|
+
return tryGetExtensionFromPath(path22, extensions, stringEqualityComparer) || "";
|
|
13119
13119
|
}
|
|
13120
13120
|
for (const extension of extensions) {
|
|
13121
|
-
const result = tryGetExtensionFromPath(
|
|
13121
|
+
const result = tryGetExtensionFromPath(path22, extension, stringEqualityComparer);
|
|
13122
13122
|
if (result) return result;
|
|
13123
13123
|
}
|
|
13124
13124
|
return "";
|
|
13125
13125
|
}
|
|
13126
|
-
function getAnyExtensionFromPath(
|
|
13126
|
+
function getAnyExtensionFromPath(path22, extensions, ignoreCase) {
|
|
13127
13127
|
if (extensions) {
|
|
13128
|
-
return getAnyExtensionFromPathWorker(removeTrailingDirectorySeparator(
|
|
13128
|
+
return getAnyExtensionFromPathWorker(removeTrailingDirectorySeparator(path22), extensions, ignoreCase ? equateStringsCaseInsensitive : equateStringsCaseSensitive);
|
|
13129
13129
|
}
|
|
13130
|
-
const baseFileName = getBaseFileName(
|
|
13130
|
+
const baseFileName = getBaseFileName(path22);
|
|
13131
13131
|
const extensionIndex = baseFileName.lastIndexOf(".");
|
|
13132
13132
|
if (extensionIndex >= 0) {
|
|
13133
13133
|
return baseFileName.substring(extensionIndex);
|
|
13134
13134
|
}
|
|
13135
13135
|
return "";
|
|
13136
13136
|
}
|
|
13137
|
-
function pathComponents(
|
|
13138
|
-
const root =
|
|
13139
|
-
const rest =
|
|
13137
|
+
function pathComponents(path22, rootLength) {
|
|
13138
|
+
const root = path22.substring(0, rootLength);
|
|
13139
|
+
const rest = path22.substring(rootLength).split(directorySeparator);
|
|
13140
13140
|
if (rest.length && !lastOrUndefined(rest)) rest.pop();
|
|
13141
13141
|
return [root, ...rest];
|
|
13142
13142
|
}
|
|
13143
|
-
function getPathComponents(
|
|
13144
|
-
|
|
13145
|
-
return pathComponents(
|
|
13143
|
+
function getPathComponents(path22, currentDirectory = "") {
|
|
13144
|
+
path22 = combinePaths(currentDirectory, path22);
|
|
13145
|
+
return pathComponents(path22, getRootLength(path22));
|
|
13146
13146
|
}
|
|
13147
13147
|
function getPathFromPathComponents(pathComponents2, length2) {
|
|
13148
13148
|
if (pathComponents2.length === 0) return "";
|
|
13149
13149
|
const root = pathComponents2[0] && ensureTrailingDirectorySeparator(pathComponents2[0]);
|
|
13150
13150
|
return root + pathComponents2.slice(1, length2).join(directorySeparator);
|
|
13151
13151
|
}
|
|
13152
|
-
function normalizeSlashes(
|
|
13153
|
-
return
|
|
13152
|
+
function normalizeSlashes(path22) {
|
|
13153
|
+
return path22.includes("\\") ? path22.replace(backslashRegExp, directorySeparator) : path22;
|
|
13154
13154
|
}
|
|
13155
13155
|
function reducePathComponents(components) {
|
|
13156
13156
|
if (!some(components)) return [];
|
|
@@ -13171,39 +13171,39 @@ ${lanes.join("\n")}
|
|
|
13171
13171
|
}
|
|
13172
13172
|
return reduced;
|
|
13173
13173
|
}
|
|
13174
|
-
function combinePaths(
|
|
13175
|
-
if (
|
|
13174
|
+
function combinePaths(path22, ...paths) {
|
|
13175
|
+
if (path22) path22 = normalizeSlashes(path22);
|
|
13176
13176
|
for (let relativePath of paths) {
|
|
13177
13177
|
if (!relativePath) continue;
|
|
13178
13178
|
relativePath = normalizeSlashes(relativePath);
|
|
13179
|
-
if (!
|
|
13180
|
-
|
|
13179
|
+
if (!path22 || getRootLength(relativePath) !== 0) {
|
|
13180
|
+
path22 = relativePath;
|
|
13181
13181
|
} else {
|
|
13182
|
-
|
|
13182
|
+
path22 = ensureTrailingDirectorySeparator(path22) + relativePath;
|
|
13183
13183
|
}
|
|
13184
13184
|
}
|
|
13185
|
-
return
|
|
13185
|
+
return path22;
|
|
13186
13186
|
}
|
|
13187
|
-
function resolvePath(
|
|
13188
|
-
return normalizePath(some(paths) ? combinePaths(
|
|
13187
|
+
function resolvePath(path22, ...paths) {
|
|
13188
|
+
return normalizePath(some(paths) ? combinePaths(path22, ...paths) : normalizeSlashes(path22));
|
|
13189
13189
|
}
|
|
13190
|
-
function getNormalizedPathComponents(
|
|
13191
|
-
return reducePathComponents(getPathComponents(
|
|
13190
|
+
function getNormalizedPathComponents(path22, currentDirectory) {
|
|
13191
|
+
return reducePathComponents(getPathComponents(path22, currentDirectory));
|
|
13192
13192
|
}
|
|
13193
|
-
function getNormalizedAbsolutePath(
|
|
13194
|
-
let rootLength = getRootLength(
|
|
13193
|
+
function getNormalizedAbsolutePath(path22, currentDirectory) {
|
|
13194
|
+
let rootLength = getRootLength(path22);
|
|
13195
13195
|
if (rootLength === 0 && currentDirectory) {
|
|
13196
|
-
|
|
13197
|
-
rootLength = getRootLength(
|
|
13196
|
+
path22 = combinePaths(currentDirectory, path22);
|
|
13197
|
+
rootLength = getRootLength(path22);
|
|
13198
13198
|
} else {
|
|
13199
|
-
|
|
13199
|
+
path22 = normalizeSlashes(path22);
|
|
13200
13200
|
}
|
|
13201
|
-
const simpleNormalized = simpleNormalizePath(
|
|
13201
|
+
const simpleNormalized = simpleNormalizePath(path22);
|
|
13202
13202
|
if (simpleNormalized !== void 0) {
|
|
13203
13203
|
return simpleNormalized.length > rootLength ? removeTrailingDirectorySeparator(simpleNormalized) : simpleNormalized;
|
|
13204
13204
|
}
|
|
13205
|
-
const length2 =
|
|
13206
|
-
const root =
|
|
13205
|
+
const length2 = path22.length;
|
|
13206
|
+
const root = path22.substring(0, rootLength);
|
|
13207
13207
|
let normalized;
|
|
13208
13208
|
let index = rootLength;
|
|
13209
13209
|
let segmentStart = index;
|
|
@@ -13211,23 +13211,23 @@ ${lanes.join("\n")}
|
|
|
13211
13211
|
let seenNonDotDotSegment = rootLength !== 0;
|
|
13212
13212
|
while (index < length2) {
|
|
13213
13213
|
segmentStart = index;
|
|
13214
|
-
let ch =
|
|
13214
|
+
let ch = path22.charCodeAt(index);
|
|
13215
13215
|
while (ch === 47 && index + 1 < length2) {
|
|
13216
13216
|
index++;
|
|
13217
|
-
ch =
|
|
13217
|
+
ch = path22.charCodeAt(index);
|
|
13218
13218
|
}
|
|
13219
13219
|
if (index > segmentStart) {
|
|
13220
|
-
normalized ?? (normalized =
|
|
13220
|
+
normalized ?? (normalized = path22.substring(0, segmentStart - 1));
|
|
13221
13221
|
segmentStart = index;
|
|
13222
13222
|
}
|
|
13223
|
-
let segmentEnd =
|
|
13223
|
+
let segmentEnd = path22.indexOf(directorySeparator, index + 1);
|
|
13224
13224
|
if (segmentEnd === -1) {
|
|
13225
13225
|
segmentEnd = length2;
|
|
13226
13226
|
}
|
|
13227
13227
|
const segmentLength = segmentEnd - segmentStart;
|
|
13228
|
-
if (segmentLength === 1 &&
|
|
13229
|
-
normalized ?? (normalized =
|
|
13230
|
-
} else if (segmentLength === 2 &&
|
|
13228
|
+
if (segmentLength === 1 && path22.charCodeAt(index) === 46) {
|
|
13229
|
+
normalized ?? (normalized = path22.substring(0, normalizedUpTo));
|
|
13230
|
+
} else if (segmentLength === 2 && path22.charCodeAt(index) === 46 && path22.charCodeAt(index + 1) === 46) {
|
|
13231
13231
|
if (!seenNonDotDotSegment) {
|
|
13232
13232
|
if (normalized !== void 0) {
|
|
13233
13233
|
normalized += normalized.length === rootLength ? ".." : "/..";
|
|
@@ -13236,9 +13236,9 @@ ${lanes.join("\n")}
|
|
|
13236
13236
|
}
|
|
13237
13237
|
} else if (normalized === void 0) {
|
|
13238
13238
|
if (normalizedUpTo - 2 >= 0) {
|
|
13239
|
-
normalized =
|
|
13239
|
+
normalized = path22.substring(0, Math.max(rootLength, path22.lastIndexOf(directorySeparator, normalizedUpTo - 2)));
|
|
13240
13240
|
} else {
|
|
13241
|
-
normalized =
|
|
13241
|
+
normalized = path22.substring(0, normalizedUpTo);
|
|
13242
13242
|
}
|
|
13243
13243
|
} else {
|
|
13244
13244
|
const lastSlash = normalized.lastIndexOf(directorySeparator);
|
|
@@ -13256,36 +13256,36 @@ ${lanes.join("\n")}
|
|
|
13256
13256
|
normalized += directorySeparator;
|
|
13257
13257
|
}
|
|
13258
13258
|
seenNonDotDotSegment = true;
|
|
13259
|
-
normalized +=
|
|
13259
|
+
normalized += path22.substring(segmentStart, segmentEnd);
|
|
13260
13260
|
} else {
|
|
13261
13261
|
seenNonDotDotSegment = true;
|
|
13262
13262
|
normalizedUpTo = segmentEnd;
|
|
13263
13263
|
}
|
|
13264
13264
|
index = segmentEnd + 1;
|
|
13265
13265
|
}
|
|
13266
|
-
return normalized ?? (length2 > rootLength ? removeTrailingDirectorySeparator(
|
|
13266
|
+
return normalized ?? (length2 > rootLength ? removeTrailingDirectorySeparator(path22) : path22);
|
|
13267
13267
|
}
|
|
13268
|
-
function normalizePath(
|
|
13269
|
-
|
|
13270
|
-
let normalized = simpleNormalizePath(
|
|
13268
|
+
function normalizePath(path22) {
|
|
13269
|
+
path22 = normalizeSlashes(path22);
|
|
13270
|
+
let normalized = simpleNormalizePath(path22);
|
|
13271
13271
|
if (normalized !== void 0) {
|
|
13272
13272
|
return normalized;
|
|
13273
13273
|
}
|
|
13274
|
-
normalized = getNormalizedAbsolutePath(
|
|
13275
|
-
return normalized && hasTrailingDirectorySeparator(
|
|
13274
|
+
normalized = getNormalizedAbsolutePath(path22, "");
|
|
13275
|
+
return normalized && hasTrailingDirectorySeparator(path22) ? ensureTrailingDirectorySeparator(normalized) : normalized;
|
|
13276
13276
|
}
|
|
13277
|
-
function simpleNormalizePath(
|
|
13278
|
-
if (!relativePathSegmentRegExp.test(
|
|
13279
|
-
return
|
|
13277
|
+
function simpleNormalizePath(path22) {
|
|
13278
|
+
if (!relativePathSegmentRegExp.test(path22)) {
|
|
13279
|
+
return path22;
|
|
13280
13280
|
}
|
|
13281
|
-
let simplified =
|
|
13281
|
+
let simplified = path22.replace(/\/\.\//g, "/");
|
|
13282
13282
|
if (simplified.startsWith("./")) {
|
|
13283
13283
|
simplified = simplified.slice(2);
|
|
13284
13284
|
}
|
|
13285
|
-
if (simplified !==
|
|
13286
|
-
|
|
13287
|
-
if (!relativePathSegmentRegExp.test(
|
|
13288
|
-
return
|
|
13285
|
+
if (simplified !== path22) {
|
|
13286
|
+
path22 = simplified;
|
|
13287
|
+
if (!relativePathSegmentRegExp.test(path22)) {
|
|
13288
|
+
return path22;
|
|
13289
13289
|
}
|
|
13290
13290
|
}
|
|
13291
13291
|
return void 0;
|
|
@@ -13301,31 +13301,31 @@ ${lanes.join("\n")}
|
|
|
13301
13301
|
const nonCanonicalizedPath = isRootedDiskPath(fileName) ? normalizePath(fileName) : getNormalizedAbsolutePath(fileName, basePath);
|
|
13302
13302
|
return getCanonicalFileName(nonCanonicalizedPath);
|
|
13303
13303
|
}
|
|
13304
|
-
function removeTrailingDirectorySeparator(
|
|
13305
|
-
if (hasTrailingDirectorySeparator(
|
|
13306
|
-
return
|
|
13304
|
+
function removeTrailingDirectorySeparator(path22) {
|
|
13305
|
+
if (hasTrailingDirectorySeparator(path22)) {
|
|
13306
|
+
return path22.substr(0, path22.length - 1);
|
|
13307
13307
|
}
|
|
13308
|
-
return
|
|
13308
|
+
return path22;
|
|
13309
13309
|
}
|
|
13310
|
-
function ensureTrailingDirectorySeparator(
|
|
13311
|
-
if (!hasTrailingDirectorySeparator(
|
|
13312
|
-
return
|
|
13310
|
+
function ensureTrailingDirectorySeparator(path22) {
|
|
13311
|
+
if (!hasTrailingDirectorySeparator(path22)) {
|
|
13312
|
+
return path22 + directorySeparator;
|
|
13313
13313
|
}
|
|
13314
|
-
return
|
|
13314
|
+
return path22;
|
|
13315
13315
|
}
|
|
13316
|
-
function ensurePathIsNonModuleName(
|
|
13317
|
-
return !pathIsAbsolute(
|
|
13316
|
+
function ensurePathIsNonModuleName(path22) {
|
|
13317
|
+
return !pathIsAbsolute(path22) && !pathIsRelative(path22) ? "./" + path22 : path22;
|
|
13318
13318
|
}
|
|
13319
|
-
function changeAnyExtension(
|
|
13320
|
-
const pathext = extensions !== void 0 && ignoreCase !== void 0 ? getAnyExtensionFromPath(
|
|
13321
|
-
return pathext ?
|
|
13319
|
+
function changeAnyExtension(path22, ext, extensions, ignoreCase) {
|
|
13320
|
+
const pathext = extensions !== void 0 && ignoreCase !== void 0 ? getAnyExtensionFromPath(path22, extensions, ignoreCase) : getAnyExtensionFromPath(path22);
|
|
13321
|
+
return pathext ? path22.slice(0, path22.length - pathext.length) + (startsWith(ext, ".") ? ext : "." + ext) : path22;
|
|
13322
13322
|
}
|
|
13323
|
-
function changeFullExtension(
|
|
13324
|
-
const declarationExtension = getDeclarationFileExtension(
|
|
13323
|
+
function changeFullExtension(path22, newExtension) {
|
|
13324
|
+
const declarationExtension = getDeclarationFileExtension(path22);
|
|
13325
13325
|
if (declarationExtension) {
|
|
13326
|
-
return
|
|
13326
|
+
return path22.slice(0, path22.length - declarationExtension.length) + (startsWith(newExtension, ".") ? newExtension : "." + newExtension);
|
|
13327
13327
|
}
|
|
13328
|
-
return changeAnyExtension(
|
|
13328
|
+
return changeAnyExtension(path22, newExtension);
|
|
13329
13329
|
}
|
|
13330
13330
|
var relativePathSegmentRegExp = /\/\/|(?:^|\/)\.\.?(?:$|\/)/;
|
|
13331
13331
|
function comparePathsWorker(a2, b, componentComparer) {
|
|
@@ -24848,8 +24848,8 @@ ${lanes.join("\n")}
|
|
|
24848
24848
|
function getResolvedExternalModuleName(host, file2, referenceFile) {
|
|
24849
24849
|
return file2.moduleName || getExternalModuleNameFromPath(host, file2.fileName, referenceFile && referenceFile.fileName);
|
|
24850
24850
|
}
|
|
24851
|
-
function getCanonicalAbsolutePath(host,
|
|
24852
|
-
return host.getCanonicalFileName(getNormalizedAbsolutePath(
|
|
24851
|
+
function getCanonicalAbsolutePath(host, path22) {
|
|
24852
|
+
return host.getCanonicalFileName(getNormalizedAbsolutePath(path22, host.getCurrentDirectory()));
|
|
24853
24853
|
}
|
|
24854
24854
|
function getExternalModuleNameFromDeclaration(host, resolver, declaration) {
|
|
24855
24855
|
const file2 = resolver.getExternalModuleFileFromDeclaration(declaration);
|
|
@@ -24892,20 +24892,20 @@ ${lanes.join("\n")}
|
|
|
24892
24892
|
}
|
|
24893
24893
|
function getDeclarationEmitOutputFilePathWorker(fileName, options, host) {
|
|
24894
24894
|
const outputDir = options.declarationDir || options.outDir;
|
|
24895
|
-
const
|
|
24896
|
-
const declarationExtension = getDeclarationEmitExtensionForPath(
|
|
24897
|
-
return removeFileExtension(
|
|
24895
|
+
const path22 = outputDir ? getSourceFilePathInNewDirWorker(fileName, outputDir, host.getCurrentDirectory(), host.getCommonSourceDirectory(), (f) => host.getCanonicalFileName(f)) : fileName;
|
|
24896
|
+
const declarationExtension = getDeclarationEmitExtensionForPath(path22);
|
|
24897
|
+
return removeFileExtension(path22) + declarationExtension;
|
|
24898
24898
|
}
|
|
24899
|
-
function getDeclarationEmitExtensionForPath(
|
|
24900
|
-
return fileExtensionIsOneOf(
|
|
24899
|
+
function getDeclarationEmitExtensionForPath(path22) {
|
|
24900
|
+
return fileExtensionIsOneOf(path22, [
|
|
24901
24901
|
".mjs",
|
|
24902
24902
|
".mts"
|
|
24903
24903
|
/* Mts */
|
|
24904
|
-
]) ? ".d.mts" : fileExtensionIsOneOf(
|
|
24904
|
+
]) ? ".d.mts" : fileExtensionIsOneOf(path22, [
|
|
24905
24905
|
".cjs",
|
|
24906
24906
|
".cts"
|
|
24907
24907
|
/* Cts */
|
|
24908
|
-
]) ? ".d.cts" : fileExtensionIsOneOf(
|
|
24908
|
+
]) ? ".d.cts" : fileExtensionIsOneOf(path22, [
|
|
24909
24909
|
".json"
|
|
24910
24910
|
/* Json */
|
|
24911
24911
|
]) ? `.d.json.ts` : (
|
|
@@ -24913,8 +24913,8 @@ ${lanes.join("\n")}
|
|
|
24913
24913
|
".d.ts"
|
|
24914
24914
|
);
|
|
24915
24915
|
}
|
|
24916
|
-
function getPossibleOriginalInputExtensionForExtension(
|
|
24917
|
-
return fileExtensionIsOneOf(
|
|
24916
|
+
function getPossibleOriginalInputExtensionForExtension(path22) {
|
|
24917
|
+
return fileExtensionIsOneOf(path22, [
|
|
24918
24918
|
".d.mts",
|
|
24919
24919
|
".mjs",
|
|
24920
24920
|
".mts"
|
|
@@ -24923,7 +24923,7 @@ ${lanes.join("\n")}
|
|
|
24923
24923
|
".mts",
|
|
24924
24924
|
".mjs"
|
|
24925
24925
|
/* Mjs */
|
|
24926
|
-
] : fileExtensionIsOneOf(
|
|
24926
|
+
] : fileExtensionIsOneOf(path22, [
|
|
24927
24927
|
".d.cts",
|
|
24928
24928
|
".cjs",
|
|
24929
24929
|
".cts"
|
|
@@ -24932,7 +24932,7 @@ ${lanes.join("\n")}
|
|
|
24932
24932
|
".cts",
|
|
24933
24933
|
".cjs"
|
|
24934
24934
|
/* Cjs */
|
|
24935
|
-
] : fileExtensionIsOneOf(
|
|
24935
|
+
] : fileExtensionIsOneOf(path22, [`.d.json.ts`]) ? [
|
|
24936
24936
|
".json"
|
|
24937
24937
|
/* Json */
|
|
24938
24938
|
] : [
|
|
@@ -25017,12 +25017,12 @@ ${lanes.join("\n")}
|
|
|
25017
25017
|
createDirectory(directoryPath);
|
|
25018
25018
|
}
|
|
25019
25019
|
}
|
|
25020
|
-
function writeFileEnsuringDirectories(
|
|
25020
|
+
function writeFileEnsuringDirectories(path22, data, writeByteOrderMark, writeFile2, createDirectory, directoryExists) {
|
|
25021
25021
|
try {
|
|
25022
|
-
writeFile2(
|
|
25022
|
+
writeFile2(path22, data, writeByteOrderMark);
|
|
25023
25023
|
} catch {
|
|
25024
|
-
ensureDirectoriesExist(getDirectoryPath(normalizePath(
|
|
25025
|
-
writeFile2(
|
|
25024
|
+
ensureDirectoriesExist(getDirectoryPath(normalizePath(path22)), createDirectory, directoryExists);
|
|
25025
|
+
writeFile2(path22, data, writeByteOrderMark);
|
|
25026
25026
|
}
|
|
25027
25027
|
}
|
|
25028
25028
|
function getLineOfLocalPosition(sourceFile, pos) {
|
|
@@ -25722,20 +25722,20 @@ ${lanes.join("\n")}
|
|
|
25722
25722
|
}
|
|
25723
25723
|
return getStringFromExpandedCharCodes(expandedCharCodes);
|
|
25724
25724
|
}
|
|
25725
|
-
function readJsonOrUndefined(
|
|
25726
|
-
const jsonText = isString(hostOrText) ? hostOrText : hostOrText.readFile(
|
|
25725
|
+
function readJsonOrUndefined(path22, hostOrText) {
|
|
25726
|
+
const jsonText = isString(hostOrText) ? hostOrText : hostOrText.readFile(path22);
|
|
25727
25727
|
if (!jsonText) return void 0;
|
|
25728
25728
|
let result = tryParseJson(jsonText);
|
|
25729
25729
|
if (result === void 0) {
|
|
25730
|
-
const looseResult = parseConfigFileTextToJson(
|
|
25730
|
+
const looseResult = parseConfigFileTextToJson(path22, jsonText);
|
|
25731
25731
|
if (!looseResult.error) {
|
|
25732
25732
|
result = looseResult.config;
|
|
25733
25733
|
}
|
|
25734
25734
|
}
|
|
25735
25735
|
return result;
|
|
25736
25736
|
}
|
|
25737
|
-
function readJson2(
|
|
25738
|
-
return readJsonOrUndefined(
|
|
25737
|
+
function readJson2(path22, host) {
|
|
25738
|
+
return readJsonOrUndefined(path22, host) || {};
|
|
25739
25739
|
}
|
|
25740
25740
|
function tryParseJson(text) {
|
|
25741
25741
|
try {
|
|
@@ -26886,7 +26886,7 @@ ${lanes.join("\n")}
|
|
|
26886
26886
|
getSymlinkedFiles: () => symlinkedFiles,
|
|
26887
26887
|
getSymlinkedDirectories: () => symlinkedDirectories,
|
|
26888
26888
|
getSymlinkedDirectoriesByRealpath: () => symlinkedDirectoriesByRealpath,
|
|
26889
|
-
setSymlinkedFile: (
|
|
26889
|
+
setSymlinkedFile: (path22, real) => (symlinkedFiles || (symlinkedFiles = /* @__PURE__ */ new Map())).set(path22, real),
|
|
26890
26890
|
setSymlinkedDirectory: (symlink, real) => {
|
|
26891
26891
|
let symlinkPath = toPath(symlink, cwd, getCanonicalFileName);
|
|
26892
26892
|
if (!containsIgnoredPath(symlinkPath)) {
|
|
@@ -26946,8 +26946,8 @@ ${lanes.join("\n")}
|
|
|
26946
26946
|
function stripLeadingDirectorySeparator(s) {
|
|
26947
26947
|
return isAnyDirectorySeparator(s.charCodeAt(0)) ? s.slice(1) : void 0;
|
|
26948
26948
|
}
|
|
26949
|
-
function tryRemoveDirectoryPrefix(
|
|
26950
|
-
const withoutPrefix = tryRemovePrefix(
|
|
26949
|
+
function tryRemoveDirectoryPrefix(path22, dirPath, getCanonicalFileName) {
|
|
26950
|
+
const withoutPrefix = tryRemovePrefix(path22, dirPath, getCanonicalFileName);
|
|
26951
26951
|
return withoutPrefix === void 0 ? void 0 : stripLeadingDirectorySeparator(withoutPrefix);
|
|
26952
26952
|
}
|
|
26953
26953
|
var reservedCharacterPattern = /[^\w\s/]/g;
|
|
@@ -27073,25 +27073,25 @@ ${lanes.join("\n")}
|
|
|
27073
27073
|
function replaceWildcardCharacter(match, singleAsteriskRegexFragment) {
|
|
27074
27074
|
return match === "*" ? singleAsteriskRegexFragment : match === "?" ? "[^/]" : "\\" + match;
|
|
27075
27075
|
}
|
|
27076
|
-
function getFileMatcherPatterns(
|
|
27077
|
-
|
|
27076
|
+
function getFileMatcherPatterns(path22, excludes, includes, useCaseSensitiveFileNames2, currentDirectory) {
|
|
27077
|
+
path22 = normalizePath(path22);
|
|
27078
27078
|
currentDirectory = normalizePath(currentDirectory);
|
|
27079
|
-
const absolutePath = combinePaths(currentDirectory,
|
|
27079
|
+
const absolutePath = combinePaths(currentDirectory, path22);
|
|
27080
27080
|
return {
|
|
27081
27081
|
includeFilePatterns: map2(getRegularExpressionsForWildcards(includes, absolutePath, "files"), (pattern) => `^${pattern}$`),
|
|
27082
27082
|
includeFilePattern: getRegularExpressionForWildcard(includes, absolutePath, "files"),
|
|
27083
27083
|
includeDirectoryPattern: getRegularExpressionForWildcard(includes, absolutePath, "directories"),
|
|
27084
27084
|
excludePattern: getRegularExpressionForWildcard(excludes, absolutePath, "exclude"),
|
|
27085
|
-
basePaths: getBasePaths(
|
|
27085
|
+
basePaths: getBasePaths(path22, includes, useCaseSensitiveFileNames2)
|
|
27086
27086
|
};
|
|
27087
27087
|
}
|
|
27088
27088
|
function getRegexFromPattern(pattern, useCaseSensitiveFileNames2) {
|
|
27089
27089
|
return new RegExp(pattern, useCaseSensitiveFileNames2 ? "" : "i");
|
|
27090
27090
|
}
|
|
27091
|
-
function matchFiles(
|
|
27092
|
-
|
|
27091
|
+
function matchFiles(path22, extensions, excludes, includes, useCaseSensitiveFileNames2, currentDirectory, depth, getFileSystemEntries, realpath) {
|
|
27092
|
+
path22 = normalizePath(path22);
|
|
27093
27093
|
currentDirectory = normalizePath(currentDirectory);
|
|
27094
|
-
const patterns = getFileMatcherPatterns(
|
|
27094
|
+
const patterns = getFileMatcherPatterns(path22, excludes, includes, useCaseSensitiveFileNames2, currentDirectory);
|
|
27095
27095
|
const includeFileRegexes = patterns.includeFilePatterns && patterns.includeFilePatterns.map((pattern) => getRegexFromPattern(pattern, useCaseSensitiveFileNames2));
|
|
27096
27096
|
const includeDirectoryRegex = patterns.includeDirectoryPattern && getRegexFromPattern(patterns.includeDirectoryPattern, useCaseSensitiveFileNames2);
|
|
27097
27097
|
const excludeRegex = patterns.excludePattern && getRegexFromPattern(patterns.excludePattern, useCaseSensitiveFileNames2);
|
|
@@ -27102,13 +27102,13 @@ ${lanes.join("\n")}
|
|
|
27102
27102
|
visitDirectory(basePath, combinePaths(currentDirectory, basePath), depth);
|
|
27103
27103
|
}
|
|
27104
27104
|
return flatten(results);
|
|
27105
|
-
function visitDirectory(
|
|
27105
|
+
function visitDirectory(path23, absolutePath, depth2) {
|
|
27106
27106
|
const canonicalPath = toCanonical(realpath(absolutePath));
|
|
27107
27107
|
if (visited.has(canonicalPath)) return;
|
|
27108
27108
|
visited.set(canonicalPath, true);
|
|
27109
|
-
const { files, directories } = getFileSystemEntries(
|
|
27109
|
+
const { files, directories } = getFileSystemEntries(path23);
|
|
27110
27110
|
for (const current of toSorted(files, compareStringsCaseSensitive)) {
|
|
27111
|
-
const name = combinePaths(
|
|
27111
|
+
const name = combinePaths(path23, current);
|
|
27112
27112
|
const absoluteName = combinePaths(absolutePath, current);
|
|
27113
27113
|
if (extensions && !fileExtensionIsOneOf(name, extensions)) continue;
|
|
27114
27114
|
if (excludeRegex && excludeRegex.test(absoluteName)) continue;
|
|
@@ -27128,7 +27128,7 @@ ${lanes.join("\n")}
|
|
|
27128
27128
|
}
|
|
27129
27129
|
}
|
|
27130
27130
|
for (const current of toSorted(directories, compareStringsCaseSensitive)) {
|
|
27131
|
-
const name = combinePaths(
|
|
27131
|
+
const name = combinePaths(path23, current);
|
|
27132
27132
|
const absoluteName = combinePaths(absolutePath, current);
|
|
27133
27133
|
if ((!includeDirectoryRegex || includeDirectoryRegex.test(absoluteName)) && (!excludeRegex || !excludeRegex.test(absoluteName))) {
|
|
27134
27134
|
visitDirectory(name, absoluteName, depth2);
|
|
@@ -27136,17 +27136,17 @@ ${lanes.join("\n")}
|
|
|
27136
27136
|
}
|
|
27137
27137
|
}
|
|
27138
27138
|
}
|
|
27139
|
-
function getBasePaths(
|
|
27140
|
-
const basePaths = [
|
|
27139
|
+
function getBasePaths(path22, includes, useCaseSensitiveFileNames2) {
|
|
27140
|
+
const basePaths = [path22];
|
|
27141
27141
|
if (includes) {
|
|
27142
27142
|
const includeBasePaths = [];
|
|
27143
27143
|
for (const include of includes) {
|
|
27144
|
-
const absolute = isRootedDiskPath(include) ? include : normalizePath(combinePaths(
|
|
27144
|
+
const absolute = isRootedDiskPath(include) ? include : normalizePath(combinePaths(path22, include));
|
|
27145
27145
|
includeBasePaths.push(getIncludeBasePath(absolute));
|
|
27146
27146
|
}
|
|
27147
27147
|
includeBasePaths.sort(getStringComparer(!useCaseSensitiveFileNames2));
|
|
27148
27148
|
for (const includeBasePath of includeBasePaths) {
|
|
27149
|
-
if (every(basePaths, (basePath) => !containsPath(basePath, includeBasePath,
|
|
27149
|
+
if (every(basePaths, (basePath) => !containsPath(basePath, includeBasePath, path22, !useCaseSensitiveFileNames2))) {
|
|
27150
27150
|
basePaths.push(includeBasePath);
|
|
27151
27151
|
}
|
|
27152
27152
|
}
|
|
@@ -27410,24 +27410,24 @@ ${lanes.join("\n")}
|
|
|
27410
27410
|
".json"
|
|
27411
27411
|
/* Json */
|
|
27412
27412
|
];
|
|
27413
|
-
function removeFileExtension(
|
|
27413
|
+
function removeFileExtension(path22) {
|
|
27414
27414
|
for (const ext of extensionsToRemove) {
|
|
27415
|
-
const extensionless = tryRemoveExtension(
|
|
27415
|
+
const extensionless = tryRemoveExtension(path22, ext);
|
|
27416
27416
|
if (extensionless !== void 0) {
|
|
27417
27417
|
return extensionless;
|
|
27418
27418
|
}
|
|
27419
27419
|
}
|
|
27420
|
-
return
|
|
27420
|
+
return path22;
|
|
27421
27421
|
}
|
|
27422
|
-
function tryRemoveExtension(
|
|
27423
|
-
return fileExtensionIs(
|
|
27422
|
+
function tryRemoveExtension(path22, extension) {
|
|
27423
|
+
return fileExtensionIs(path22, extension) ? removeExtension(path22, extension) : void 0;
|
|
27424
27424
|
}
|
|
27425
|
-
function removeExtension(
|
|
27426
|
-
return
|
|
27425
|
+
function removeExtension(path22, extension) {
|
|
27426
|
+
return path22.substring(0, path22.length - extension.length);
|
|
27427
27427
|
}
|
|
27428
|
-
function changeExtension(
|
|
27428
|
+
function changeExtension(path22, newExtension) {
|
|
27429
27429
|
return changeAnyExtension(
|
|
27430
|
-
|
|
27430
|
+
path22,
|
|
27431
27431
|
newExtension,
|
|
27432
27432
|
extensionsToRemove,
|
|
27433
27433
|
/*ignoreCase*/
|
|
@@ -27453,8 +27453,8 @@ ${lanes.join("\n")}
|
|
|
27453
27453
|
let matchableStringSet;
|
|
27454
27454
|
let patterns;
|
|
27455
27455
|
const pathList = getOwnKeys(paths);
|
|
27456
|
-
for (const
|
|
27457
|
-
const patternOrStr = tryParsePattern(
|
|
27456
|
+
for (const path22 of pathList) {
|
|
27457
|
+
const patternOrStr = tryParsePattern(path22);
|
|
27458
27458
|
if (patternOrStr === void 0) {
|
|
27459
27459
|
continue;
|
|
27460
27460
|
} else if (typeof patternOrStr === "string") {
|
|
@@ -27481,15 +27481,15 @@ ${lanes.join("\n")}
|
|
|
27481
27481
|
function resolutionExtensionIsTSOrJson(ext) {
|
|
27482
27482
|
return extensionIsTS(ext) || ext === ".json";
|
|
27483
27483
|
}
|
|
27484
|
-
function extensionFromPath(
|
|
27485
|
-
const ext = tryGetExtensionFromPath2(
|
|
27486
|
-
return ext !== void 0 ? ext : Debug.fail(`File ${
|
|
27484
|
+
function extensionFromPath(path22) {
|
|
27485
|
+
const ext = tryGetExtensionFromPath2(path22);
|
|
27486
|
+
return ext !== void 0 ? ext : Debug.fail(`File ${path22} has unknown extension.`);
|
|
27487
27487
|
}
|
|
27488
|
-
function isAnySupportedFileExtension(
|
|
27489
|
-
return tryGetExtensionFromPath2(
|
|
27488
|
+
function isAnySupportedFileExtension(path22) {
|
|
27489
|
+
return tryGetExtensionFromPath2(path22) !== void 0;
|
|
27490
27490
|
}
|
|
27491
|
-
function tryGetExtensionFromPath2(
|
|
27492
|
-
return find(extensionsToRemove, (e) => fileExtensionIs(
|
|
27491
|
+
function tryGetExtensionFromPath2(path22) {
|
|
27492
|
+
return find(extensionsToRemove, (e) => fileExtensionIs(path22, e));
|
|
27493
27493
|
}
|
|
27494
27494
|
function isCheckJsEnabledForFile(sourceFile, compilerOptions) {
|
|
27495
27495
|
return sourceFile.checkJsDirective ? sourceFile.checkJsDirective.enabled : compilerOptions.checkJs;
|
|
@@ -27798,8 +27798,8 @@ ${lanes.join("\n")}
|
|
|
27798
27798
|
return false;
|
|
27799
27799
|
}
|
|
27800
27800
|
}
|
|
27801
|
-
function containsIgnoredPath(
|
|
27802
|
-
return some(ignoredPaths, (p) =>
|
|
27801
|
+
function containsIgnoredPath(path22) {
|
|
27802
|
+
return some(ignoredPaths, (p) => path22.includes(p));
|
|
27803
27803
|
}
|
|
27804
27804
|
function getContainingNodeArray(node) {
|
|
27805
27805
|
if (!node.parent) return void 0;
|
|
@@ -47634,7 +47634,7 @@ ${lanes.join("\n")}
|
|
|
47634
47634
|
const typeReferenceDirectives = context.typeReferenceDirectives;
|
|
47635
47635
|
const libReferenceDirectives = context.libReferenceDirectives;
|
|
47636
47636
|
forEach(toArray(entryOrList), (arg) => {
|
|
47637
|
-
const { types, lib, path:
|
|
47637
|
+
const { types, lib, path: path22, ["resolution-mode"]: res, preserve: _preserve } = arg.arguments;
|
|
47638
47638
|
const preserve = _preserve === "true" ? true : void 0;
|
|
47639
47639
|
if (arg.arguments["no-default-lib"] === "true") {
|
|
47640
47640
|
} else if (types) {
|
|
@@ -47642,8 +47642,8 @@ ${lanes.join("\n")}
|
|
|
47642
47642
|
typeReferenceDirectives.push({ pos: types.pos, end: types.end, fileName: types.value, ...parsed ? { resolutionMode: parsed } : {}, ...preserve ? { preserve } : {} });
|
|
47643
47643
|
} else if (lib) {
|
|
47644
47644
|
libReferenceDirectives.push({ pos: lib.pos, end: lib.end, fileName: lib.value, ...preserve ? { preserve } : {} });
|
|
47645
|
-
} else if (
|
|
47646
|
-
referencedFiles.push({ pos:
|
|
47645
|
+
} else if (path22) {
|
|
47646
|
+
referencedFiles.push({ pos: path22.pos, end: path22.end, fileName: path22.value, ...preserve ? { preserve } : {} });
|
|
47647
47647
|
} else {
|
|
47648
47648
|
reportDiagnostic(arg.range.pos, arg.range.end - arg.range.pos, Diagnostics.Invalid_reference_directive_syntax);
|
|
47649
47649
|
}
|
|
@@ -50102,19 +50102,19 @@ ${lanes.join("\n")}
|
|
|
50102
50102
|
if (specs[0] === defaultIncludeSpec) return void 0;
|
|
50103
50103
|
return specs;
|
|
50104
50104
|
}
|
|
50105
|
-
function matchesSpecs(
|
|
50105
|
+
function matchesSpecs(path22, includeSpecs, excludeSpecs, host) {
|
|
50106
50106
|
if (!includeSpecs) return returnTrue;
|
|
50107
|
-
const patterns = getFileMatcherPatterns(
|
|
50107
|
+
const patterns = getFileMatcherPatterns(path22, excludeSpecs, includeSpecs, host.useCaseSensitiveFileNames, host.getCurrentDirectory());
|
|
50108
50108
|
const excludeRe = patterns.excludePattern && getRegexFromPattern(patterns.excludePattern, host.useCaseSensitiveFileNames);
|
|
50109
50109
|
const includeRe = patterns.includeFilePattern && getRegexFromPattern(patterns.includeFilePattern, host.useCaseSensitiveFileNames);
|
|
50110
50110
|
if (includeRe) {
|
|
50111
50111
|
if (excludeRe) {
|
|
50112
|
-
return (
|
|
50112
|
+
return (path23) => !(includeRe.test(path23) && !excludeRe.test(path23));
|
|
50113
50113
|
}
|
|
50114
|
-
return (
|
|
50114
|
+
return (path23) => !includeRe.test(path23);
|
|
50115
50115
|
}
|
|
50116
50116
|
if (excludeRe) {
|
|
50117
|
-
return (
|
|
50117
|
+
return (path23) => excludeRe.test(path23);
|
|
50118
50118
|
}
|
|
50119
50119
|
return returnTrue;
|
|
50120
50120
|
}
|
|
@@ -50749,9 +50749,9 @@ ${lanes.join("\n")}
|
|
|
50749
50749
|
const setPropertyInResultIfNotUndefined = (propertyName) => {
|
|
50750
50750
|
if (ownConfig.raw[propertyName]) return;
|
|
50751
50751
|
if (extendsRaw[propertyName]) {
|
|
50752
|
-
result[propertyName] = map2(extendsRaw[propertyName], (
|
|
50752
|
+
result[propertyName] = map2(extendsRaw[propertyName], (path22) => startsWithConfigDirTemplate(path22) || isRootedDiskPath(path22) ? path22 : combinePaths(
|
|
50753
50753
|
relativeDifference || (relativeDifference = convertToRelativePath(getDirectoryPath(extendedConfigPath), basePath, createGetCanonicalFileName(host.useCaseSensitiveFileNames))),
|
|
50754
|
-
|
|
50754
|
+
path22
|
|
50755
50755
|
));
|
|
50756
50756
|
}
|
|
50757
50757
|
};
|
|
@@ -50905,14 +50905,14 @@ ${lanes.join("\n")}
|
|
|
50905
50905
|
return void 0;
|
|
50906
50906
|
}
|
|
50907
50907
|
function getExtendedConfig(sourceFile, extendedConfigPath, host, resolutionStack, errors, extendedConfigCache, result) {
|
|
50908
|
-
const
|
|
50908
|
+
const path22 = host.useCaseSensitiveFileNames ? extendedConfigPath : toFileNameLowerCase(extendedConfigPath);
|
|
50909
50909
|
let value;
|
|
50910
50910
|
let extendedResult;
|
|
50911
50911
|
let extendedConfig;
|
|
50912
|
-
if (extendedConfigCache && (value = extendedConfigCache.get(
|
|
50912
|
+
if (extendedConfigCache && (value = extendedConfigCache.get(path22))) {
|
|
50913
50913
|
({ extendedResult, extendedConfig } = value);
|
|
50914
50914
|
} else {
|
|
50915
|
-
extendedResult = readJsonConfigFile(extendedConfigPath, (
|
|
50915
|
+
extendedResult = readJsonConfigFile(extendedConfigPath, (path23) => host.readFile(path23));
|
|
50916
50916
|
if (!extendedResult.parseDiagnostics.length) {
|
|
50917
50917
|
extendedConfig = parseConfig(
|
|
50918
50918
|
/*json*/
|
|
@@ -50927,7 +50927,7 @@ ${lanes.join("\n")}
|
|
|
50927
50927
|
);
|
|
50928
50928
|
}
|
|
50929
50929
|
if (extendedConfigCache) {
|
|
50930
|
-
extendedConfigCache.set(
|
|
50930
|
+
extendedConfigCache.set(path22, { extendedResult, extendedConfig });
|
|
50931
50931
|
}
|
|
50932
50932
|
}
|
|
50933
50933
|
if (sourceFile) {
|
|
@@ -51195,24 +51195,24 @@ ${lanes.join("\n")}
|
|
|
51195
51195
|
}
|
|
51196
51196
|
const match = getWildcardDirectoryFromSpec(spec, useCaseSensitiveFileNames2);
|
|
51197
51197
|
if (match) {
|
|
51198
|
-
const { key, path:
|
|
51198
|
+
const { key, path: path22, flags } = match;
|
|
51199
51199
|
const existingPath = wildCardKeyToPath.get(key);
|
|
51200
51200
|
const existingFlags = existingPath !== void 0 ? wildcardDirectories[existingPath] : void 0;
|
|
51201
51201
|
if (existingFlags === void 0 || existingFlags < flags) {
|
|
51202
|
-
wildcardDirectories[existingPath !== void 0 ? existingPath :
|
|
51203
|
-
if (existingPath === void 0) wildCardKeyToPath.set(key,
|
|
51202
|
+
wildcardDirectories[existingPath !== void 0 ? existingPath : path22] = flags;
|
|
51203
|
+
if (existingPath === void 0) wildCardKeyToPath.set(key, path22);
|
|
51204
51204
|
if (flags === 1) {
|
|
51205
51205
|
recursiveKeys.push(key);
|
|
51206
51206
|
}
|
|
51207
51207
|
}
|
|
51208
51208
|
}
|
|
51209
51209
|
}
|
|
51210
|
-
for (const
|
|
51211
|
-
if (hasProperty(wildcardDirectories,
|
|
51210
|
+
for (const path22 in wildcardDirectories) {
|
|
51211
|
+
if (hasProperty(wildcardDirectories, path22)) {
|
|
51212
51212
|
for (const recursiveKey of recursiveKeys) {
|
|
51213
|
-
const key = toCanonicalKey(
|
|
51213
|
+
const key = toCanonicalKey(path22, useCaseSensitiveFileNames2);
|
|
51214
51214
|
if (key !== recursiveKey && containsPath(recursiveKey, key, basePath, !useCaseSensitiveFileNames2)) {
|
|
51215
|
-
delete wildcardDirectories[
|
|
51215
|
+
delete wildcardDirectories[path22];
|
|
51216
51216
|
}
|
|
51217
51217
|
}
|
|
51218
51218
|
}
|
|
@@ -51220,8 +51220,8 @@ ${lanes.join("\n")}
|
|
|
51220
51220
|
}
|
|
51221
51221
|
return wildcardDirectories;
|
|
51222
51222
|
}
|
|
51223
|
-
function toCanonicalKey(
|
|
51224
|
-
return useCaseSensitiveFileNames2 ?
|
|
51223
|
+
function toCanonicalKey(path22, useCaseSensitiveFileNames2) {
|
|
51224
|
+
return useCaseSensitiveFileNames2 ? path22 : toFileNameLowerCase(path22);
|
|
51225
51225
|
}
|
|
51226
51226
|
function getWildcardDirectoryFromSpec(spec, useCaseSensitiveFileNames2) {
|
|
51227
51227
|
const match = wildcardDirectoryPattern.exec(spec);
|
|
@@ -51237,10 +51237,10 @@ ${lanes.join("\n")}
|
|
|
51237
51237
|
};
|
|
51238
51238
|
}
|
|
51239
51239
|
if (isImplicitGlob(spec.substring(spec.lastIndexOf(directorySeparator) + 1))) {
|
|
51240
|
-
const
|
|
51240
|
+
const path22 = removeTrailingDirectorySeparator(spec);
|
|
51241
51241
|
return {
|
|
51242
|
-
key: toCanonicalKey(
|
|
51243
|
-
path:
|
|
51242
|
+
key: toCanonicalKey(path22, useCaseSensitiveFileNames2),
|
|
51243
|
+
path: path22,
|
|
51244
51244
|
flags: 1
|
|
51245
51245
|
/* Recursive */
|
|
51246
51246
|
};
|
|
@@ -51479,11 +51479,11 @@ ${lanes.join("\n")}
|
|
|
51479
51479
|
}
|
|
51480
51480
|
return;
|
|
51481
51481
|
}
|
|
51482
|
-
const
|
|
51482
|
+
const path22 = normalizePath(combinePaths(baseDirectory, fileName));
|
|
51483
51483
|
if (state.traceEnabled) {
|
|
51484
|
-
trace(state.host, Diagnostics.package_json_has_0_field_1_that_references_2, fieldName, fileName,
|
|
51484
|
+
trace(state.host, Diagnostics.package_json_has_0_field_1_that_references_2, fieldName, fileName, path22);
|
|
51485
51485
|
}
|
|
51486
|
-
return
|
|
51486
|
+
return path22;
|
|
51487
51487
|
}
|
|
51488
51488
|
function readPackageJsonTypesFields(jsonContent, baseDirectory, state) {
|
|
51489
51489
|
return readPackageJsonPathField(jsonContent, "typings", baseDirectory, state) || readPackageJsonPathField(jsonContent, "types", baseDirectory, state);
|
|
@@ -51997,13 +51997,13 @@ ${lanes.join("\n")}
|
|
|
51997
51997
|
directoryToModuleNameMap.update(options2);
|
|
51998
51998
|
}
|
|
51999
51999
|
function getOrCreateCacheForDirectory(directoryName, redirectedReference) {
|
|
52000
|
-
const
|
|
52001
|
-
return getOrCreateCache(directoryToModuleNameMap, redirectedReference,
|
|
52000
|
+
const path22 = toPath(directoryName, currentDirectory, getCanonicalFileName);
|
|
52001
|
+
return getOrCreateCache(directoryToModuleNameMap, redirectedReference, path22, () => createModeAwareCache());
|
|
52002
52002
|
}
|
|
52003
52003
|
function getFromDirectoryCache(name, mode, directoryName, redirectedReference) {
|
|
52004
52004
|
var _a3, _b;
|
|
52005
|
-
const
|
|
52006
|
-
return (_b = (_a3 = directoryToModuleNameMap.getMapOfCacheRedirects(redirectedReference)) == null ? void 0 : _a3.get(
|
|
52005
|
+
const path22 = toPath(directoryName, currentDirectory, getCanonicalFileName);
|
|
52006
|
+
return (_b = (_a3 = directoryToModuleNameMap.getMapOfCacheRedirects(redirectedReference)) == null ? void 0 : _a3.get(path22)) == null ? void 0 : _b.get(name, mode);
|
|
52007
52007
|
}
|
|
52008
52008
|
}
|
|
52009
52009
|
function createModeAwareCacheKey(specifier, mode) {
|
|
@@ -52080,14 +52080,14 @@ ${lanes.join("\n")}
|
|
|
52080
52080
|
return directoryPathMap.get(toPath(directory, currentDirectory, getCanonicalFileName));
|
|
52081
52081
|
}
|
|
52082
52082
|
function set2(directory, result) {
|
|
52083
|
-
const
|
|
52084
|
-
if (directoryPathMap.has(
|
|
52083
|
+
const path22 = toPath(directory, currentDirectory, getCanonicalFileName);
|
|
52084
|
+
if (directoryPathMap.has(path22)) {
|
|
52085
52085
|
return;
|
|
52086
52086
|
}
|
|
52087
|
-
directoryPathMap.set(
|
|
52087
|
+
directoryPathMap.set(path22, result);
|
|
52088
52088
|
const resolvedFileName = getResolvedFileName(result);
|
|
52089
|
-
const commonPrefix = resolvedFileName && getCommonPrefix(
|
|
52090
|
-
let current =
|
|
52089
|
+
const commonPrefix = resolvedFileName && getCommonPrefix(path22, resolvedFileName);
|
|
52090
|
+
let current = path22;
|
|
52091
52091
|
while (current !== commonPrefix) {
|
|
52092
52092
|
const parent2 = getDirectoryPath(current);
|
|
52093
52093
|
if (parent2 === current || directoryPathMap.has(parent2)) {
|
|
@@ -52652,16 +52652,16 @@ ${lanes.join("\n")}
|
|
|
52652
52652
|
const combined = combinePaths(containingDirectory, moduleName);
|
|
52653
52653
|
const parts = getPathComponents(combined);
|
|
52654
52654
|
const lastPart = lastOrUndefined(parts);
|
|
52655
|
-
const
|
|
52656
|
-
return { path:
|
|
52655
|
+
const path22 = lastPart === "." || lastPart === ".." ? ensureTrailingDirectorySeparator(normalizePath(combined)) : normalizePath(combined);
|
|
52656
|
+
return { path: path22, parts };
|
|
52657
52657
|
}
|
|
52658
|
-
function realPath(
|
|
52658
|
+
function realPath(path22, host, traceEnabled) {
|
|
52659
52659
|
if (!host.realpath) {
|
|
52660
|
-
return
|
|
52660
|
+
return path22;
|
|
52661
52661
|
}
|
|
52662
|
-
const real = normalizePath(host.realpath(
|
|
52662
|
+
const real = normalizePath(host.realpath(path22));
|
|
52663
52663
|
if (traceEnabled) {
|
|
52664
|
-
trace(host, Diagnostics.Resolving_real_path_for_0_result_1,
|
|
52664
|
+
trace(host, Diagnostics.Resolving_real_path_for_0_result_1, path22, real);
|
|
52665
52665
|
}
|
|
52666
52666
|
return real;
|
|
52667
52667
|
}
|
|
@@ -52706,25 +52706,25 @@ ${lanes.join("\n")}
|
|
|
52706
52706
|
return void 0;
|
|
52707
52707
|
}
|
|
52708
52708
|
var nodeModulesPathPart = "/node_modules/";
|
|
52709
|
-
function pathContainsNodeModules(
|
|
52710
|
-
return
|
|
52709
|
+
function pathContainsNodeModules(path22) {
|
|
52710
|
+
return path22.includes(nodeModulesPathPart);
|
|
52711
52711
|
}
|
|
52712
52712
|
function parseNodeModuleFromPath(resolved, isFolder) {
|
|
52713
|
-
const
|
|
52714
|
-
const idx =
|
|
52713
|
+
const path22 = normalizePath(resolved);
|
|
52714
|
+
const idx = path22.lastIndexOf(nodeModulesPathPart);
|
|
52715
52715
|
if (idx === -1) {
|
|
52716
52716
|
return void 0;
|
|
52717
52717
|
}
|
|
52718
52718
|
const indexAfterNodeModules = idx + nodeModulesPathPart.length;
|
|
52719
|
-
let indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(
|
|
52720
|
-
if (
|
|
52721
|
-
indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(
|
|
52719
|
+
let indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path22, indexAfterNodeModules, isFolder);
|
|
52720
|
+
if (path22.charCodeAt(indexAfterNodeModules) === 64) {
|
|
52721
|
+
indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path22, indexAfterPackageName, isFolder);
|
|
52722
52722
|
}
|
|
52723
|
-
return
|
|
52723
|
+
return path22.slice(0, indexAfterPackageName);
|
|
52724
52724
|
}
|
|
52725
|
-
function moveToNextDirectorySeparatorIfAvailable(
|
|
52726
|
-
const nextSeparatorIndex =
|
|
52727
|
-
return nextSeparatorIndex === -1 ? isFolder ?
|
|
52725
|
+
function moveToNextDirectorySeparatorIfAvailable(path22, prevSeparatorIndex, isFolder) {
|
|
52726
|
+
const nextSeparatorIndex = path22.indexOf(directorySeparator, prevSeparatorIndex + 1);
|
|
52727
|
+
return nextSeparatorIndex === -1 ? isFolder ? path22.length : prevSeparatorIndex : nextSeparatorIndex;
|
|
52728
52728
|
}
|
|
52729
52729
|
function loadModuleFromFileNoPackageId(extensions, candidate, onlyRecordFailures, state) {
|
|
52730
52730
|
return noPackageId(loadModuleFromFile(extensions, candidate, onlyRecordFailures, state));
|
|
@@ -52866,8 +52866,8 @@ ${lanes.join("\n")}
|
|
|
52866
52866
|
return extensions & 4 && !isDeclarationFileName(candidate + originalExtension) && tryExtension(`.d${originalExtension}.ts`) || void 0;
|
|
52867
52867
|
}
|
|
52868
52868
|
function tryExtension(ext, resolvedUsingTsExtension) {
|
|
52869
|
-
const
|
|
52870
|
-
return
|
|
52869
|
+
const path22 = tryFile(candidate + ext, onlyRecordFailures, state);
|
|
52870
|
+
return path22 === void 0 ? void 0 : { path: path22, ext, resolvedUsingTsExtension: !state.candidateIsFromPackageJsonField && resolvedUsingTsExtension };
|
|
52871
52871
|
}
|
|
52872
52872
|
}
|
|
52873
52873
|
function tryFile(fileName, onlyRecordFailures, state) {
|
|
@@ -53562,10 +53562,10 @@ ${lanes.join("\n")}
|
|
|
53562
53562
|
/*value*/
|
|
53563
53563
|
void 0
|
|
53564
53564
|
);
|
|
53565
|
-
function toAbsolutePath(
|
|
53565
|
+
function toAbsolutePath(path22) {
|
|
53566
53566
|
var _a22, _b2;
|
|
53567
|
-
if (
|
|
53568
|
-
return getNormalizedAbsolutePath(
|
|
53567
|
+
if (path22 === void 0) return path22;
|
|
53568
|
+
return getNormalizedAbsolutePath(path22, (_b2 = (_a22 = state.host).getCurrentDirectory) == null ? void 0 : _b2.call(_a22));
|
|
53569
53569
|
}
|
|
53570
53570
|
function combineDirectoryPath(root, dir) {
|
|
53571
53571
|
return ensureTrailingDirectorySeparator(combinePaths(root, dir));
|
|
@@ -53816,16 +53816,16 @@ ${lanes.join("\n")}
|
|
|
53816
53816
|
trace(state.host, Diagnostics.Module_name_0_matched_pattern_1, moduleName, matchedPatternText);
|
|
53817
53817
|
}
|
|
53818
53818
|
const resolved = forEach(paths[matchedPatternText], (subst) => {
|
|
53819
|
-
const
|
|
53820
|
-
const candidate = normalizePath(combinePaths(baseDirectory,
|
|
53819
|
+
const path22 = matchedStar ? replaceFirstStar(subst, matchedStar) : subst;
|
|
53820
|
+
const candidate = normalizePath(combinePaths(baseDirectory, path22));
|
|
53821
53821
|
if (state.traceEnabled) {
|
|
53822
|
-
trace(state.host, Diagnostics.Trying_substitution_0_candidate_module_location_Colon_1, subst,
|
|
53822
|
+
trace(state.host, Diagnostics.Trying_substitution_0_candidate_module_location_Colon_1, subst, path22);
|
|
53823
53823
|
}
|
|
53824
53824
|
const extension = tryGetExtensionFromPath2(subst);
|
|
53825
53825
|
if (extension !== void 0) {
|
|
53826
|
-
const
|
|
53827
|
-
if (
|
|
53828
|
-
return noPackageId({ path:
|
|
53826
|
+
const path23 = tryFile(candidate, onlyRecordFailures, state);
|
|
53827
|
+
if (path23 !== void 0) {
|
|
53828
|
+
return noPackageId({ path: path23, ext: extension, resolvedUsingTsExtension: void 0 });
|
|
53829
53829
|
}
|
|
53830
53830
|
}
|
|
53831
53831
|
return loader(extensions, candidate, onlyRecordFailures || !directoryProbablyExists(getDirectoryPath(candidate), state.host), state);
|
|
@@ -57911,10 +57911,10 @@ ${lanes.join("\n")}
|
|
|
57911
57911
|
if (a2 === void 0 || b === void 0) return false;
|
|
57912
57912
|
return comparePaths(a2, b, ignoreCase) === 0;
|
|
57913
57913
|
}
|
|
57914
|
-
function countPathComponents(
|
|
57914
|
+
function countPathComponents(path22) {
|
|
57915
57915
|
let count = 0;
|
|
57916
|
-
for (let i2 = startsWith(
|
|
57917
|
-
if (
|
|
57916
|
+
for (let i2 = startsWith(path22, "./") ? 2 : 0; i2 < path22.length; i2++) {
|
|
57917
|
+
if (path22.charCodeAt(i2) === 47) count++;
|
|
57918
57918
|
}
|
|
57919
57919
|
return count;
|
|
57920
57920
|
}
|
|
@@ -58031,9 +58031,9 @@ ${lanes.join("\n")}
|
|
|
58031
58031
|
host,
|
|
58032
58032
|
/*preferSymlinks*/
|
|
58033
58033
|
true,
|
|
58034
|
-
(
|
|
58035
|
-
const isInNodeModules = pathContainsNodeModules(
|
|
58036
|
-
allFileNames.set(
|
|
58034
|
+
(path22, isRedirect) => {
|
|
58035
|
+
const isInNodeModules = pathContainsNodeModules(path22);
|
|
58036
|
+
allFileNames.set(path22, { path: info.getCanonicalFileName(path22), isRedirect, isInNodeModules });
|
|
58037
58037
|
importedFileFromNodeModules = importedFileFromNodeModules || isInNodeModules;
|
|
58038
58038
|
}
|
|
58039
58039
|
);
|
|
@@ -58041,8 +58041,8 @@ ${lanes.join("\n")}
|
|
|
58041
58041
|
for (let directory = info.canonicalSourceDirectory; allFileNames.size !== 0; ) {
|
|
58042
58042
|
const directoryStart = ensureTrailingDirectorySeparator(directory);
|
|
58043
58043
|
let pathsInDirectory;
|
|
58044
|
-
allFileNames.forEach(({ path:
|
|
58045
|
-
if (startsWith(
|
|
58044
|
+
allFileNames.forEach(({ path: path22, isRedirect, isInNodeModules }, fileName) => {
|
|
58045
|
+
if (startsWith(path22, directoryStart)) {
|
|
58046
58046
|
(pathsInDirectory || (pathsInDirectory = [])).push({ path: fileName, isRedirect, isInNodeModules });
|
|
58047
58047
|
allFileNames.delete(fileName);
|
|
58048
58048
|
}
|
|
@@ -58345,17 +58345,17 @@ ${lanes.join("\n")}
|
|
|
58345
58345
|
}
|
|
58346
58346
|
return processEnding(shortest, allowedEndings, compilerOptions);
|
|
58347
58347
|
}
|
|
58348
|
-
function tryGetModuleNameAsNodeModule({ path:
|
|
58348
|
+
function tryGetModuleNameAsNodeModule({ path: path22, isRedirect }, { getCanonicalFileName, canonicalSourceDirectory }, importingSourceFile, host, options, userPreferences, packageNameOnly, overrideMode) {
|
|
58349
58349
|
if (!host.fileExists || !host.readFile) {
|
|
58350
58350
|
return void 0;
|
|
58351
58351
|
}
|
|
58352
|
-
const parts = getNodeModulePathParts(
|
|
58352
|
+
const parts = getNodeModulePathParts(path22);
|
|
58353
58353
|
if (!parts) {
|
|
58354
58354
|
return void 0;
|
|
58355
58355
|
}
|
|
58356
58356
|
const preferences = getModuleSpecifierPreferences(userPreferences, host, options, importingSourceFile);
|
|
58357
58357
|
const allowedEndings = preferences.getAllowedEndingsInPreferredOrder();
|
|
58358
|
-
let moduleSpecifier =
|
|
58358
|
+
let moduleSpecifier = path22;
|
|
58359
58359
|
let isPackageRootPath = false;
|
|
58360
58360
|
if (!packageNameOnly) {
|
|
58361
58361
|
let packageRootIndex = parts.packageRootIndex;
|
|
@@ -58376,7 +58376,7 @@ ${lanes.join("\n")}
|
|
|
58376
58376
|
break;
|
|
58377
58377
|
}
|
|
58378
58378
|
if (!moduleFileName) moduleFileName = moduleFileToTry;
|
|
58379
|
-
packageRootIndex =
|
|
58379
|
+
packageRootIndex = path22.indexOf(directorySeparator, packageRootIndex + 1);
|
|
58380
58380
|
if (packageRootIndex === -1) {
|
|
58381
58381
|
moduleSpecifier = processEnding(moduleFileName, allowedEndings, options, host);
|
|
58382
58382
|
break;
|
|
@@ -58396,9 +58396,9 @@ ${lanes.join("\n")}
|
|
|
58396
58396
|
return getEmitModuleResolutionKind(options) === 1 && packageName === nodeModulesDirectoryName ? void 0 : packageName;
|
|
58397
58397
|
function tryDirectoryWithPackageJson(packageRootIndex) {
|
|
58398
58398
|
var _a3, _b;
|
|
58399
|
-
const packageRootPath =
|
|
58399
|
+
const packageRootPath = path22.substring(0, packageRootIndex);
|
|
58400
58400
|
const packageJsonPath = combinePaths(packageRootPath, "package.json");
|
|
58401
|
-
let moduleFileToTry =
|
|
58401
|
+
let moduleFileToTry = path22;
|
|
58402
58402
|
let maybeBlockedByTypesVersions = false;
|
|
58403
58403
|
const cachedPackageJson = (_b = (_a3 = host.getPackageJsonInfoCache) == null ? void 0 : _a3.call(host)) == null ? void 0 : _b.getPackageJsonInfo(packageJsonPath);
|
|
58404
58404
|
if (isPackageJsonInfo(cachedPackageJson) || cachedPackageJson === void 0 && host.fileExists(packageJsonPath)) {
|
|
@@ -58411,7 +58411,7 @@ ${lanes.join("\n")}
|
|
|
58411
58411
|
const fromExports = (packageJsonContent == null ? void 0 : packageJsonContent.exports) ? tryGetModuleNameFromExports(
|
|
58412
58412
|
options,
|
|
58413
58413
|
host,
|
|
58414
|
-
|
|
58414
|
+
path22,
|
|
58415
58415
|
packageRootPath,
|
|
58416
58416
|
packageName2,
|
|
58417
58417
|
packageJsonContent.exports,
|
|
@@ -58421,12 +58421,12 @@ ${lanes.join("\n")}
|
|
|
58421
58421
|
return { ...fromExports, verbatimFromExports: true };
|
|
58422
58422
|
}
|
|
58423
58423
|
if (packageJsonContent == null ? void 0 : packageJsonContent.exports) {
|
|
58424
|
-
return { moduleFileToTry:
|
|
58424
|
+
return { moduleFileToTry: path22, blockedByExports: true };
|
|
58425
58425
|
}
|
|
58426
58426
|
}
|
|
58427
58427
|
const versionPaths = (packageJsonContent == null ? void 0 : packageJsonContent.typesVersions) ? getPackageJsonTypesVersionsPaths(packageJsonContent.typesVersions) : void 0;
|
|
58428
58428
|
if (versionPaths) {
|
|
58429
|
-
const subModuleName =
|
|
58429
|
+
const subModuleName = path22.slice(packageRootPath.length + 1);
|
|
58430
58430
|
const fromPaths = tryGetModuleNameFromPaths(
|
|
58431
58431
|
subModuleName,
|
|
58432
58432
|
versionPaths.paths,
|
|
@@ -58461,7 +58461,7 @@ ${lanes.join("\n")}
|
|
|
58461
58461
|
return { moduleFileToTry };
|
|
58462
58462
|
}
|
|
58463
58463
|
}
|
|
58464
|
-
function tryGetAnyFileFromPath(host,
|
|
58464
|
+
function tryGetAnyFileFromPath(host, path22) {
|
|
58465
58465
|
if (!host.fileExists) return;
|
|
58466
58466
|
const extensions = flatten(getSupportedExtensions({ allowJs: true }, [{ extension: "node", isMixedContent: false }, {
|
|
58467
58467
|
extension: "json",
|
|
@@ -58470,15 +58470,15 @@ ${lanes.join("\n")}
|
|
|
58470
58470
|
/* JSON */
|
|
58471
58471
|
}]));
|
|
58472
58472
|
for (const e of extensions) {
|
|
58473
|
-
const fullPath =
|
|
58473
|
+
const fullPath = path22 + e;
|
|
58474
58474
|
if (host.fileExists(fullPath)) {
|
|
58475
58475
|
return fullPath;
|
|
58476
58476
|
}
|
|
58477
58477
|
}
|
|
58478
58478
|
}
|
|
58479
|
-
function getPathsRelativeToRootDirs(
|
|
58479
|
+
function getPathsRelativeToRootDirs(path22, rootDirs, getCanonicalFileName) {
|
|
58480
58480
|
return mapDefined(rootDirs, (rootDir) => {
|
|
58481
|
-
const relativePath = getRelativePathIfInSameVolume(
|
|
58481
|
+
const relativePath = getRelativePathIfInSameVolume(path22, rootDir, getCanonicalFileName);
|
|
58482
58482
|
return relativePath !== void 0 && isPathRelativeToParent(relativePath) ? void 0 : relativePath;
|
|
58483
58483
|
});
|
|
58484
58484
|
}
|
|
@@ -58595,10 +58595,10 @@ ${lanes.join("\n")}
|
|
|
58595
58595
|
return void 0;
|
|
58596
58596
|
}
|
|
58597
58597
|
}
|
|
58598
|
-
function getRelativePathIfInSameVolume(
|
|
58598
|
+
function getRelativePathIfInSameVolume(path22, directoryPath, getCanonicalFileName) {
|
|
58599
58599
|
const relativePath = getRelativePathToDirectoryOrUrl(
|
|
58600
58600
|
directoryPath,
|
|
58601
|
-
|
|
58601
|
+
path22,
|
|
58602
58602
|
directoryPath,
|
|
58603
58603
|
getCanonicalFileName,
|
|
58604
58604
|
/*isAbsolutePathAnUrl*/
|
|
@@ -58606,8 +58606,8 @@ ${lanes.join("\n")}
|
|
|
58606
58606
|
);
|
|
58607
58607
|
return isRootedDiskPath(relativePath) ? void 0 : relativePath;
|
|
58608
58608
|
}
|
|
58609
|
-
function isPathRelativeToParent(
|
|
58610
|
-
return startsWith(
|
|
58609
|
+
function isPathRelativeToParent(path22) {
|
|
58610
|
+
return startsWith(path22, "..");
|
|
58611
58611
|
}
|
|
58612
58612
|
function getDefaultResolutionModeForFile(file2, host, compilerOptions) {
|
|
58613
58613
|
return isFullSourceFile(file2) ? host.getDefaultResolutionModeForFile(file2) : getDefaultResolutionModeForFileWorker(file2, compilerOptions);
|
|
@@ -73703,10 +73703,10 @@ ${lanes.join("\n")}
|
|
|
73703
73703
|
const text = identifier.escapedText;
|
|
73704
73704
|
if (text) {
|
|
73705
73705
|
const parentSymbol = name.kind === 167 ? getUnresolvedSymbolForEntityName(name.left) : name.kind === 212 ? getUnresolvedSymbolForEntityName(name.expression) : void 0;
|
|
73706
|
-
const
|
|
73707
|
-
let result = unresolvedSymbols.get(
|
|
73706
|
+
const path22 = parentSymbol ? `${getSymbolPath(parentSymbol)}.${text}` : text;
|
|
73707
|
+
let result = unresolvedSymbols.get(path22);
|
|
73708
73708
|
if (!result) {
|
|
73709
|
-
unresolvedSymbols.set(
|
|
73709
|
+
unresolvedSymbols.set(path22, result = createSymbol(
|
|
73710
73710
|
524288,
|
|
73711
73711
|
text,
|
|
73712
73712
|
1048576
|
|
@@ -78514,24 +78514,24 @@ ${lanes.join("\n")}
|
|
|
78514
78514
|
}
|
|
78515
78515
|
return;
|
|
78516
78516
|
}
|
|
78517
|
-
let
|
|
78517
|
+
let path22 = "";
|
|
78518
78518
|
const secondaryRootErrors = [];
|
|
78519
78519
|
while (stack.length) {
|
|
78520
78520
|
const [msg, ...args] = stack.pop();
|
|
78521
78521
|
switch (msg.code) {
|
|
78522
78522
|
case Diagnostics.Types_of_property_0_are_incompatible.code: {
|
|
78523
|
-
if (
|
|
78524
|
-
|
|
78523
|
+
if (path22.indexOf("new ") === 0) {
|
|
78524
|
+
path22 = `(${path22})`;
|
|
78525
78525
|
}
|
|
78526
78526
|
const str = "" + args[0];
|
|
78527
|
-
if (
|
|
78528
|
-
|
|
78527
|
+
if (path22.length === 0) {
|
|
78528
|
+
path22 = `${str}`;
|
|
78529
78529
|
} else if (isIdentifierText(str, getEmitScriptTarget(compilerOptions))) {
|
|
78530
|
-
|
|
78530
|
+
path22 = `${path22}.${str}`;
|
|
78531
78531
|
} else if (str[0] === "[" && str[str.length - 1] === "]") {
|
|
78532
|
-
|
|
78532
|
+
path22 = `${path22}${str}`;
|
|
78533
78533
|
} else {
|
|
78534
|
-
|
|
78534
|
+
path22 = `${path22}[${str}]`;
|
|
78535
78535
|
}
|
|
78536
78536
|
break;
|
|
78537
78537
|
}
|
|
@@ -78539,7 +78539,7 @@ ${lanes.join("\n")}
|
|
|
78539
78539
|
case Diagnostics.Construct_signature_return_types_0_and_1_are_incompatible.code:
|
|
78540
78540
|
case Diagnostics.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code:
|
|
78541
78541
|
case Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code: {
|
|
78542
|
-
if (
|
|
78542
|
+
if (path22.length === 0) {
|
|
78543
78543
|
let mappedMsg = msg;
|
|
78544
78544
|
if (msg.code === Diagnostics.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code) {
|
|
78545
78545
|
mappedMsg = Diagnostics.Call_signature_return_types_0_and_1_are_incompatible;
|
|
@@ -78550,7 +78550,7 @@ ${lanes.join("\n")}
|
|
|
78550
78550
|
} else {
|
|
78551
78551
|
const prefix = msg.code === Diagnostics.Construct_signature_return_types_0_and_1_are_incompatible.code || msg.code === Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code ? "new " : "";
|
|
78552
78552
|
const params = msg.code === Diagnostics.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code || msg.code === Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code ? "" : "...";
|
|
78553
|
-
|
|
78553
|
+
path22 = `${prefix}${path22}(${params})`;
|
|
78554
78554
|
}
|
|
78555
78555
|
break;
|
|
78556
78556
|
}
|
|
@@ -78566,10 +78566,10 @@ ${lanes.join("\n")}
|
|
|
78566
78566
|
return Debug.fail(`Unhandled Diagnostic: ${msg.code}`);
|
|
78567
78567
|
}
|
|
78568
78568
|
}
|
|
78569
|
-
if (
|
|
78569
|
+
if (path22) {
|
|
78570
78570
|
reportError(
|
|
78571
|
-
|
|
78572
|
-
|
|
78571
|
+
path22[path22.length - 1] === ")" ? Diagnostics.The_types_returned_by_0_are_incompatible_between_these_types : Diagnostics.The_types_of_0_are_incompatible_between_these_types,
|
|
78572
|
+
path22
|
|
78573
78573
|
);
|
|
78574
78574
|
} else {
|
|
78575
78575
|
secondaryRootErrors.shift();
|
|
@@ -134087,9 +134087,9 @@ ${lanes.join("\n")}
|
|
|
134087
134087
|
function createAddOutput() {
|
|
134088
134088
|
let outputs;
|
|
134089
134089
|
return { addOutput, getOutputs };
|
|
134090
|
-
function addOutput(
|
|
134091
|
-
if (
|
|
134092
|
-
(outputs || (outputs = [])).push(
|
|
134090
|
+
function addOutput(path22) {
|
|
134091
|
+
if (path22) {
|
|
134092
|
+
(outputs || (outputs = [])).push(path22);
|
|
134093
134093
|
}
|
|
134094
134094
|
}
|
|
134095
134095
|
function getOutputs() {
|
|
@@ -139318,7 +139318,7 @@ ${lanes.join("\n")}
|
|
|
139318
139318
|
return {
|
|
139319
139319
|
useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
|
|
139320
139320
|
fileExists,
|
|
139321
|
-
readFile: (
|
|
139321
|
+
readFile: (path22, encoding) => host.readFile(path22, encoding),
|
|
139322
139322
|
directoryExists: host.directoryExists && directoryExists,
|
|
139323
139323
|
getDirectories,
|
|
139324
139324
|
readDirectory,
|
|
@@ -139335,8 +139335,8 @@ ${lanes.join("\n")}
|
|
|
139335
139335
|
function getCachedFileSystemEntries(rootDirPath) {
|
|
139336
139336
|
return cachedReadDirectoryResult.get(ensureTrailingDirectorySeparator(rootDirPath));
|
|
139337
139337
|
}
|
|
139338
|
-
function getCachedFileSystemEntriesForBaseDir(
|
|
139339
|
-
const entries = getCachedFileSystemEntries(getDirectoryPath(
|
|
139338
|
+
function getCachedFileSystemEntriesForBaseDir(path22) {
|
|
139339
|
+
const entries = getCachedFileSystemEntries(getDirectoryPath(path22));
|
|
139340
139340
|
if (!entries) {
|
|
139341
139341
|
return entries;
|
|
139342
139342
|
}
|
|
@@ -139391,8 +139391,8 @@ ${lanes.join("\n")}
|
|
|
139391
139391
|
return index >= 0;
|
|
139392
139392
|
}
|
|
139393
139393
|
function writeFile2(fileName, data, writeByteOrderMark) {
|
|
139394
|
-
const
|
|
139395
|
-
const result = getCachedFileSystemEntriesForBaseDir(
|
|
139394
|
+
const path22 = toPath3(fileName);
|
|
139395
|
+
const result = getCachedFileSystemEntriesForBaseDir(path22);
|
|
139396
139396
|
if (result) {
|
|
139397
139397
|
updateFilesOfFileSystemEntry(
|
|
139398
139398
|
result,
|
|
@@ -139404,17 +139404,17 @@ ${lanes.join("\n")}
|
|
|
139404
139404
|
return host.writeFile(fileName, data, writeByteOrderMark);
|
|
139405
139405
|
}
|
|
139406
139406
|
function fileExists(fileName) {
|
|
139407
|
-
const
|
|
139408
|
-
const result = getCachedFileSystemEntriesForBaseDir(
|
|
139407
|
+
const path22 = toPath3(fileName);
|
|
139408
|
+
const result = getCachedFileSystemEntriesForBaseDir(path22);
|
|
139409
139409
|
return result && hasEntry(result.sortedAndCanonicalizedFiles, getCanonicalFileName(getBaseNameOfFileName(fileName))) || host.fileExists(fileName);
|
|
139410
139410
|
}
|
|
139411
139411
|
function directoryExists(dirPath) {
|
|
139412
|
-
const
|
|
139413
|
-
return cachedReadDirectoryResult.has(ensureTrailingDirectorySeparator(
|
|
139412
|
+
const path22 = toPath3(dirPath);
|
|
139413
|
+
return cachedReadDirectoryResult.has(ensureTrailingDirectorySeparator(path22)) || host.directoryExists(dirPath);
|
|
139414
139414
|
}
|
|
139415
139415
|
function createDirectory(dirPath) {
|
|
139416
|
-
const
|
|
139417
|
-
const result = getCachedFileSystemEntriesForBaseDir(
|
|
139416
|
+
const path22 = toPath3(dirPath);
|
|
139417
|
+
const result = getCachedFileSystemEntriesForBaseDir(path22);
|
|
139418
139418
|
if (result) {
|
|
139419
139419
|
const baseName = getBaseNameOfFileName(dirPath);
|
|
139420
139420
|
const canonicalizedBaseName = getCanonicalFileName(baseName);
|
|
@@ -139442,15 +139442,15 @@ ${lanes.join("\n")}
|
|
|
139442
139442
|
}
|
|
139443
139443
|
return host.readDirectory(rootDir, extensions, excludes, includes, depth);
|
|
139444
139444
|
function getFileSystemEntries(dir) {
|
|
139445
|
-
const
|
|
139446
|
-
if (
|
|
139447
|
-
return rootResult || getFileSystemEntriesFromHost(dir,
|
|
139445
|
+
const path22 = toPath3(dir);
|
|
139446
|
+
if (path22 === rootDirPath) {
|
|
139447
|
+
return rootResult || getFileSystemEntriesFromHost(dir, path22);
|
|
139448
139448
|
}
|
|
139449
|
-
const result = tryReadDirectory2(dir,
|
|
139450
|
-
return result !== void 0 ? result || getFileSystemEntriesFromHost(dir,
|
|
139449
|
+
const result = tryReadDirectory2(dir, path22);
|
|
139450
|
+
return result !== void 0 ? result || getFileSystemEntriesFromHost(dir, path22) : emptyFileSystemEntries;
|
|
139451
139451
|
}
|
|
139452
|
-
function getFileSystemEntriesFromHost(dir,
|
|
139453
|
-
if (rootSymLinkResult &&
|
|
139452
|
+
function getFileSystemEntriesFromHost(dir, path22) {
|
|
139453
|
+
if (rootSymLinkResult && path22 === rootDirPath) return rootSymLinkResult;
|
|
139454
139454
|
const result = {
|
|
139455
139455
|
files: map2(host.readDirectory(
|
|
139456
139456
|
dir,
|
|
@@ -139463,7 +139463,7 @@ ${lanes.join("\n")}
|
|
|
139463
139463
|
), getBaseNameOfFileName) || emptyArray,
|
|
139464
139464
|
directories: host.getDirectories(dir) || emptyArray
|
|
139465
139465
|
};
|
|
139466
|
-
if (
|
|
139466
|
+
if (path22 === rootDirPath) rootSymLinkResult = result;
|
|
139467
139467
|
return result;
|
|
139468
139468
|
}
|
|
139469
139469
|
}
|
|
@@ -139922,15 +139922,15 @@ ${lanes.join("\n")}
|
|
|
139922
139922
|
return getDirectoryPath(normalizePath(system.getExecutingFilePath()));
|
|
139923
139923
|
}
|
|
139924
139924
|
const newLine = getNewLineCharacter(options);
|
|
139925
|
-
const realpath = system.realpath && ((
|
|
139925
|
+
const realpath = system.realpath && ((path22) => system.realpath(path22));
|
|
139926
139926
|
const compilerHost = {
|
|
139927
139927
|
getSourceFile: createGetSourceFile((fileName) => compilerHost.readFile(fileName), setParentNodes),
|
|
139928
139928
|
getDefaultLibLocation,
|
|
139929
139929
|
getDefaultLibFileName: (options2) => combinePaths(getDefaultLibLocation(), getDefaultLibFileName(options2)),
|
|
139930
139930
|
writeFile: createWriteFileMeasuringIO(
|
|
139931
|
-
(
|
|
139932
|
-
(
|
|
139933
|
-
(
|
|
139931
|
+
(path22, data, writeByteOrderMark) => system.writeFile(path22, data, writeByteOrderMark),
|
|
139932
|
+
(path22) => (compilerHost.createDirectory || system.createDirectory)(path22),
|
|
139933
|
+
(path22) => directoryExists(path22)
|
|
139934
139934
|
),
|
|
139935
139935
|
getCurrentDirectory: memoize(() => system.getCurrentDirectory()),
|
|
139936
139936
|
useCaseSensitiveFileNames: () => system.useCaseSensitiveFileNames,
|
|
@@ -139941,9 +139941,9 @@ ${lanes.join("\n")}
|
|
|
139941
139941
|
trace: (s) => system.write(s + newLine),
|
|
139942
139942
|
directoryExists: (directoryName) => system.directoryExists(directoryName),
|
|
139943
139943
|
getEnvironmentVariable: (name) => system.getEnvironmentVariable ? system.getEnvironmentVariable(name) : "",
|
|
139944
|
-
getDirectories: (
|
|
139944
|
+
getDirectories: (path22) => system.getDirectories(path22),
|
|
139945
139945
|
realpath,
|
|
139946
|
-
readDirectory: (
|
|
139946
|
+
readDirectory: (path22, extensions, include, exclude, depth) => system.readDirectory(path22, extensions, include, exclude, depth),
|
|
139947
139947
|
createDirectory: (d) => system.createDirectory(d),
|
|
139948
139948
|
createHash: maybeBind(system, system.createHash)
|
|
139949
139949
|
};
|
|
@@ -140382,13 +140382,13 @@ ${lanes.join("\n")}
|
|
|
140382
140382
|
}
|
|
140383
140383
|
function getLibraryNameFromLibFileName(libFileName) {
|
|
140384
140384
|
const components = libFileName.split(".");
|
|
140385
|
-
let
|
|
140385
|
+
let path22 = components[1];
|
|
140386
140386
|
let i2 = 2;
|
|
140387
140387
|
while (components[i2] && components[i2] !== "d") {
|
|
140388
|
-
|
|
140388
|
+
path22 += (i2 === 2 ? "/" : "-") + components[i2];
|
|
140389
140389
|
i2++;
|
|
140390
140390
|
}
|
|
140391
|
-
return "@typescript/lib-" +
|
|
140391
|
+
return "@typescript/lib-" + path22;
|
|
140392
140392
|
}
|
|
140393
140393
|
function isReferencedFile(reason) {
|
|
140394
140394
|
switch (reason == null ? void 0 : reason.kind) {
|
|
@@ -141460,18 +141460,18 @@ ${lanes.join("\n")}
|
|
|
141460
141460
|
}
|
|
141461
141461
|
}
|
|
141462
141462
|
const oldFilesByNameMap = oldProgram.getFilesByNameMap();
|
|
141463
|
-
oldFilesByNameMap.forEach((oldFile,
|
|
141463
|
+
oldFilesByNameMap.forEach((oldFile, path22) => {
|
|
141464
141464
|
if (!oldFile) {
|
|
141465
|
-
filesByName.set(
|
|
141465
|
+
filesByName.set(path22, oldFile);
|
|
141466
141466
|
return;
|
|
141467
141467
|
}
|
|
141468
|
-
if (oldFile.path ===
|
|
141468
|
+
if (oldFile.path === path22) {
|
|
141469
141469
|
if (oldProgram.isSourceFileFromExternalLibrary(oldFile)) {
|
|
141470
141470
|
sourceFilesFoundSearchingNodeModules.set(oldFile.path, true);
|
|
141471
141471
|
}
|
|
141472
141472
|
return;
|
|
141473
141473
|
}
|
|
141474
|
-
filesByName.set(
|
|
141474
|
+
filesByName.set(path22, filesByName.get(oldFile.path));
|
|
141475
141475
|
});
|
|
141476
141476
|
const isConfigIdentical = oldOptions.configFile && oldOptions.configFile === options.configFile || !oldOptions.configFile && !options.configFile && !optionsHaveChanges(oldOptions, options, optionDeclarations);
|
|
141477
141477
|
programDiagnostics.reuseStateFromOldProgram(oldProgram.getProgramDiagnosticsContainer(), isConfigIdentical);
|
|
@@ -141509,9 +141509,9 @@ ${lanes.join("\n")}
|
|
|
141509
141509
|
getModeForResolutionAtIndex: getModeForResolutionAtIndex2,
|
|
141510
141510
|
readFile: (f) => host.readFile(f),
|
|
141511
141511
|
fileExists: (f) => {
|
|
141512
|
-
const
|
|
141513
|
-
if (getSourceFileByPath(
|
|
141514
|
-
if (missingFileNames.has(
|
|
141512
|
+
const path22 = toPath3(f);
|
|
141513
|
+
if (getSourceFileByPath(path22)) return true;
|
|
141514
|
+
if (missingFileNames.has(path22)) return false;
|
|
141515
141515
|
return host.fileExists(f);
|
|
141516
141516
|
},
|
|
141517
141517
|
realpath: maybeBind(host, host.realpath),
|
|
@@ -141634,8 +141634,8 @@ ${lanes.join("\n")}
|
|
|
141634
141634
|
function getSourceFile(fileName) {
|
|
141635
141635
|
return getSourceFileByPath(toPath3(fileName));
|
|
141636
141636
|
}
|
|
141637
|
-
function getSourceFileByPath(
|
|
141638
|
-
return filesByName.get(
|
|
141637
|
+
function getSourceFileByPath(path22) {
|
|
141638
|
+
return filesByName.get(path22) || void 0;
|
|
141639
141639
|
}
|
|
141640
141640
|
function getDiagnosticsHelper(sourceFile, getDiagnostics2, cancellationToken) {
|
|
141641
141641
|
if (sourceFile) {
|
|
@@ -142275,16 +142275,16 @@ ${lanes.join("\n")}
|
|
|
142275
142275
|
addFilePreprocessingFileExplainingDiagnostic(existingFile, reason, Diagnostics.File_name_0_differs_from_already_included_file_name_1_only_in_casing, [fileName, existingFile.fileName]);
|
|
142276
142276
|
}
|
|
142277
142277
|
}
|
|
142278
|
-
function createRedirectedSourceFile(redirectTarget, unredirected, fileName,
|
|
142278
|
+
function createRedirectedSourceFile(redirectTarget, unredirected, fileName, path22, resolvedPath, originalFileName, sourceFileOptions) {
|
|
142279
142279
|
var _a22;
|
|
142280
142280
|
const redirect = parseNodeFactory.createRedirectedSourceFile({ redirectTarget, unredirected });
|
|
142281
142281
|
redirect.fileName = fileName;
|
|
142282
|
-
redirect.path =
|
|
142282
|
+
redirect.path = path22;
|
|
142283
142283
|
redirect.resolvedPath = resolvedPath;
|
|
142284
142284
|
redirect.originalFileName = originalFileName;
|
|
142285
142285
|
redirect.packageJsonLocations = ((_a22 = sourceFileOptions.packageJsonLocations) == null ? void 0 : _a22.length) ? sourceFileOptions.packageJsonLocations : void 0;
|
|
142286
142286
|
redirect.packageJsonScope = sourceFileOptions.packageJsonScope;
|
|
142287
|
-
sourceFilesFoundSearchingNodeModules.set(
|
|
142287
|
+
sourceFilesFoundSearchingNodeModules.set(path22, currentNodeModulesDepth > 0);
|
|
142288
142288
|
return redirect;
|
|
142289
142289
|
}
|
|
142290
142290
|
function findSourceFile(fileName, isDefaultLib, reason, packageId) {
|
|
@@ -142306,18 +142306,18 @@ ${lanes.join("\n")}
|
|
|
142306
142306
|
}
|
|
142307
142307
|
function findSourceFileWorker(fileName, isDefaultLib, reason, packageId) {
|
|
142308
142308
|
var _a22, _b2;
|
|
142309
|
-
const
|
|
142309
|
+
const path22 = toPath3(fileName);
|
|
142310
142310
|
if (useSourceOfProjectReferenceRedirect) {
|
|
142311
|
-
let source = getRedirectFromOutput(
|
|
142311
|
+
let source = getRedirectFromOutput(path22);
|
|
142312
142312
|
if (!source && host.realpath && options.preserveSymlinks && isDeclarationFileName(fileName) && fileName.includes(nodeModulesPathPart)) {
|
|
142313
142313
|
const realPath2 = toPath3(host.realpath(fileName));
|
|
142314
|
-
if (realPath2 !==
|
|
142314
|
+
if (realPath2 !== path22) source = getRedirectFromOutput(realPath2);
|
|
142315
142315
|
}
|
|
142316
142316
|
if (source == null ? void 0 : source.source) {
|
|
142317
142317
|
const file22 = findSourceFile(source.source, isDefaultLib, reason, packageId);
|
|
142318
142318
|
if (file22) addFileToFilesByName(
|
|
142319
142319
|
file22,
|
|
142320
|
-
|
|
142320
|
+
path22,
|
|
142321
142321
|
fileName,
|
|
142322
142322
|
/*redirectedPath*/
|
|
142323
142323
|
void 0
|
|
@@ -142326,8 +142326,8 @@ ${lanes.join("\n")}
|
|
|
142326
142326
|
}
|
|
142327
142327
|
}
|
|
142328
142328
|
const originalFileName = fileName;
|
|
142329
|
-
if (filesByName.has(
|
|
142330
|
-
const file22 = filesByName.get(
|
|
142329
|
+
if (filesByName.has(path22)) {
|
|
142330
|
+
const file22 = filesByName.get(path22);
|
|
142331
142331
|
const addedReason = addFileIncludeReason(
|
|
142332
142332
|
file22 || void 0,
|
|
142333
142333
|
reason,
|
|
@@ -142393,28 +142393,28 @@ ${lanes.join("\n")}
|
|
|
142393
142393
|
const packageIdKey = packageIdToString(packageId);
|
|
142394
142394
|
const fileFromPackageId = packageIdToSourceFile.get(packageIdKey);
|
|
142395
142395
|
if (fileFromPackageId) {
|
|
142396
|
-
const dupFile = createRedirectedSourceFile(fileFromPackageId, file2, fileName,
|
|
142396
|
+
const dupFile = createRedirectedSourceFile(fileFromPackageId, file2, fileName, path22, toPath3(fileName), originalFileName, sourceFileOptions);
|
|
142397
142397
|
redirectTargetsMap.add(fileFromPackageId.path, fileName);
|
|
142398
|
-
addFileToFilesByName(dupFile,
|
|
142398
|
+
addFileToFilesByName(dupFile, path22, fileName, redirectedPath);
|
|
142399
142399
|
addFileIncludeReason(
|
|
142400
142400
|
dupFile,
|
|
142401
142401
|
reason,
|
|
142402
142402
|
/*checkExisting*/
|
|
142403
142403
|
false
|
|
142404
142404
|
);
|
|
142405
|
-
sourceFileToPackageName.set(
|
|
142405
|
+
sourceFileToPackageName.set(path22, packageIdToPackageName(packageId));
|
|
142406
142406
|
processingOtherFiles.push(dupFile);
|
|
142407
142407
|
return dupFile;
|
|
142408
142408
|
} else if (file2) {
|
|
142409
142409
|
packageIdToSourceFile.set(packageIdKey, file2);
|
|
142410
|
-
sourceFileToPackageName.set(
|
|
142410
|
+
sourceFileToPackageName.set(path22, packageIdToPackageName(packageId));
|
|
142411
142411
|
}
|
|
142412
142412
|
}
|
|
142413
|
-
addFileToFilesByName(file2,
|
|
142413
|
+
addFileToFilesByName(file2, path22, fileName, redirectedPath);
|
|
142414
142414
|
if (file2) {
|
|
142415
|
-
sourceFilesFoundSearchingNodeModules.set(
|
|
142415
|
+
sourceFilesFoundSearchingNodeModules.set(path22, currentNodeModulesDepth > 0);
|
|
142416
142416
|
file2.fileName = fileName;
|
|
142417
|
-
file2.path =
|
|
142417
|
+
file2.path = path22;
|
|
142418
142418
|
file2.resolvedPath = toPath3(fileName);
|
|
142419
142419
|
file2.originalFileName = originalFileName;
|
|
142420
142420
|
file2.packageJsonLocations = ((_b2 = sourceFileOptions.packageJsonLocations) == null ? void 0 : _b2.length) ? sourceFileOptions.packageJsonLocations : void 0;
|
|
@@ -142426,7 +142426,7 @@ ${lanes.join("\n")}
|
|
|
142426
142426
|
false
|
|
142427
142427
|
);
|
|
142428
142428
|
if (host.useCaseSensitiveFileNames()) {
|
|
142429
|
-
const pathLowerCase = toFileNameLowerCase(
|
|
142429
|
+
const pathLowerCase = toFileNameLowerCase(path22);
|
|
142430
142430
|
const existingFile = filesByNameIgnoreCase.get(pathLowerCase);
|
|
142431
142431
|
if (existingFile) {
|
|
142432
142432
|
reportFileNamesDifferOnlyInCasingError(fileName, existingFile, reason);
|
|
@@ -142458,18 +142458,18 @@ ${lanes.join("\n")}
|
|
|
142458
142458
|
}
|
|
142459
142459
|
return false;
|
|
142460
142460
|
}
|
|
142461
|
-
function addFileToFilesByName(file2,
|
|
142461
|
+
function addFileToFilesByName(file2, path22, fileName, redirectedPath) {
|
|
142462
142462
|
if (redirectedPath) {
|
|
142463
142463
|
updateFilesByNameMap(fileName, redirectedPath, file2);
|
|
142464
|
-
updateFilesByNameMap(fileName,
|
|
142464
|
+
updateFilesByNameMap(fileName, path22, file2 || false);
|
|
142465
142465
|
} else {
|
|
142466
|
-
updateFilesByNameMap(fileName,
|
|
142466
|
+
updateFilesByNameMap(fileName, path22, file2);
|
|
142467
142467
|
}
|
|
142468
142468
|
}
|
|
142469
|
-
function updateFilesByNameMap(fileName,
|
|
142470
|
-
filesByName.set(
|
|
142471
|
-
if (file2 !== void 0) missingFileNames.delete(
|
|
142472
|
-
else missingFileNames.set(
|
|
142469
|
+
function updateFilesByNameMap(fileName, path22, file2) {
|
|
142470
|
+
filesByName.set(path22, file2);
|
|
142471
|
+
if (file2 !== void 0) missingFileNames.delete(path22);
|
|
142472
|
+
else missingFileNames.set(path22, fileName);
|
|
142473
142473
|
}
|
|
142474
142474
|
function getRedirectFromSourceFile(fileName) {
|
|
142475
142475
|
return mapSourceFileToResolvedRef == null ? void 0 : mapSourceFileToResolvedRef.get(toPath3(fileName));
|
|
@@ -142477,8 +142477,8 @@ ${lanes.join("\n")}
|
|
|
142477
142477
|
function forEachResolvedProjectReference2(cb) {
|
|
142478
142478
|
return forEachResolvedProjectReference(resolvedProjectReferences, cb);
|
|
142479
142479
|
}
|
|
142480
|
-
function getRedirectFromOutput(
|
|
142481
|
-
return mapOutputFileToResolvedRef == null ? void 0 : mapOutputFileToResolvedRef.get(
|
|
142480
|
+
function getRedirectFromOutput(path22) {
|
|
142481
|
+
return mapOutputFileToResolvedRef == null ? void 0 : mapOutputFileToResolvedRef.get(path22);
|
|
142482
142482
|
}
|
|
142483
142483
|
function isSourceOfProjectReferenceRedirect(fileName) {
|
|
142484
142484
|
return useSourceOfProjectReferenceRedirect && !!getRedirectFromSourceFile(fileName);
|
|
@@ -142770,7 +142770,7 @@ ${lanes.join("\n")}
|
|
|
142770
142770
|
}
|
|
142771
142771
|
const getCommonSourceDirectory3 = memoize(() => getCommonSourceDirectoryOfConfig(resolvedRef.commandLine, !host.useCaseSensitiveFileNames()));
|
|
142772
142772
|
commandLine.fileNames.forEach((fileName) => {
|
|
142773
|
-
const
|
|
142773
|
+
const path22 = toPath3(fileName);
|
|
142774
142774
|
let outputDts;
|
|
142775
142775
|
if (!isDeclarationFileName(fileName) && !fileExtensionIs(
|
|
142776
142776
|
fileName,
|
|
@@ -142784,7 +142784,7 @@ ${lanes.join("\n")}
|
|
|
142784
142784
|
outputDts = outDts;
|
|
142785
142785
|
}
|
|
142786
142786
|
}
|
|
142787
|
-
mapSourceFileToResolvedRef.set(
|
|
142787
|
+
mapSourceFileToResolvedRef.set(path22, { resolvedRef, outputDts });
|
|
142788
142788
|
});
|
|
142789
142789
|
}
|
|
142790
142790
|
if (commandLine.projectReferences) {
|
|
@@ -143583,9 +143583,9 @@ ${lanes.join("\n")}
|
|
|
143583
143583
|
host.compilerHost.fileExists = fileExists;
|
|
143584
143584
|
let directoryExists;
|
|
143585
143585
|
if (originalDirectoryExists) {
|
|
143586
|
-
directoryExists = host.compilerHost.directoryExists = (
|
|
143587
|
-
if (originalDirectoryExists.call(host.compilerHost,
|
|
143588
|
-
handleDirectoryCouldBeSymlink(
|
|
143586
|
+
directoryExists = host.compilerHost.directoryExists = (path22) => {
|
|
143587
|
+
if (originalDirectoryExists.call(host.compilerHost, path22)) {
|
|
143588
|
+
handleDirectoryCouldBeSymlink(path22);
|
|
143589
143589
|
return true;
|
|
143590
143590
|
}
|
|
143591
143591
|
if (!host.getResolvedProjectReferences()) return false;
|
|
@@ -143604,14 +143604,14 @@ ${lanes.join("\n")}
|
|
|
143604
143604
|
});
|
|
143605
143605
|
}
|
|
143606
143606
|
return fileOrDirectoryExistsUsingSource(
|
|
143607
|
-
|
|
143607
|
+
path22,
|
|
143608
143608
|
/*isFile*/
|
|
143609
143609
|
false
|
|
143610
143610
|
);
|
|
143611
143611
|
};
|
|
143612
143612
|
}
|
|
143613
143613
|
if (originalGetDirectories) {
|
|
143614
|
-
host.compilerHost.getDirectories = (
|
|
143614
|
+
host.compilerHost.getDirectories = (path22) => !host.getResolvedProjectReferences() || originalDirectoryExists && originalDirectoryExists.call(host.compilerHost, path22) ? originalGetDirectories.call(host.compilerHost, path22) : [];
|
|
143615
143615
|
}
|
|
143616
143616
|
if (originalRealpath) {
|
|
143617
143617
|
host.compilerHost.realpath = (s) => {
|
|
@@ -144277,12 +144277,12 @@ ${lanes.join("\n")}
|
|
|
144277
144277
|
state.allFileNames = void 0;
|
|
144278
144278
|
}
|
|
144279
144279
|
BuilderState2.releaseCache = releaseCache2;
|
|
144280
|
-
function getFilesAffectedBy(state, programOfThisState,
|
|
144280
|
+
function getFilesAffectedBy(state, programOfThisState, path22, cancellationToken, host) {
|
|
144281
144281
|
var _a3;
|
|
144282
144282
|
const result = getFilesAffectedByWithOldState(
|
|
144283
144283
|
state,
|
|
144284
144284
|
programOfThisState,
|
|
144285
|
-
|
|
144285
|
+
path22,
|
|
144286
144286
|
cancellationToken,
|
|
144287
144287
|
host
|
|
144288
144288
|
);
|
|
@@ -144290,8 +144290,8 @@ ${lanes.join("\n")}
|
|
|
144290
144290
|
return result;
|
|
144291
144291
|
}
|
|
144292
144292
|
BuilderState2.getFilesAffectedBy = getFilesAffectedBy;
|
|
144293
|
-
function getFilesAffectedByWithOldState(state, programOfThisState,
|
|
144294
|
-
const sourceFile = programOfThisState.getSourceFileByPath(
|
|
144293
|
+
function getFilesAffectedByWithOldState(state, programOfThisState, path22, cancellationToken, host) {
|
|
144294
|
+
const sourceFile = programOfThisState.getSourceFileByPath(path22);
|
|
144295
144295
|
if (!sourceFile) {
|
|
144296
144296
|
return emptyArray;
|
|
144297
144297
|
}
|
|
@@ -144301,9 +144301,9 @@ ${lanes.join("\n")}
|
|
|
144301
144301
|
return (state.referencedMap ? getFilesAffectedByUpdatedShapeWhenModuleEmit : getFilesAffectedByUpdatedShapeWhenNonModuleEmit)(state, programOfThisState, sourceFile, cancellationToken, host);
|
|
144302
144302
|
}
|
|
144303
144303
|
BuilderState2.getFilesAffectedByWithOldState = getFilesAffectedByWithOldState;
|
|
144304
|
-
function updateSignatureOfFile(state, signature,
|
|
144305
|
-
state.fileInfos.get(
|
|
144306
|
-
(state.hasCalledUpdateShapeSignature || (state.hasCalledUpdateShapeSignature = /* @__PURE__ */ new Set())).add(
|
|
144304
|
+
function updateSignatureOfFile(state, signature, path22) {
|
|
144305
|
+
state.fileInfos.get(path22).signature = signature;
|
|
144306
|
+
(state.hasCalledUpdateShapeSignature || (state.hasCalledUpdateShapeSignature = /* @__PURE__ */ new Set())).add(path22);
|
|
144307
144307
|
}
|
|
144308
144308
|
BuilderState2.updateSignatureOfFile = updateSignatureOfFile;
|
|
144309
144309
|
function computeDtsSignature(programOfThisState, sourceFile, cancellationToken, host, onNewSignature) {
|
|
@@ -144372,10 +144372,10 @@ ${lanes.join("\n")}
|
|
|
144372
144372
|
const seenMap = /* @__PURE__ */ new Set();
|
|
144373
144373
|
const queue = [sourceFile.resolvedPath];
|
|
144374
144374
|
while (queue.length) {
|
|
144375
|
-
const
|
|
144376
|
-
if (!seenMap.has(
|
|
144377
|
-
seenMap.add(
|
|
144378
|
-
const references = state.referencedMap.getValues(
|
|
144375
|
+
const path22 = queue.pop();
|
|
144376
|
+
if (!seenMap.has(path22)) {
|
|
144377
|
+
seenMap.add(path22);
|
|
144378
|
+
const references = state.referencedMap.getValues(path22);
|
|
144379
144379
|
if (references) {
|
|
144380
144380
|
for (const key of references.keys()) {
|
|
144381
144381
|
queue.push(key);
|
|
@@ -144383,9 +144383,9 @@ ${lanes.join("\n")}
|
|
|
144383
144383
|
}
|
|
144384
144384
|
}
|
|
144385
144385
|
}
|
|
144386
|
-
return arrayFrom(mapDefinedIterator(seenMap.keys(), (
|
|
144386
|
+
return arrayFrom(mapDefinedIterator(seenMap.keys(), (path22) => {
|
|
144387
144387
|
var _a3;
|
|
144388
|
-
return ((_a3 = programOfThisState.getSourceFileByPath(
|
|
144388
|
+
return ((_a3 = programOfThisState.getSourceFileByPath(path22)) == null ? void 0 : _a3.fileName) ?? path22;
|
|
144389
144389
|
}));
|
|
144390
144390
|
}
|
|
144391
144391
|
BuilderState2.getAllDependencies = getAllDependencies;
|
|
@@ -144564,7 +144564,7 @@ ${lanes.join("\n")}
|
|
|
144564
144564
|
oldInfo.version !== info.version || // Implied formats dont match
|
|
144565
144565
|
oldInfo.impliedFormat !== info.impliedFormat || // Referenced files changed
|
|
144566
144566
|
!hasSameKeys(newReferences = referencedMap && referencedMap.getValues(sourceFilePath), oldReferencedMap && oldReferencedMap.getValues(sourceFilePath)) || // Referenced file was deleted in the new program
|
|
144567
|
-
newReferences && forEachKey(newReferences, (
|
|
144567
|
+
newReferences && forEachKey(newReferences, (path22) => !state.fileInfos.has(path22) && oldState.fileInfos.has(path22))) {
|
|
144568
144568
|
addFileToChangeSet(sourceFilePath);
|
|
144569
144569
|
} else {
|
|
144570
144570
|
const sourceFile = newProgram.getSourceFileByPath(sourceFilePath);
|
|
@@ -144630,8 +144630,8 @@ ${lanes.join("\n")}
|
|
|
144630
144630
|
}
|
|
144631
144631
|
if (useOldState && state.semanticDiagnosticsPerFile.size !== state.fileInfos.size && oldState.checkPending !== state.checkPending) state.buildInfoEmitPending = true;
|
|
144632
144632
|
return state;
|
|
144633
|
-
function addFileToChangeSet(
|
|
144634
|
-
state.changedFilesSet.add(
|
|
144633
|
+
function addFileToChangeSet(path22) {
|
|
144634
|
+
state.changedFilesSet.add(path22);
|
|
144635
144635
|
if (outFilePath) {
|
|
144636
144636
|
canCopySemanticDiagnostics = false;
|
|
144637
144637
|
canCopyEmitDiagnostics = false;
|
|
@@ -144695,9 +144695,9 @@ ${lanes.join("\n")}
|
|
|
144695
144695
|
result.relatedInformation = relatedInformation ? relatedInformation.length ? relatedInformation.map((r2) => convertToDiagnosticRelatedInformation(r2, diagnosticFilePath, newProgram, toPathInBuildInfoDirectory)) : [] : void 0;
|
|
144696
144696
|
return result;
|
|
144697
144697
|
});
|
|
144698
|
-
function toPathInBuildInfoDirectory(
|
|
144698
|
+
function toPathInBuildInfoDirectory(path22) {
|
|
144699
144699
|
buildInfoDirectory ?? (buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(getTsBuildInfoEmitOutputFilePath(newProgram.getCompilerOptions()), newProgram.getCurrentDirectory())));
|
|
144700
|
-
return toPath(
|
|
144700
|
+
return toPath(path22, buildInfoDirectory, newProgram.getCanonicalFileName);
|
|
144701
144701
|
}
|
|
144702
144702
|
}
|
|
144703
144703
|
function convertToDiagnosticRelatedInformation(diagnostic, diagnosticFilePath, newProgram, toPath3) {
|
|
@@ -144772,10 +144772,10 @@ ${lanes.join("\n")}
|
|
|
144772
144772
|
state.affectedFilesPendingEmit = void 0;
|
|
144773
144773
|
state.programEmitPending = void 0;
|
|
144774
144774
|
}
|
|
144775
|
-
(_b = state.affectedFilesPendingEmit) == null ? void 0 : _b.forEach((emitKind,
|
|
144775
|
+
(_b = state.affectedFilesPendingEmit) == null ? void 0 : _b.forEach((emitKind, path22) => {
|
|
144776
144776
|
const pending = !isForDtsErrors ? emitKind & 7 : emitKind & (7 | 48);
|
|
144777
|
-
if (!pending) state.affectedFilesPendingEmit.delete(
|
|
144778
|
-
else state.affectedFilesPendingEmit.set(
|
|
144777
|
+
if (!pending) state.affectedFilesPendingEmit.delete(path22);
|
|
144778
|
+
else state.affectedFilesPendingEmit.set(path22, pending);
|
|
144779
144779
|
});
|
|
144780
144780
|
if (state.programEmitPending) {
|
|
144781
144781
|
const pending = !isForDtsErrors ? state.programEmitPending & 7 : state.programEmitPending & (7 | 48);
|
|
@@ -144795,11 +144795,11 @@ ${lanes.join("\n")}
|
|
|
144795
144795
|
function getNextAffectedFilePendingEmit(state, emitOnlyDtsFiles, isForDtsErrors) {
|
|
144796
144796
|
var _a3;
|
|
144797
144797
|
if (!((_a3 = state.affectedFilesPendingEmit) == null ? void 0 : _a3.size)) return void 0;
|
|
144798
|
-
return forEachEntry(state.affectedFilesPendingEmit, (emitKind,
|
|
144798
|
+
return forEachEntry(state.affectedFilesPendingEmit, (emitKind, path22) => {
|
|
144799
144799
|
var _a22;
|
|
144800
|
-
const affectedFile = state.program.getSourceFileByPath(
|
|
144800
|
+
const affectedFile = state.program.getSourceFileByPath(path22);
|
|
144801
144801
|
if (!affectedFile || !sourceFileMayBeEmitted(affectedFile, state.program)) {
|
|
144802
|
-
state.affectedFilesPendingEmit.delete(
|
|
144802
|
+
state.affectedFilesPendingEmit.delete(path22);
|
|
144803
144803
|
return void 0;
|
|
144804
144804
|
}
|
|
144805
144805
|
const seenKind = (_a22 = state.seenEmittedFiles) == null ? void 0 : _a22.get(affectedFile.resolvedPath);
|
|
@@ -144815,11 +144815,11 @@ ${lanes.join("\n")}
|
|
|
144815
144815
|
function getNextPendingEmitDiagnosticsFile(state, isForDtsErrors) {
|
|
144816
144816
|
var _a3;
|
|
144817
144817
|
if (!((_a3 = state.emitDiagnosticsPerFile) == null ? void 0 : _a3.size)) return void 0;
|
|
144818
|
-
return forEachEntry(state.emitDiagnosticsPerFile, (diagnostics,
|
|
144818
|
+
return forEachEntry(state.emitDiagnosticsPerFile, (diagnostics, path22) => {
|
|
144819
144819
|
var _a22;
|
|
144820
|
-
const affectedFile = state.program.getSourceFileByPath(
|
|
144820
|
+
const affectedFile = state.program.getSourceFileByPath(path22);
|
|
144821
144821
|
if (!affectedFile || !sourceFileMayBeEmitted(affectedFile, state.program)) {
|
|
144822
|
-
state.emitDiagnosticsPerFile.delete(
|
|
144822
|
+
state.emitDiagnosticsPerFile.delete(path22);
|
|
144823
144823
|
return void 0;
|
|
144824
144824
|
}
|
|
144825
144825
|
const seenKind = ((_a22 = state.seenEmittedFiles) == null ? void 0 : _a22.get(affectedFile.resolvedPath)) || 0;
|
|
@@ -144854,10 +144854,10 @@ ${lanes.join("\n")}
|
|
|
144854
144854
|
host
|
|
144855
144855
|
);
|
|
144856
144856
|
}
|
|
144857
|
-
function handleDtsMayChangeOf(state,
|
|
144858
|
-
removeSemanticDiagnosticsOf(state,
|
|
144859
|
-
if (!state.changedFilesSet.has(
|
|
144860
|
-
const sourceFile = state.program.getSourceFileByPath(
|
|
144857
|
+
function handleDtsMayChangeOf(state, path22, invalidateJsFiles, cancellationToken, host) {
|
|
144858
|
+
removeSemanticDiagnosticsOf(state, path22);
|
|
144859
|
+
if (!state.changedFilesSet.has(path22)) {
|
|
144860
|
+
const sourceFile = state.program.getSourceFileByPath(path22);
|
|
144861
144861
|
if (sourceFile) {
|
|
144862
144862
|
BuilderState.updateShapeSignature(
|
|
144863
144863
|
state,
|
|
@@ -144871,13 +144871,13 @@ ${lanes.join("\n")}
|
|
|
144871
144871
|
if (invalidateJsFiles) {
|
|
144872
144872
|
addToAffectedFilesPendingEmit(
|
|
144873
144873
|
state,
|
|
144874
|
-
|
|
144874
|
+
path22,
|
|
144875
144875
|
getBuilderFileEmit(state.compilerOptions)
|
|
144876
144876
|
);
|
|
144877
144877
|
} else if (getEmitDeclarations(state.compilerOptions)) {
|
|
144878
144878
|
addToAffectedFilesPendingEmit(
|
|
144879
144879
|
state,
|
|
144880
|
-
|
|
144880
|
+
path22,
|
|
144881
144881
|
state.compilerOptions.declarationMap ? 56 : 24
|
|
144882
144882
|
/* Dts */
|
|
144883
144883
|
);
|
|
@@ -144885,17 +144885,17 @@ ${lanes.join("\n")}
|
|
|
144885
144885
|
}
|
|
144886
144886
|
}
|
|
144887
144887
|
}
|
|
144888
|
-
function removeSemanticDiagnosticsOf(state,
|
|
144888
|
+
function removeSemanticDiagnosticsOf(state, path22) {
|
|
144889
144889
|
if (!state.semanticDiagnosticsFromOldState) {
|
|
144890
144890
|
return true;
|
|
144891
144891
|
}
|
|
144892
|
-
state.semanticDiagnosticsFromOldState.delete(
|
|
144893
|
-
state.semanticDiagnosticsPerFile.delete(
|
|
144892
|
+
state.semanticDiagnosticsFromOldState.delete(path22);
|
|
144893
|
+
state.semanticDiagnosticsPerFile.delete(path22);
|
|
144894
144894
|
return !state.semanticDiagnosticsFromOldState.size;
|
|
144895
144895
|
}
|
|
144896
|
-
function isChangedSignature(state,
|
|
144897
|
-
const oldSignature = Debug.checkDefined(state.oldSignatures).get(
|
|
144898
|
-
const newSignature = Debug.checkDefined(state.fileInfos.get(
|
|
144896
|
+
function isChangedSignature(state, path22) {
|
|
144897
|
+
const oldSignature = Debug.checkDefined(state.oldSignatures).get(path22) || void 0;
|
|
144898
|
+
const newSignature = Debug.checkDefined(state.fileInfos.get(path22)).signature;
|
|
144899
144899
|
return newSignature !== oldSignature;
|
|
144900
144900
|
}
|
|
144901
144901
|
function handleDtsMayChangeOfGlobalScope(state, filePath, invalidateJsFiles, cancellationToken, host) {
|
|
@@ -145002,13 +145002,13 @@ ${lanes.join("\n")}
|
|
|
145002
145002
|
}
|
|
145003
145003
|
function getBinderAndCheckerDiagnosticsOfFile(state, sourceFile, cancellationToken, semanticDiagnosticsPerFile) {
|
|
145004
145004
|
semanticDiagnosticsPerFile ?? (semanticDiagnosticsPerFile = state.semanticDiagnosticsPerFile);
|
|
145005
|
-
const
|
|
145006
|
-
const cachedDiagnostics = semanticDiagnosticsPerFile.get(
|
|
145005
|
+
const path22 = sourceFile.resolvedPath;
|
|
145006
|
+
const cachedDiagnostics = semanticDiagnosticsPerFile.get(path22);
|
|
145007
145007
|
if (cachedDiagnostics) {
|
|
145008
145008
|
return filterSemanticDiagnostics(cachedDiagnostics, state.compilerOptions);
|
|
145009
145009
|
}
|
|
145010
145010
|
const diagnostics = state.program.getBindAndCheckDiagnostics(sourceFile, cancellationToken);
|
|
145011
|
-
semanticDiagnosticsPerFile.set(
|
|
145011
|
+
semanticDiagnosticsPerFile.set(path22, diagnostics);
|
|
145012
145012
|
state.buildInfoEmitPending = true;
|
|
145013
145013
|
return filterSemanticDiagnostics(diagnostics, state.compilerOptions);
|
|
145014
145014
|
}
|
|
@@ -145156,11 +145156,11 @@ ${lanes.join("\n")}
|
|
|
145156
145156
|
if ((_b = state.affectedFilesPendingEmit) == null ? void 0 : _b.size) {
|
|
145157
145157
|
const fullEmitForOptions = getBuilderFileEmit(state.compilerOptions);
|
|
145158
145158
|
const seenFiles = /* @__PURE__ */ new Set();
|
|
145159
|
-
for (const
|
|
145160
|
-
if (tryAddToSet(seenFiles,
|
|
145161
|
-
const file2 = state.program.getSourceFileByPath(
|
|
145159
|
+
for (const path22 of arrayFrom(state.affectedFilesPendingEmit.keys()).sort(compareStringsCaseSensitive)) {
|
|
145160
|
+
if (tryAddToSet(seenFiles, path22)) {
|
|
145161
|
+
const file2 = state.program.getSourceFileByPath(path22);
|
|
145162
145162
|
if (!file2 || !sourceFileMayBeEmitted(file2, state.program)) continue;
|
|
145163
|
-
const fileId = toFileId(
|
|
145163
|
+
const fileId = toFileId(path22), pendingEmit = state.affectedFilesPendingEmit.get(path22);
|
|
145164
145164
|
affectedFilesPendingEmit = append(
|
|
145165
145165
|
affectedFilesPendingEmit,
|
|
145166
145166
|
pendingEmit === fullEmitForOptions ? fileId : (
|
|
@@ -145194,17 +145194,17 @@ ${lanes.join("\n")}
|
|
|
145194
145194
|
version: version2
|
|
145195
145195
|
};
|
|
145196
145196
|
return buildInfo;
|
|
145197
|
-
function relativeToBuildInfoEnsuringAbsolutePath(
|
|
145198
|
-
return relativeToBuildInfo(getNormalizedAbsolutePath(
|
|
145197
|
+
function relativeToBuildInfoEnsuringAbsolutePath(path22) {
|
|
145198
|
+
return relativeToBuildInfo(getNormalizedAbsolutePath(path22, currentDirectory));
|
|
145199
145199
|
}
|
|
145200
|
-
function relativeToBuildInfo(
|
|
145201
|
-
return ensurePathIsNonModuleName(getRelativePathFromDirectory(buildInfoDirectory,
|
|
145200
|
+
function relativeToBuildInfo(path22) {
|
|
145201
|
+
return ensurePathIsNonModuleName(getRelativePathFromDirectory(buildInfoDirectory, path22, state.program.getCanonicalFileName));
|
|
145202
145202
|
}
|
|
145203
|
-
function toFileId(
|
|
145204
|
-
let fileId = fileNameToFileId.get(
|
|
145203
|
+
function toFileId(path22) {
|
|
145204
|
+
let fileId = fileNameToFileId.get(path22);
|
|
145205
145205
|
if (fileId === void 0) {
|
|
145206
|
-
fileNames.push(relativeToBuildInfo(
|
|
145207
|
-
fileNameToFileId.set(
|
|
145206
|
+
fileNames.push(relativeToBuildInfo(path22));
|
|
145207
|
+
fileNameToFileId.set(path22, fileId = fileNames.length);
|
|
145208
145208
|
}
|
|
145209
145209
|
return fileId;
|
|
145210
145210
|
}
|
|
@@ -145218,8 +145218,8 @@ ${lanes.join("\n")}
|
|
|
145218
145218
|
}
|
|
145219
145219
|
return fileIdListId;
|
|
145220
145220
|
}
|
|
145221
|
-
function tryAddRoot(
|
|
145222
|
-
const file2 = state.program.getSourceFile(
|
|
145221
|
+
function tryAddRoot(path22, fileId) {
|
|
145222
|
+
const file2 = state.program.getSourceFile(path22);
|
|
145223
145223
|
if (!state.program.getFileIncludeReasons().get(file2.path).some(
|
|
145224
145224
|
(r2) => r2.kind === 0
|
|
145225
145225
|
/* RootFile */
|
|
@@ -145236,10 +145236,10 @@ ${lanes.join("\n")}
|
|
|
145236
145236
|
}
|
|
145237
145237
|
function toResolvedRoot() {
|
|
145238
145238
|
let result;
|
|
145239
|
-
rootFileNames.forEach((
|
|
145240
|
-
const file2 = state.program.getSourceFileByPath(
|
|
145241
|
-
if (file2 &&
|
|
145242
|
-
result = append(result, [toFileId(file2.resolvedPath), toFileId(
|
|
145239
|
+
rootFileNames.forEach((path22) => {
|
|
145240
|
+
const file2 = state.program.getSourceFileByPath(path22);
|
|
145241
|
+
if (file2 && path22 !== file2.resolvedPath) {
|
|
145242
|
+
result = append(result, [toFileId(file2.resolvedPath), toFileId(path22)]);
|
|
145243
145243
|
}
|
|
145244
145244
|
});
|
|
145245
145245
|
return result;
|
|
@@ -145347,8 +145347,8 @@ ${lanes.join("\n")}
|
|
|
145347
145347
|
function toChangeFileSet() {
|
|
145348
145348
|
let changeFileSet;
|
|
145349
145349
|
if (state.changedFilesSet.size) {
|
|
145350
|
-
for (const
|
|
145351
|
-
changeFileSet = append(changeFileSet, toFileId(
|
|
145350
|
+
for (const path22 of arrayFrom(state.changedFilesSet.keys()).sort(compareStringsCaseSensitive)) {
|
|
145351
|
+
changeFileSet = append(changeFileSet, toFileId(path22));
|
|
145352
145352
|
}
|
|
145353
145353
|
}
|
|
145354
145354
|
return changeFileSet;
|
|
@@ -145847,8 +145847,8 @@ ${lanes.join("\n")}
|
|
|
145847
145847
|
const changedFilesSet = new Set(map2(buildInfo.changeFileSet, toFilePath));
|
|
145848
145848
|
if (isIncrementalBundleEmitBuildInfo(buildInfo)) {
|
|
145849
145849
|
buildInfo.fileInfos.forEach((fileInfo, index) => {
|
|
145850
|
-
const
|
|
145851
|
-
fileInfos.set(
|
|
145850
|
+
const path22 = toFilePath(index + 1);
|
|
145851
|
+
fileInfos.set(path22, isString(fileInfo) ? { version: fileInfo, signature: void 0, affectsGlobalScope: void 0, impliedFormat: void 0 } : fileInfo);
|
|
145852
145852
|
});
|
|
145853
145853
|
state = {
|
|
145854
145854
|
fileInfos,
|
|
@@ -145867,10 +145867,10 @@ ${lanes.join("\n")}
|
|
|
145867
145867
|
filePathsSetList = (_b = buildInfo.fileIdsList) == null ? void 0 : _b.map((fileIds) => new Set(fileIds.map(toFilePath)));
|
|
145868
145868
|
const emitSignatures = ((_c = buildInfo.options) == null ? void 0 : _c.composite) && !buildInfo.options.outFile ? /* @__PURE__ */ new Map() : void 0;
|
|
145869
145869
|
buildInfo.fileInfos.forEach((fileInfo, index) => {
|
|
145870
|
-
const
|
|
145870
|
+
const path22 = toFilePath(index + 1);
|
|
145871
145871
|
const stateFileInfo = toBuilderStateFileInfoForMultiEmit(fileInfo);
|
|
145872
|
-
fileInfos.set(
|
|
145873
|
-
if (emitSignatures && stateFileInfo.signature) emitSignatures.set(
|
|
145872
|
+
fileInfos.set(path22, stateFileInfo);
|
|
145873
|
+
if (emitSignatures && stateFileInfo.signature) emitSignatures.set(path22, stateFileInfo.signature);
|
|
145874
145874
|
});
|
|
145875
145875
|
(_d = buildInfo.emitSignatures) == null ? void 0 : _d.forEach((value) => {
|
|
145876
145876
|
if (isNumber(value)) emitSignatures.delete(toFilePath(value));
|
|
@@ -145924,11 +145924,11 @@ ${lanes.join("\n")}
|
|
|
145924
145924
|
close: noop,
|
|
145925
145925
|
hasChangedEmitSignature: returnFalse
|
|
145926
145926
|
};
|
|
145927
|
-
function toPathInBuildInfoDirectory(
|
|
145928
|
-
return toPath(
|
|
145927
|
+
function toPathInBuildInfoDirectory(path22) {
|
|
145928
|
+
return toPath(path22, buildInfoDirectory, getCanonicalFileName);
|
|
145929
145929
|
}
|
|
145930
|
-
function toAbsolutePath(
|
|
145931
|
-
return getNormalizedAbsolutePath(
|
|
145930
|
+
function toAbsolutePath(path22) {
|
|
145931
|
+
return getNormalizedAbsolutePath(path22, buildInfoDirectory);
|
|
145932
145932
|
}
|
|
145933
145933
|
function toFilePath(fileId) {
|
|
145934
145934
|
return filePaths[fileId - 1];
|
|
@@ -145967,30 +145967,30 @@ ${lanes.join("\n")}
|
|
|
145967
145967
|
const roots = /* @__PURE__ */ new Map();
|
|
145968
145968
|
const resolvedRoots = new Map(program2.resolvedRoot);
|
|
145969
145969
|
program2.fileInfos.forEach((fileInfo, index) => {
|
|
145970
|
-
const
|
|
145970
|
+
const path22 = toPath(program2.fileNames[index], buildInfoDirectory, getCanonicalFileName);
|
|
145971
145971
|
const version22 = isString(fileInfo) ? fileInfo : fileInfo.version;
|
|
145972
|
-
fileInfos.set(
|
|
145972
|
+
fileInfos.set(path22, version22);
|
|
145973
145973
|
if (rootIndex < program2.root.length) {
|
|
145974
145974
|
const current = program2.root[rootIndex];
|
|
145975
145975
|
const fileId = index + 1;
|
|
145976
145976
|
if (isArray(current)) {
|
|
145977
145977
|
if (current[0] <= fileId && fileId <= current[1]) {
|
|
145978
|
-
addRoot(fileId,
|
|
145978
|
+
addRoot(fileId, path22);
|
|
145979
145979
|
if (current[1] === fileId) rootIndex++;
|
|
145980
145980
|
}
|
|
145981
145981
|
} else if (current === fileId) {
|
|
145982
|
-
addRoot(fileId,
|
|
145982
|
+
addRoot(fileId, path22);
|
|
145983
145983
|
rootIndex++;
|
|
145984
145984
|
}
|
|
145985
145985
|
}
|
|
145986
145986
|
});
|
|
145987
145987
|
return { fileInfos, roots };
|
|
145988
|
-
function addRoot(fileId,
|
|
145988
|
+
function addRoot(fileId, path22) {
|
|
145989
145989
|
const root = resolvedRoots.get(fileId);
|
|
145990
145990
|
if (root) {
|
|
145991
|
-
roots.set(toPath(program2.fileNames[root - 1], buildInfoDirectory, getCanonicalFileName),
|
|
145991
|
+
roots.set(toPath(program2.fileNames[root - 1], buildInfoDirectory, getCanonicalFileName), path22);
|
|
145992
145992
|
} else {
|
|
145993
|
-
roots.set(
|
|
145993
|
+
roots.set(path22, void 0);
|
|
145994
145994
|
}
|
|
145995
145995
|
}
|
|
145996
145996
|
}
|
|
@@ -146065,11 +146065,11 @@ ${lanes.join("\n")}
|
|
|
146065
146065
|
newConfigFileParsingDiagnostics
|
|
146066
146066
|
);
|
|
146067
146067
|
}
|
|
146068
|
-
function removeIgnoredPath(
|
|
146069
|
-
if (endsWith(
|
|
146070
|
-
return removeSuffix(
|
|
146068
|
+
function removeIgnoredPath(path22) {
|
|
146069
|
+
if (endsWith(path22, "/node_modules/.staging")) {
|
|
146070
|
+
return removeSuffix(path22, "/.staging");
|
|
146071
146071
|
}
|
|
146072
|
-
return some(ignoredPaths, (searchPath) =>
|
|
146072
|
+
return some(ignoredPaths, (searchPath) => path22.includes(searchPath)) ? void 0 : path22;
|
|
146073
146073
|
}
|
|
146074
146074
|
function perceivedOsRootLengthForWatching(pathComponents2, length2) {
|
|
146075
146075
|
if (length2 <= 1) return 1;
|
|
@@ -146095,8 +146095,8 @@ ${lanes.join("\n")}
|
|
|
146095
146095
|
const perceivedOsRootLength = perceivedOsRootLengthForWatching(pathComponents2, length2);
|
|
146096
146096
|
return length2 > perceivedOsRootLength + 1;
|
|
146097
146097
|
}
|
|
146098
|
-
function canWatchDirectoryOrFilePath(
|
|
146099
|
-
return canWatchDirectoryOrFile(getPathComponents(
|
|
146098
|
+
function canWatchDirectoryOrFilePath(path22) {
|
|
146099
|
+
return canWatchDirectoryOrFile(getPathComponents(path22));
|
|
146100
146100
|
}
|
|
146101
146101
|
function canWatchAtTypes(atTypes) {
|
|
146102
146102
|
return canWatchAffectedPackageJsonOrNodeModulesOfAtTypes(getDirectoryPath(atTypes));
|
|
@@ -146390,11 +146390,11 @@ ${lanes.join("\n")}
|
|
|
146390
146390
|
filesWithChangedSetOfUnresolvedImports = void 0;
|
|
146391
146391
|
return collected;
|
|
146392
146392
|
}
|
|
146393
|
-
function isFileWithInvalidatedNonRelativeUnresolvedImports(
|
|
146393
|
+
function isFileWithInvalidatedNonRelativeUnresolvedImports(path22) {
|
|
146394
146394
|
if (!filesWithInvalidatedNonRelativeUnresolvedImports) {
|
|
146395
146395
|
return false;
|
|
146396
146396
|
}
|
|
146397
|
-
const value = filesWithInvalidatedNonRelativeUnresolvedImports.get(
|
|
146397
|
+
const value = filesWithInvalidatedNonRelativeUnresolvedImports.get(path22);
|
|
146398
146398
|
return !!value && !!value.length;
|
|
146399
146399
|
}
|
|
146400
146400
|
function createHasInvalidatedResolutions(customHasInvalidatedResolutions, customHasInvalidatedLibResolutions) {
|
|
@@ -146402,7 +146402,7 @@ ${lanes.join("\n")}
|
|
|
146402
146402
|
const collected = filesWithInvalidatedResolutions;
|
|
146403
146403
|
filesWithInvalidatedResolutions = void 0;
|
|
146404
146404
|
return {
|
|
146405
|
-
hasInvalidatedResolutions: (
|
|
146405
|
+
hasInvalidatedResolutions: (path22) => customHasInvalidatedResolutions(path22) || allModuleAndTypeResolutionsAreInvalidated || !!(collected == null ? void 0 : collected.has(path22)) || isFileWithInvalidatedNonRelativeUnresolvedImports(path22),
|
|
146406
146406
|
hasInvalidatedLibResolutions: (libFileName) => {
|
|
146407
146407
|
var _a3;
|
|
146408
146408
|
return customHasInvalidatedLibResolutions(libFileName) || !!((_a3 = resolvedLibraries == null ? void 0 : resolvedLibraries.get(libFileName)) == null ? void 0 : _a3.isInvalidated);
|
|
@@ -146458,11 +146458,11 @@ ${lanes.join("\n")}
|
|
|
146458
146458
|
if (expected) impliedFormatPackageJsons.set(newFile.resolvedPath, newFile.packageJsonLocations);
|
|
146459
146459
|
else impliedFormatPackageJsons.delete(newFile.resolvedPath);
|
|
146460
146460
|
});
|
|
146461
|
-
impliedFormatPackageJsons.forEach((existing,
|
|
146462
|
-
const newFile = newProgram == null ? void 0 : newProgram.getSourceFileByPath(
|
|
146463
|
-
if (!newFile || newFile.resolvedPath !==
|
|
146461
|
+
impliedFormatPackageJsons.forEach((existing, path22) => {
|
|
146462
|
+
const newFile = newProgram == null ? void 0 : newProgram.getSourceFileByPath(path22);
|
|
146463
|
+
if (!newFile || newFile.resolvedPath !== path22) {
|
|
146464
146464
|
existing.forEach((location) => fileWatchesOfAffectingLocations.get(location).files--);
|
|
146465
|
-
impliedFormatPackageJsons.delete(
|
|
146465
|
+
impliedFormatPackageJsons.delete(path22);
|
|
146466
146466
|
}
|
|
146467
146467
|
});
|
|
146468
146468
|
}
|
|
@@ -146481,16 +146481,16 @@ ${lanes.join("\n")}
|
|
|
146481
146481
|
packageDirWatchers.delete(packageDirPath);
|
|
146482
146482
|
}
|
|
146483
146483
|
}
|
|
146484
|
-
function closeDirectoryWatchesOfFailedLookup(watcher,
|
|
146484
|
+
function closeDirectoryWatchesOfFailedLookup(watcher, path22) {
|
|
146485
146485
|
if (watcher.refCount === 0) {
|
|
146486
|
-
directoryWatchesOfFailedLookups.delete(
|
|
146486
|
+
directoryWatchesOfFailedLookups.delete(path22);
|
|
146487
146487
|
watcher.watcher.close();
|
|
146488
146488
|
}
|
|
146489
146489
|
}
|
|
146490
|
-
function closeFileWatcherOfAffectingLocation(watcher,
|
|
146490
|
+
function closeFileWatcherOfAffectingLocation(watcher, path22) {
|
|
146491
146491
|
var _a3;
|
|
146492
146492
|
if (watcher.files === 0 && watcher.resolutions === 0 && !((_a3 = watcher.symlinks) == null ? void 0 : _a3.size)) {
|
|
146493
|
-
fileWatchesOfAffectingLocations.delete(
|
|
146493
|
+
fileWatchesOfAffectingLocations.delete(path22);
|
|
146494
146494
|
watcher.watcher.close();
|
|
146495
146495
|
}
|
|
146496
146496
|
}
|
|
@@ -146509,10 +146509,10 @@ ${lanes.join("\n")}
|
|
|
146509
146509
|
logChanges
|
|
146510
146510
|
}) {
|
|
146511
146511
|
var _a3, _b;
|
|
146512
|
-
const
|
|
146513
|
-
const resolutionsInFile = perFileCache.get(
|
|
146512
|
+
const path22 = resolutionHost.toPath(containingFile);
|
|
146513
|
+
const resolutionsInFile = perFileCache.get(path22) || perFileCache.set(path22, createModeAwareCache()).get(path22);
|
|
146514
146514
|
const resolvedModules = [];
|
|
146515
|
-
const hasInvalidatedNonRelativeUnresolvedImport = logChanges && isFileWithInvalidatedNonRelativeUnresolvedImports(
|
|
146515
|
+
const hasInvalidatedNonRelativeUnresolvedImport = logChanges && isFileWithInvalidatedNonRelativeUnresolvedImports(path22);
|
|
146516
146516
|
const program2 = resolutionHost.getCurrentProgram();
|
|
146517
146517
|
const oldRedirect = program2 && ((_a3 = program2.getRedirectFromSourceFile(containingFile)) == null ? void 0 : _a3.resolvedRef);
|
|
146518
146518
|
const unmatchedRedirects = oldRedirect ? !redirectedReference || redirectedReference.sourceFile.path !== oldRedirect.sourceFile.path : !!redirectedReference;
|
|
@@ -146529,14 +146529,14 @@ ${lanes.join("\n")}
|
|
|
146529
146529
|
resolutionHost.onDiscoveredSymlink();
|
|
146530
146530
|
}
|
|
146531
146531
|
resolutionsInFile.set(name, mode, resolution);
|
|
146532
|
-
if (resolution !== existingResolution && !((_b = resolutionHost.skipWatchingFailedLookups) == null ? void 0 : _b.call(resolutionHost,
|
|
146533
|
-
watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution,
|
|
146532
|
+
if (resolution !== existingResolution && !((_b = resolutionHost.skipWatchingFailedLookups) == null ? void 0 : _b.call(resolutionHost, path22))) {
|
|
146533
|
+
watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, path22, getResolutionWithResolvedFileName, deferWatchingNonRelativeResolution);
|
|
146534
146534
|
if (existingResolution) {
|
|
146535
|
-
stopWatchFailedLookupLocationOfResolution(existingResolution,
|
|
146535
|
+
stopWatchFailedLookupLocationOfResolution(existingResolution, path22, getResolutionWithResolvedFileName);
|
|
146536
146536
|
}
|
|
146537
146537
|
}
|
|
146538
146538
|
if (logChanges && filesWithChangedSetOfUnresolvedImports && !resolutionIsEqualTo(existingResolution, resolution)) {
|
|
146539
|
-
filesWithChangedSetOfUnresolvedImports.push(
|
|
146539
|
+
filesWithChangedSetOfUnresolvedImports.push(path22);
|
|
146540
146540
|
logChanges = false;
|
|
146541
146541
|
}
|
|
146542
146542
|
} else {
|
|
@@ -146568,8 +146568,8 @@ ${lanes.join("\n")}
|
|
|
146568
146568
|
resolutionsInFile.forEach((resolution, name, mode) => {
|
|
146569
146569
|
var _a22;
|
|
146570
146570
|
if (!seenNamesInFile.has(name, mode)) {
|
|
146571
|
-
if (!((_a22 = resolutionHost.skipWatchingFailedLookups) == null ? void 0 : _a22.call(resolutionHost,
|
|
146572
|
-
stopWatchFailedLookupLocationOfResolution(resolution,
|
|
146571
|
+
if (!((_a22 = resolutionHost.skipWatchingFailedLookups) == null ? void 0 : _a22.call(resolutionHost, path22))) {
|
|
146572
|
+
stopWatchFailedLookupLocationOfResolution(resolution, path22, getResolutionWithResolvedFileName);
|
|
146573
146573
|
}
|
|
146574
146574
|
resolutionsInFile.delete(name, mode);
|
|
146575
146575
|
}
|
|
@@ -146644,18 +146644,18 @@ ${lanes.join("\n")}
|
|
|
146644
146644
|
if (!resolution || resolution.isInvalidated) {
|
|
146645
146645
|
const existingResolution = resolution;
|
|
146646
146646
|
resolution = resolveLibrary(libraryName, resolveFrom, options, host, libraryResolutionCache);
|
|
146647
|
-
const
|
|
146647
|
+
const path22 = resolutionHost.toPath(resolveFrom);
|
|
146648
146648
|
watchFailedLookupLocationsOfExternalModuleResolutions(
|
|
146649
146649
|
libraryName,
|
|
146650
146650
|
resolution,
|
|
146651
|
-
|
|
146651
|
+
path22,
|
|
146652
146652
|
getResolvedModuleFromResolution,
|
|
146653
146653
|
/*deferWatchingNonRelativeResolution*/
|
|
146654
146654
|
false
|
|
146655
146655
|
);
|
|
146656
146656
|
resolvedLibraries.set(libFileName, resolution);
|
|
146657
146657
|
if (existingResolution) {
|
|
146658
|
-
stopWatchFailedLookupLocationOfResolution(existingResolution,
|
|
146658
|
+
stopWatchFailedLookupLocationOfResolution(existingResolution, path22, getResolvedModuleFromResolution);
|
|
146659
146659
|
}
|
|
146660
146660
|
} else {
|
|
146661
146661
|
if (isTraceEnabled(options, host)) {
|
|
@@ -146674,8 +146674,8 @@ ${lanes.join("\n")}
|
|
|
146674
146674
|
}
|
|
146675
146675
|
function resolveSingleModuleNameWithoutWatching(moduleName, containingFile) {
|
|
146676
146676
|
var _a3, _b;
|
|
146677
|
-
const
|
|
146678
|
-
const resolutionsInFile = resolvedModuleNames.get(
|
|
146677
|
+
const path22 = resolutionHost.toPath(containingFile);
|
|
146678
|
+
const resolutionsInFile = resolvedModuleNames.get(path22);
|
|
146679
146679
|
const resolution = resolutionsInFile == null ? void 0 : resolutionsInFile.get(
|
|
146680
146680
|
moduleName,
|
|
146681
146681
|
/*mode*/
|
|
@@ -146832,13 +146832,13 @@ ${lanes.join("\n")}
|
|
|
146832
146832
|
(symlinkWatcher.symlinks ?? (symlinkWatcher.symlinks = /* @__PURE__ */ new Set())).add(affectingLocation);
|
|
146833
146833
|
}
|
|
146834
146834
|
}
|
|
146835
|
-
function invalidateAffectingFileWatcher(
|
|
146835
|
+
function invalidateAffectingFileWatcher(path22, packageJsonMap) {
|
|
146836
146836
|
var _a3;
|
|
146837
|
-
const watcher = fileWatchesOfAffectingLocations.get(
|
|
146838
|
-
if (watcher == null ? void 0 : watcher.resolutions) (affectingPathChecks ?? (affectingPathChecks = /* @__PURE__ */ new Set())).add(
|
|
146839
|
-
if (watcher == null ? void 0 : watcher.files) (affectingPathChecksForFile ?? (affectingPathChecksForFile = /* @__PURE__ */ new Set())).add(
|
|
146840
|
-
(_a3 = watcher == null ? void 0 : watcher.symlinks) == null ? void 0 : _a3.forEach((
|
|
146841
|
-
packageJsonMap == null ? void 0 : packageJsonMap.delete(resolutionHost.toPath(
|
|
146837
|
+
const watcher = fileWatchesOfAffectingLocations.get(path22);
|
|
146838
|
+
if (watcher == null ? void 0 : watcher.resolutions) (affectingPathChecks ?? (affectingPathChecks = /* @__PURE__ */ new Set())).add(path22);
|
|
146839
|
+
if (watcher == null ? void 0 : watcher.files) (affectingPathChecksForFile ?? (affectingPathChecksForFile = /* @__PURE__ */ new Set())).add(path22);
|
|
146840
|
+
(_a3 = watcher == null ? void 0 : watcher.symlinks) == null ? void 0 : _a3.forEach((path23) => invalidateAffectingFileWatcher(path23, packageJsonMap));
|
|
146841
|
+
packageJsonMap == null ? void 0 : packageJsonMap.delete(resolutionHost.toPath(path22));
|
|
146842
146842
|
}
|
|
146843
146843
|
function watchFailedLookupLocationOfNonRelativeModuleResolutions() {
|
|
146844
146844
|
nonRelativeExternalModuleResolutions.forEach(watchFailedLookupLocationOfResolution);
|
|
@@ -147080,7 +147080,7 @@ ${lanes.join("\n")}
|
|
|
147080
147080
|
function invalidatePackageJsonMap() {
|
|
147081
147081
|
const packageJsonMap = moduleResolutionCache.getPackageJsonInfoCache().getInternalMap();
|
|
147082
147082
|
if (packageJsonMap && (failedLookupChecks || startsWithPathChecks || isInDirectoryChecks)) {
|
|
147083
|
-
packageJsonMap.forEach((_value,
|
|
147083
|
+
packageJsonMap.forEach((_value, path22) => isInvalidatedFailedLookup(path22) ? packageJsonMap.delete(path22) : void 0);
|
|
147084
147084
|
}
|
|
147085
147085
|
}
|
|
147086
147086
|
function invalidateResolutionsOfFailedLookupLocations() {
|
|
@@ -147703,9 +147703,9 @@ ${lanes.join("\n")}
|
|
|
147703
147703
|
getDefaultLibLocation: maybeBind(host, host.getDefaultLibLocation),
|
|
147704
147704
|
getDefaultLibFileName: (options) => host.getDefaultLibFileName(options),
|
|
147705
147705
|
writeFile: createWriteFileMeasuringIO(
|
|
147706
|
-
(
|
|
147707
|
-
(
|
|
147708
|
-
(
|
|
147706
|
+
(path22, data, writeByteOrderMark) => host.writeFile(path22, data, writeByteOrderMark),
|
|
147707
|
+
(path22) => host.createDirectory(path22),
|
|
147708
|
+
(path22) => host.directoryExists(path22)
|
|
147709
147709
|
),
|
|
147710
147710
|
getCurrentDirectory: memoize(() => host.getCurrentDirectory()),
|
|
147711
147711
|
useCaseSensitiveFileNames: () => useCaseSensitiveFileNames2,
|
|
@@ -147776,16 +147776,16 @@ ${lanes.join("\n")}
|
|
|
147776
147776
|
getCurrentDirectory: memoize(() => system.getCurrentDirectory()),
|
|
147777
147777
|
getDefaultLibLocation,
|
|
147778
147778
|
getDefaultLibFileName: (options) => combinePaths(getDefaultLibLocation(), getDefaultLibFileName(options)),
|
|
147779
|
-
fileExists: (
|
|
147780
|
-
readFile: (
|
|
147781
|
-
directoryExists: (
|
|
147782
|
-
getDirectories: (
|
|
147783
|
-
readDirectory: (
|
|
147779
|
+
fileExists: (path22) => system.fileExists(path22),
|
|
147780
|
+
readFile: (path22, encoding) => system.readFile(path22, encoding),
|
|
147781
|
+
directoryExists: (path22) => system.directoryExists(path22),
|
|
147782
|
+
getDirectories: (path22) => system.getDirectories(path22),
|
|
147783
|
+
readDirectory: (path22, extensions, exclude, include, depth) => system.readDirectory(path22, extensions, exclude, include, depth),
|
|
147784
147784
|
realpath: maybeBind(system, system.realpath),
|
|
147785
147785
|
getEnvironmentVariable: maybeBind(system, system.getEnvironmentVariable),
|
|
147786
147786
|
trace: (s) => system.write(s + system.newLine),
|
|
147787
|
-
createDirectory: (
|
|
147788
|
-
writeFile: (
|
|
147787
|
+
createDirectory: (path22) => system.createDirectory(path22),
|
|
147788
|
+
writeFile: (path22, data, writeByteOrderMark) => system.writeFile(path22, data, writeByteOrderMark),
|
|
147789
147789
|
createHash: maybeBind(system, system.createHash),
|
|
147790
147790
|
createProgram: createProgram2 || createEmitAndSemanticDiagnosticsBuilderProgram,
|
|
147791
147791
|
storeSignatureInfo: system.storeSignatureInfo,
|
|
@@ -148098,7 +148098,7 @@ ${lanes.join("\n")}
|
|
|
148098
148098
|
originalWriteFile,
|
|
148099
148099
|
readFileWithCache
|
|
148100
148100
|
} = changeCompilerHostLikeToUseCache(compilerHost, toPath3);
|
|
148101
|
-
if (isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, (
|
|
148101
|
+
if (isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, (path22) => getSourceVersion(path22, readFileWithCache), (fileName) => compilerHost.fileExists(fileName), hasInvalidatedResolutions, hasInvalidatedLibResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
|
|
148102
148102
|
if (hasChangedConfigFileParsingErrors) {
|
|
148103
148103
|
if (reportFileChangeDetectedOnCreateProgram) {
|
|
148104
148104
|
reportWatchDiagnostic(Diagnostics.File_change_detected_Starting_incremental_compilation);
|
|
@@ -148192,14 +148192,14 @@ ${lanes.join("\n")}
|
|
|
148192
148192
|
return typeof hostSourceFile.version === "boolean";
|
|
148193
148193
|
}
|
|
148194
148194
|
function fileExists(fileName) {
|
|
148195
|
-
const
|
|
148196
|
-
if (isFileMissingOnHost(sourceFilesCache.get(
|
|
148195
|
+
const path22 = toPath3(fileName);
|
|
148196
|
+
if (isFileMissingOnHost(sourceFilesCache.get(path22))) {
|
|
148197
148197
|
return false;
|
|
148198
148198
|
}
|
|
148199
148199
|
return directoryStructureHost.fileExists(fileName);
|
|
148200
148200
|
}
|
|
148201
|
-
function getVersionedSourceFileByPath(fileName,
|
|
148202
|
-
const hostSourceFile = sourceFilesCache.get(
|
|
148201
|
+
function getVersionedSourceFileByPath(fileName, path22, languageVersionOrOptions, onError, shouldCreateNewSourceFile) {
|
|
148202
|
+
const hostSourceFile = sourceFilesCache.get(path22);
|
|
148203
148203
|
if (isFileMissingOnHost(hostSourceFile)) {
|
|
148204
148204
|
return void 0;
|
|
148205
148205
|
}
|
|
@@ -148211,41 +148211,41 @@ ${lanes.join("\n")}
|
|
|
148211
148211
|
hostSourceFile.sourceFile = sourceFile;
|
|
148212
148212
|
hostSourceFile.version = sourceFile.version;
|
|
148213
148213
|
if (!hostSourceFile.fileWatcher) {
|
|
148214
|
-
hostSourceFile.fileWatcher = watchFilePath(
|
|
148214
|
+
hostSourceFile.fileWatcher = watchFilePath(path22, fileName, onSourceFileChange, 250, watchOptions, WatchType.SourceFile);
|
|
148215
148215
|
}
|
|
148216
148216
|
} else {
|
|
148217
148217
|
if (hostSourceFile.fileWatcher) {
|
|
148218
148218
|
hostSourceFile.fileWatcher.close();
|
|
148219
148219
|
}
|
|
148220
|
-
sourceFilesCache.set(
|
|
148220
|
+
sourceFilesCache.set(path22, false);
|
|
148221
148221
|
}
|
|
148222
148222
|
} else {
|
|
148223
148223
|
if (sourceFile) {
|
|
148224
|
-
const fileWatcher = watchFilePath(
|
|
148225
|
-
sourceFilesCache.set(
|
|
148224
|
+
const fileWatcher = watchFilePath(path22, fileName, onSourceFileChange, 250, watchOptions, WatchType.SourceFile);
|
|
148225
|
+
sourceFilesCache.set(path22, { sourceFile, version: sourceFile.version, fileWatcher });
|
|
148226
148226
|
} else {
|
|
148227
|
-
sourceFilesCache.set(
|
|
148227
|
+
sourceFilesCache.set(path22, false);
|
|
148228
148228
|
}
|
|
148229
148229
|
}
|
|
148230
148230
|
return sourceFile;
|
|
148231
148231
|
}
|
|
148232
148232
|
return hostSourceFile.sourceFile;
|
|
148233
148233
|
}
|
|
148234
|
-
function nextSourceFileVersion(
|
|
148235
|
-
const hostSourceFile = sourceFilesCache.get(
|
|
148234
|
+
function nextSourceFileVersion(path22) {
|
|
148235
|
+
const hostSourceFile = sourceFilesCache.get(path22);
|
|
148236
148236
|
if (hostSourceFile !== void 0) {
|
|
148237
148237
|
if (isFileMissingOnHost(hostSourceFile)) {
|
|
148238
|
-
sourceFilesCache.set(
|
|
148238
|
+
sourceFilesCache.set(path22, { version: false });
|
|
148239
148239
|
} else {
|
|
148240
148240
|
hostSourceFile.version = false;
|
|
148241
148241
|
}
|
|
148242
148242
|
}
|
|
148243
148243
|
}
|
|
148244
|
-
function getSourceVersion(
|
|
148245
|
-
const hostSourceFile = sourceFilesCache.get(
|
|
148244
|
+
function getSourceVersion(path22, readFileWithCache) {
|
|
148245
|
+
const hostSourceFile = sourceFilesCache.get(path22);
|
|
148246
148246
|
if (!hostSourceFile) return void 0;
|
|
148247
148247
|
if (hostSourceFile.version) return hostSourceFile.version;
|
|
148248
|
-
const text = readFileWithCache(
|
|
148248
|
+
const text = readFileWithCache(path22);
|
|
148249
148249
|
return text !== void 0 ? getSourceFileVersionAsHashFromText(compilerHost, text) : void 0;
|
|
148250
148250
|
}
|
|
148251
148251
|
function onReleaseOldSourceFile(oldSourceFile, _oldOptions, hasSourceFileByPath) {
|
|
@@ -148424,28 +148424,28 @@ ${lanes.join("\n")}
|
|
|
148424
148424
|
}
|
|
148425
148425
|
function onReleaseParsedCommandLine(fileName) {
|
|
148426
148426
|
var _a3;
|
|
148427
|
-
const
|
|
148428
|
-
const config2 = parsedConfigs == null ? void 0 : parsedConfigs.get(
|
|
148427
|
+
const path22 = toPath3(fileName);
|
|
148428
|
+
const config2 = parsedConfigs == null ? void 0 : parsedConfigs.get(path22);
|
|
148429
148429
|
if (!config2) return;
|
|
148430
|
-
parsedConfigs.delete(
|
|
148430
|
+
parsedConfigs.delete(path22);
|
|
148431
148431
|
if (config2.watchedDirectories) clearMap(config2.watchedDirectories, closeFileWatcherOf);
|
|
148432
148432
|
(_a3 = config2.watcher) == null ? void 0 : _a3.close();
|
|
148433
|
-
clearSharedExtendedConfigFileWatcher(
|
|
148433
|
+
clearSharedExtendedConfigFileWatcher(path22, sharedExtendedConfigFileWatchers);
|
|
148434
148434
|
}
|
|
148435
|
-
function watchFilePath(
|
|
148436
|
-
return watchFile2(file2, (fileName, eventKind) => callback(fileName, eventKind,
|
|
148435
|
+
function watchFilePath(path22, file2, callback, pollingInterval, options, watchType) {
|
|
148436
|
+
return watchFile2(file2, (fileName, eventKind) => callback(fileName, eventKind, path22), pollingInterval, options, watchType);
|
|
148437
148437
|
}
|
|
148438
|
-
function onSourceFileChange(fileName, eventKind,
|
|
148439
|
-
updateCachedSystemWithFile(fileName,
|
|
148440
|
-
if (eventKind === 2 && sourceFilesCache.has(
|
|
148441
|
-
resolutionCache.invalidateResolutionOfFile(
|
|
148438
|
+
function onSourceFileChange(fileName, eventKind, path22) {
|
|
148439
|
+
updateCachedSystemWithFile(fileName, path22, eventKind);
|
|
148440
|
+
if (eventKind === 2 && sourceFilesCache.has(path22)) {
|
|
148441
|
+
resolutionCache.invalidateResolutionOfFile(path22);
|
|
148442
148442
|
}
|
|
148443
|
-
nextSourceFileVersion(
|
|
148443
|
+
nextSourceFileVersion(path22);
|
|
148444
148444
|
scheduleProgramUpdate();
|
|
148445
148445
|
}
|
|
148446
|
-
function updateCachedSystemWithFile(fileName,
|
|
148446
|
+
function updateCachedSystemWithFile(fileName, path22, eventKind) {
|
|
148447
148447
|
if (cachedDirectoryStructureHost) {
|
|
148448
|
-
cachedDirectoryStructureHost.addOrDeleteFile(fileName,
|
|
148448
|
+
cachedDirectoryStructureHost.addOrDeleteFile(fileName, path22, eventKind);
|
|
148449
148449
|
}
|
|
148450
148450
|
}
|
|
148451
148451
|
function watchMissingFilePath(missingFilePath, missingFileName) {
|
|
@@ -148666,9 +148666,9 @@ ${lanes.join("\n")}
|
|
|
148666
148666
|
}
|
|
148667
148667
|
function createSolutionBuilderHostBase(system, createProgram2, reportDiagnostic, reportSolutionBuilderStatus) {
|
|
148668
148668
|
const host = createProgramHost(system, createProgram2);
|
|
148669
|
-
host.getModifiedTime = system.getModifiedTime ? (
|
|
148670
|
-
host.setModifiedTime = system.setModifiedTime ? (
|
|
148671
|
-
host.deleteFile = system.deleteFile ? (
|
|
148669
|
+
host.getModifiedTime = system.getModifiedTime ? (path22) => system.getModifiedTime(path22) : returnUndefined;
|
|
148670
|
+
host.setModifiedTime = system.setModifiedTime ? (path22, date5) => system.setModifiedTime(path22, date5) : noop;
|
|
148671
|
+
host.deleteFile = system.deleteFile ? (path22) => system.deleteFile(path22) : noop;
|
|
148672
148672
|
host.reportDiagnostic = reportDiagnostic || createDiagnosticReporter(system);
|
|
148673
148673
|
host.reportSolutionBuilderStatus = reportSolutionBuilderStatus || createBuilderStatusReporter(system);
|
|
148674
148674
|
host.now = maybeBind(system, system.now);
|
|
@@ -148839,8 +148839,8 @@ ${lanes.join("\n")}
|
|
|
148839
148839
|
}
|
|
148840
148840
|
function toResolvedConfigFilePath(state, fileName) {
|
|
148841
148841
|
const { resolvedConfigFilePaths } = state;
|
|
148842
|
-
const
|
|
148843
|
-
if (
|
|
148842
|
+
const path22 = resolvedConfigFilePaths.get(fileName);
|
|
148843
|
+
if (path22 !== void 0) return path22;
|
|
148844
148844
|
const resolvedPath = toPath2(state, fileName);
|
|
148845
148845
|
resolvedConfigFilePaths.set(fileName, resolvedPath);
|
|
148846
148846
|
return resolvedPath;
|
|
@@ -149228,7 +149228,7 @@ ${lanes.join("\n")}
|
|
|
149228
149228
|
void 0,
|
|
149229
149229
|
(name, text, writeByteOrderMark, onError, sourceFiles, data) => {
|
|
149230
149230
|
var _a22;
|
|
149231
|
-
const
|
|
149231
|
+
const path22 = toPath2(state, name);
|
|
149232
149232
|
emittedOutputs.set(toPath2(state, name), name);
|
|
149233
149233
|
if (data == null ? void 0 : data.buildInfo) {
|
|
149234
149234
|
now || (now = getCurrentTime(state.host));
|
|
@@ -149258,7 +149258,7 @@ ${lanes.join("\n")}
|
|
|
149258
149258
|
);
|
|
149259
149259
|
if (data == null ? void 0 : data.differsOnlyInMap) state.host.setModifiedTime(name, modifiedTime);
|
|
149260
149260
|
else if (!isIncremental && state.watch) {
|
|
149261
|
-
(outputTimeStampMap || (outputTimeStampMap = getOutputTimeStampMap(state, projectPath))).set(
|
|
149261
|
+
(outputTimeStampMap || (outputTimeStampMap = getOutputTimeStampMap(state, projectPath))).set(path22, now || (now = getCurrentTime(state.host)));
|
|
149262
149262
|
}
|
|
149263
149263
|
},
|
|
149264
149264
|
cancellationToken,
|
|
@@ -149442,8 +149442,8 @@ ${lanes.join("\n")}
|
|
|
149442
149442
|
return !!value.watcher;
|
|
149443
149443
|
}
|
|
149444
149444
|
function getModifiedTime2(state, fileName) {
|
|
149445
|
-
const
|
|
149446
|
-
const existing = state.filesWatched.get(
|
|
149445
|
+
const path22 = toPath2(state, fileName);
|
|
149446
|
+
const existing = state.filesWatched.get(path22);
|
|
149447
149447
|
if (state.watch && !!existing) {
|
|
149448
149448
|
if (!isFileWatcherWithModifiedTime(existing)) return existing;
|
|
149449
149449
|
if (existing.modifiedTime) return existing.modifiedTime;
|
|
@@ -149451,20 +149451,20 @@ ${lanes.join("\n")}
|
|
|
149451
149451
|
const result = getModifiedTime(state.host, fileName);
|
|
149452
149452
|
if (state.watch) {
|
|
149453
149453
|
if (existing) existing.modifiedTime = result;
|
|
149454
|
-
else state.filesWatched.set(
|
|
149454
|
+
else state.filesWatched.set(path22, result);
|
|
149455
149455
|
}
|
|
149456
149456
|
return result;
|
|
149457
149457
|
}
|
|
149458
149458
|
function watchFile(state, file2, callback, pollingInterval, options, watchType, project) {
|
|
149459
|
-
const
|
|
149460
|
-
const existing = state.filesWatched.get(
|
|
149459
|
+
const path22 = toPath2(state, file2);
|
|
149460
|
+
const existing = state.filesWatched.get(path22);
|
|
149461
149461
|
if (existing && isFileWatcherWithModifiedTime(existing)) {
|
|
149462
149462
|
existing.callbacks.push(callback);
|
|
149463
149463
|
} else {
|
|
149464
149464
|
const watcher = state.watchFile(
|
|
149465
149465
|
file2,
|
|
149466
149466
|
(fileName, eventKind, modifiedTime) => {
|
|
149467
|
-
const existing2 = Debug.checkDefined(state.filesWatched.get(
|
|
149467
|
+
const existing2 = Debug.checkDefined(state.filesWatched.get(path22));
|
|
149468
149468
|
Debug.assert(isFileWatcherWithModifiedTime(existing2));
|
|
149469
149469
|
existing2.modifiedTime = modifiedTime;
|
|
149470
149470
|
existing2.callbacks.forEach((cb) => cb(fileName, eventKind, modifiedTime));
|
|
@@ -149474,14 +149474,14 @@ ${lanes.join("\n")}
|
|
|
149474
149474
|
watchType,
|
|
149475
149475
|
project
|
|
149476
149476
|
);
|
|
149477
|
-
state.filesWatched.set(
|
|
149477
|
+
state.filesWatched.set(path22, { callbacks: [callback], watcher, modifiedTime: existing });
|
|
149478
149478
|
}
|
|
149479
149479
|
return {
|
|
149480
149480
|
close: () => {
|
|
149481
|
-
const existing2 = Debug.checkDefined(state.filesWatched.get(
|
|
149481
|
+
const existing2 = Debug.checkDefined(state.filesWatched.get(path22));
|
|
149482
149482
|
Debug.assert(isFileWatcherWithModifiedTime(existing2));
|
|
149483
149483
|
if (existing2.callbacks.length === 1) {
|
|
149484
|
-
state.filesWatched.delete(
|
|
149484
|
+
state.filesWatched.delete(path22);
|
|
149485
149485
|
closeFileWatcherOf(existing2);
|
|
149486
149486
|
} else {
|
|
149487
149487
|
unorderedRemoveItem(existing2.callbacks, callback);
|
|
@@ -149496,19 +149496,19 @@ ${lanes.join("\n")}
|
|
|
149496
149496
|
return result;
|
|
149497
149497
|
}
|
|
149498
149498
|
function getBuildInfoCacheEntry(state, buildInfoPath, resolvedConfigPath) {
|
|
149499
|
-
const
|
|
149499
|
+
const path22 = toPath2(state, buildInfoPath);
|
|
149500
149500
|
const existing = state.buildInfoCache.get(resolvedConfigPath);
|
|
149501
|
-
return (existing == null ? void 0 : existing.path) ===
|
|
149501
|
+
return (existing == null ? void 0 : existing.path) === path22 ? existing : void 0;
|
|
149502
149502
|
}
|
|
149503
149503
|
function getBuildInfo3(state, buildInfoPath, resolvedConfigPath, modifiedTime) {
|
|
149504
|
-
const
|
|
149504
|
+
const path22 = toPath2(state, buildInfoPath);
|
|
149505
149505
|
const existing = state.buildInfoCache.get(resolvedConfigPath);
|
|
149506
|
-
if (existing !== void 0 && existing.path ===
|
|
149506
|
+
if (existing !== void 0 && existing.path === path22) {
|
|
149507
149507
|
return existing.buildInfo || void 0;
|
|
149508
149508
|
}
|
|
149509
149509
|
const value = state.readFileWithCache(buildInfoPath);
|
|
149510
149510
|
const buildInfo = value ? getBuildInfo(buildInfoPath, value) : void 0;
|
|
149511
|
-
state.buildInfoCache.set(resolvedConfigPath, { path:
|
|
149511
|
+
state.buildInfoCache.set(resolvedConfigPath, { path: path22, buildInfo: buildInfo || false, modifiedTime: modifiedTime || missingFileModifiedTime });
|
|
149512
149512
|
return buildInfo;
|
|
149513
149513
|
}
|
|
149514
149514
|
function checkConfigFileUpToDateStatus(state, configFile, oldestOutputFileTime, oldestOutputFileName) {
|
|
@@ -149689,11 +149689,11 @@ ${lanes.join("\n")}
|
|
|
149689
149689
|
const outputTimeStampMap = getOutputTimeStampMap(state, resolvedPath);
|
|
149690
149690
|
for (const output of outputs) {
|
|
149691
149691
|
if (output === buildInfoPath) continue;
|
|
149692
|
-
const
|
|
149693
|
-
let outputTime = outputTimeStampMap == null ? void 0 : outputTimeStampMap.get(
|
|
149692
|
+
const path22 = toPath2(state, output);
|
|
149693
|
+
let outputTime = outputTimeStampMap == null ? void 0 : outputTimeStampMap.get(path22);
|
|
149694
149694
|
if (!outputTime) {
|
|
149695
149695
|
outputTime = getModifiedTime(state.host, output);
|
|
149696
|
-
outputTimeStampMap == null ? void 0 : outputTimeStampMap.set(
|
|
149696
|
+
outputTimeStampMap == null ? void 0 : outputTimeStampMap.set(path22, outputTime);
|
|
149697
149697
|
}
|
|
149698
149698
|
if (outputTime === missingFileModifiedTime) {
|
|
149699
149699
|
return {
|
|
@@ -149747,7 +149747,7 @@ ${lanes.join("\n")}
|
|
|
149747
149747
|
const packageJsonLookups = state.lastCachedPackageJsonLookups.get(resolvedPath);
|
|
149748
149748
|
const dependentPackageFileStatus = packageJsonLookups && forEachKey(
|
|
149749
149749
|
packageJsonLookups,
|
|
149750
|
-
(
|
|
149750
|
+
(path22) => checkConfigFileUpToDateStatus(state, path22, oldestOutputFileTime, oldestOutputFileName)
|
|
149751
149751
|
);
|
|
149752
149752
|
if (dependentPackageFileStatus) return dependentPackageFileStatus;
|
|
149753
149753
|
return {
|
|
@@ -149797,8 +149797,8 @@ ${lanes.join("\n")}
|
|
|
149797
149797
|
if (!skipOutputs || outputs.length !== skipOutputs.size) {
|
|
149798
149798
|
let reportVerbose = !!state.options.verbose;
|
|
149799
149799
|
for (const file2 of outputs) {
|
|
149800
|
-
const
|
|
149801
|
-
if (skipOutputs == null ? void 0 : skipOutputs.has(
|
|
149800
|
+
const path22 = toPath2(state, file2);
|
|
149801
|
+
if (skipOutputs == null ? void 0 : skipOutputs.has(path22)) continue;
|
|
149802
149802
|
if (reportVerbose) {
|
|
149803
149803
|
reportVerbose = false;
|
|
149804
149804
|
reportStatus(state, verboseMessage, proj.options.configFilePath);
|
|
@@ -149806,8 +149806,8 @@ ${lanes.join("\n")}
|
|
|
149806
149806
|
host.setModifiedTime(file2, now || (now = getCurrentTime(state.host)));
|
|
149807
149807
|
if (file2 === buildInfoPath) getBuildInfoCacheEntry(state, buildInfoPath, projectPath).modifiedTime = now;
|
|
149808
149808
|
else if (outputTimeStampMap) {
|
|
149809
|
-
outputTimeStampMap.set(
|
|
149810
|
-
modifiedOutputs.add(
|
|
149809
|
+
outputTimeStampMap.set(path22, now);
|
|
149810
|
+
modifiedOutputs.add(path22);
|
|
149811
149811
|
}
|
|
149812
149812
|
}
|
|
149813
149813
|
}
|
|
@@ -150235,8 +150235,8 @@ ${lanes.join("\n")}
|
|
|
150235
150235
|
close: () => stopWatching(state)
|
|
150236
150236
|
};
|
|
150237
150237
|
}
|
|
150238
|
-
function relName(state,
|
|
150239
|
-
return convertToRelativePath(
|
|
150238
|
+
function relName(state, path22) {
|
|
150239
|
+
return convertToRelativePath(path22, state.compilerHost.getCurrentDirectory(), state.compilerHost.getCanonicalFileName);
|
|
150240
150240
|
}
|
|
150241
150241
|
function reportStatus(state, message, ...args) {
|
|
150242
150242
|
state.host.reportSolutionBuilderStatus(createCompilerDiagnostic(message, ...args));
|
|
@@ -150455,13 +150455,13 @@ ${lanes.join("\n")}
|
|
|
150455
150455
|
} else if (file2.isDeclarationFile) {
|
|
150456
150456
|
return "Definitions";
|
|
150457
150457
|
}
|
|
150458
|
-
const
|
|
150459
|
-
if (fileExtensionIsOneOf(
|
|
150458
|
+
const path22 = file2.path;
|
|
150459
|
+
if (fileExtensionIsOneOf(path22, supportedTSExtensionsFlat)) {
|
|
150460
150460
|
return "TypeScript";
|
|
150461
|
-
} else if (fileExtensionIsOneOf(
|
|
150461
|
+
} else if (fileExtensionIsOneOf(path22, supportedJSExtensionsFlat)) {
|
|
150462
150462
|
return "JavaScript";
|
|
150463
150463
|
} else if (fileExtensionIs(
|
|
150464
|
-
|
|
150464
|
+
path22,
|
|
150465
150465
|
".json"
|
|
150466
150466
|
/* Json */
|
|
150467
150467
|
)) {
|
|
@@ -151088,7 +151088,7 @@ ${lanes.join("\n")}
|
|
|
151088
151088
|
);
|
|
151089
151089
|
}
|
|
151090
151090
|
}
|
|
151091
|
-
const commandLine = parseCommandLine(commandLineArgs, (
|
|
151091
|
+
const commandLine = parseCommandLine(commandLineArgs, (path22) => system.readFile(path22));
|
|
151092
151092
|
if (commandLine.options.generateCpuProfile && system.enableCPUProfiler) {
|
|
151093
151093
|
system.enableCPUProfiler(commandLine.options.generateCpuProfile, () => executeCommandLineWorker(
|
|
151094
151094
|
system,
|
|
@@ -152964,12 +152964,12 @@ ${lanes.join("\n")}
|
|
|
152964
152964
|
return nodeCoreModules.has(moduleName) ? "node" : moduleName;
|
|
152965
152965
|
}
|
|
152966
152966
|
function loadSafeList(host, safeListPath) {
|
|
152967
|
-
const result = readConfigFile(safeListPath, (
|
|
152967
|
+
const result = readConfigFile(safeListPath, (path22) => host.readFile(path22));
|
|
152968
152968
|
return new Map(Object.entries(result.config));
|
|
152969
152969
|
}
|
|
152970
152970
|
function loadTypesMap(host, typesMapPath) {
|
|
152971
152971
|
var _a3;
|
|
152972
|
-
const result = readConfigFile(typesMapPath, (
|
|
152972
|
+
const result = readConfigFile(typesMapPath, (path22) => host.readFile(path22));
|
|
152973
152973
|
if ((_a3 = result.config) == null ? void 0 : _a3.simpleMap) {
|
|
152974
152974
|
return new Map(Object.entries(result.config.simpleMap));
|
|
152975
152975
|
}
|
|
@@ -152981,9 +152981,9 @@ ${lanes.join("\n")}
|
|
|
152981
152981
|
}
|
|
152982
152982
|
const inferredTypings = /* @__PURE__ */ new Map();
|
|
152983
152983
|
fileNames = mapDefined(fileNames, (fileName) => {
|
|
152984
|
-
const
|
|
152985
|
-
if (hasJSFileExtension(
|
|
152986
|
-
return
|
|
152984
|
+
const path22 = normalizePath(fileName);
|
|
152985
|
+
if (hasJSFileExtension(path22)) {
|
|
152986
|
+
return path22;
|
|
152987
152987
|
}
|
|
152988
152988
|
});
|
|
152989
152989
|
const filesToWatch = [];
|
|
@@ -153045,7 +153045,7 @@ ${lanes.join("\n")}
|
|
|
153045
153045
|
let manifestTypingNames;
|
|
153046
153046
|
if (host.fileExists(manifestPath)) {
|
|
153047
153047
|
filesToWatch2.push(manifestPath);
|
|
153048
|
-
manifest = readConfigFile(manifestPath, (
|
|
153048
|
+
manifest = readConfigFile(manifestPath, (path22) => host.readFile(path22)).config;
|
|
153049
153049
|
manifestTypingNames = flatMap([manifest.dependencies, manifest.devDependencies, manifest.optionalDependencies, manifest.peerDependencies], getOwnKeys);
|
|
153050
153050
|
addInferredTypings(manifestTypingNames, `Typing names in '${manifestPath}' dependencies`);
|
|
153051
153051
|
}
|
|
@@ -153079,7 +153079,7 @@ ${lanes.join("\n")}
|
|
|
153079
153079
|
if (log) log(`Searching for typing names in ${packagesFolderPath}; all files: ${JSON.stringify(dependencyManifestNames)}`);
|
|
153080
153080
|
for (const manifestPath2 of dependencyManifestNames) {
|
|
153081
153081
|
const normalizedFileName = normalizePath(manifestPath2);
|
|
153082
|
-
const result2 = readConfigFile(normalizedFileName, (
|
|
153082
|
+
const result2 = readConfigFile(normalizedFileName, (path22) => host.readFile(path22));
|
|
153083
153083
|
const manifest2 = result2.config;
|
|
153084
153084
|
if (!manifest2.name) {
|
|
153085
153085
|
continue;
|
|
@@ -155863,14 +155863,14 @@ ${lanes.join("\n")}
|
|
|
155863
155863
|
function tryGetDirectories(host, directoryName) {
|
|
155864
155864
|
return tryIOAndConsumeErrors(host, host.getDirectories, directoryName) || [];
|
|
155865
155865
|
}
|
|
155866
|
-
function tryReadDirectory(host,
|
|
155867
|
-
return tryIOAndConsumeErrors(host, host.readDirectory,
|
|
155866
|
+
function tryReadDirectory(host, path22, extensions, exclude, include) {
|
|
155867
|
+
return tryIOAndConsumeErrors(host, host.readDirectory, path22, extensions, exclude, include) || emptyArray;
|
|
155868
155868
|
}
|
|
155869
|
-
function tryFileExists(host,
|
|
155870
|
-
return tryIOAndConsumeErrors(host, host.fileExists,
|
|
155869
|
+
function tryFileExists(host, path22) {
|
|
155870
|
+
return tryIOAndConsumeErrors(host, host.fileExists, path22);
|
|
155871
155871
|
}
|
|
155872
|
-
function tryDirectoryExists(host,
|
|
155873
|
-
return tryAndIgnoreErrors(() => directoryProbablyExists(
|
|
155872
|
+
function tryDirectoryExists(host, path22) {
|
|
155873
|
+
return tryAndIgnoreErrors(() => directoryProbablyExists(path22, host)) || false;
|
|
155874
155874
|
}
|
|
155875
155875
|
function tryAndIgnoreErrors(cb) {
|
|
155876
155876
|
try {
|
|
@@ -156712,13 +156712,13 @@ ${lanes.join("\n")}
|
|
|
156712
156712
|
function getIsExcluded(excludePatterns, host) {
|
|
156713
156713
|
var _a3;
|
|
156714
156714
|
const realpathsWithSymlinks = (_a3 = host.getSymlinkCache) == null ? void 0 : _a3.call(host).getSymlinkedDirectoriesByRealpath();
|
|
156715
|
-
return (({ fileName, path:
|
|
156715
|
+
return (({ fileName, path: path22 }) => {
|
|
156716
156716
|
if (excludePatterns.some((p) => p.test(fileName))) return true;
|
|
156717
156717
|
if ((realpathsWithSymlinks == null ? void 0 : realpathsWithSymlinks.size) && pathContainsNodeModules(fileName)) {
|
|
156718
156718
|
let dir = getDirectoryPath(fileName);
|
|
156719
156719
|
return forEachAncestorDirectoryStoppingAtGlobalCache(
|
|
156720
156720
|
host,
|
|
156721
|
-
getDirectoryPath(
|
|
156721
|
+
getDirectoryPath(path22),
|
|
156722
156722
|
(dirPath) => {
|
|
156723
156723
|
const symlinks = realpathsWithSymlinks.get(ensureTrailingDirectorySeparator(dirPath));
|
|
156724
156724
|
if (symlinks) {
|
|
@@ -158374,14 +158374,14 @@ ${lanes.join("\n")}
|
|
|
158374
158374
|
return settingsOrHost;
|
|
158375
158375
|
}
|
|
158376
158376
|
function acquireDocument(fileName, compilationSettings, scriptSnapshot, version22, scriptKind, languageVersionOrOptions) {
|
|
158377
|
-
const
|
|
158377
|
+
const path22 = toPath(fileName, currentDirectory, getCanonicalFileName);
|
|
158378
158378
|
const key = getKeyForCompilationSettings(getCompilationSettings(compilationSettings));
|
|
158379
|
-
return acquireDocumentWithKey(fileName,
|
|
158379
|
+
return acquireDocumentWithKey(fileName, path22, compilationSettings, key, scriptSnapshot, version22, scriptKind, languageVersionOrOptions);
|
|
158380
158380
|
}
|
|
158381
|
-
function acquireDocumentWithKey(fileName,
|
|
158381
|
+
function acquireDocumentWithKey(fileName, path22, compilationSettings, key, scriptSnapshot, version22, scriptKind, languageVersionOrOptions) {
|
|
158382
158382
|
return acquireOrUpdateDocument(
|
|
158383
158383
|
fileName,
|
|
158384
|
-
|
|
158384
|
+
path22,
|
|
158385
158385
|
compilationSettings,
|
|
158386
158386
|
key,
|
|
158387
158387
|
scriptSnapshot,
|
|
@@ -158393,14 +158393,14 @@ ${lanes.join("\n")}
|
|
|
158393
158393
|
);
|
|
158394
158394
|
}
|
|
158395
158395
|
function updateDocument(fileName, compilationSettings, scriptSnapshot, version22, scriptKind, languageVersionOrOptions) {
|
|
158396
|
-
const
|
|
158396
|
+
const path22 = toPath(fileName, currentDirectory, getCanonicalFileName);
|
|
158397
158397
|
const key = getKeyForCompilationSettings(getCompilationSettings(compilationSettings));
|
|
158398
|
-
return updateDocumentWithKey(fileName,
|
|
158398
|
+
return updateDocumentWithKey(fileName, path22, compilationSettings, key, scriptSnapshot, version22, scriptKind, languageVersionOrOptions);
|
|
158399
158399
|
}
|
|
158400
|
-
function updateDocumentWithKey(fileName,
|
|
158400
|
+
function updateDocumentWithKey(fileName, path22, compilationSettings, key, scriptSnapshot, version22, scriptKind, languageVersionOrOptions) {
|
|
158401
158401
|
return acquireOrUpdateDocument(
|
|
158402
158402
|
fileName,
|
|
158403
|
-
|
|
158403
|
+
path22,
|
|
158404
158404
|
getCompilationSettings(compilationSettings),
|
|
158405
158405
|
key,
|
|
158406
158406
|
scriptSnapshot,
|
|
@@ -158416,7 +158416,7 @@ ${lanes.join("\n")}
|
|
|
158416
158416
|
Debug.assert(scriptKind === void 0 || !entry || entry.sourceFile.scriptKind === scriptKind, `Script kind should match provided ScriptKind:${scriptKind} and sourceFile.scriptKind: ${entry == null ? void 0 : entry.sourceFile.scriptKind}, !entry: ${!entry}`);
|
|
158417
158417
|
return entry;
|
|
158418
158418
|
}
|
|
158419
|
-
function acquireOrUpdateDocument(fileName,
|
|
158419
|
+
function acquireOrUpdateDocument(fileName, path22, compilationSettingsOrHost, key, scriptSnapshot, version22, acquiring, scriptKind, languageVersionOrOptions) {
|
|
158420
158420
|
var _a3, _b, _c, _d;
|
|
158421
158421
|
scriptKind = ensureScriptKind(fileName, scriptKind);
|
|
158422
158422
|
const compilationSettings = getCompilationSettings(compilationSettingsOrHost);
|
|
@@ -158424,7 +158424,7 @@ ${lanes.join("\n")}
|
|
|
158424
158424
|
const scriptTarget = scriptKind === 6 ? 100 : getEmitScriptTarget(compilationSettings);
|
|
158425
158425
|
const sourceFileOptions = typeof languageVersionOrOptions === "object" ? languageVersionOrOptions : {
|
|
158426
158426
|
languageVersion: scriptTarget,
|
|
158427
|
-
impliedNodeFormat: host && getImpliedNodeFormatForFile(
|
|
158427
|
+
impliedNodeFormat: host && getImpliedNodeFormatForFile(path22, (_d = (_c = (_b = (_a3 = host.getCompilerHost) == null ? void 0 : _a3.call(host)) == null ? void 0 : _b.getModuleResolutionCache) == null ? void 0 : _c.call(_b)) == null ? void 0 : _d.getPackageJsonInfoCache(), host, compilationSettings),
|
|
158428
158428
|
setExternalModuleIndicator: getSetExternalModuleIndicator(compilationSettings),
|
|
158429
158429
|
jsDocParsingMode
|
|
158430
158430
|
};
|
|
@@ -158437,15 +158437,15 @@ ${lanes.join("\n")}
|
|
|
158437
158437
|
if (buckets.size > oldBucketCount) {
|
|
158438
158438
|
tracing.instant(tracing.Phase.Session, "createdDocumentRegistryBucket", { configFilePath: compilationSettings.configFilePath, key: keyWithMode });
|
|
158439
158439
|
}
|
|
158440
|
-
const otherBucketKey = !isDeclarationFileName(
|
|
158440
|
+
const otherBucketKey = !isDeclarationFileName(path22) && forEachEntry(buckets, (bucket2, bucketKey) => bucketKey !== keyWithMode && bucket2.has(path22) && bucketKey);
|
|
158441
158441
|
if (otherBucketKey) {
|
|
158442
|
-
tracing.instant(tracing.Phase.Session, "documentRegistryBucketOverlap", { path:
|
|
158442
|
+
tracing.instant(tracing.Phase.Session, "documentRegistryBucketOverlap", { path: path22, key1: otherBucketKey, key2: keyWithMode });
|
|
158443
158443
|
}
|
|
158444
158444
|
}
|
|
158445
|
-
const bucketEntry = bucket.get(
|
|
158445
|
+
const bucketEntry = bucket.get(path22);
|
|
158446
158446
|
let entry = bucketEntry && getDocumentRegistryEntry(bucketEntry, scriptKind);
|
|
158447
158447
|
if (!entry && externalCache) {
|
|
158448
|
-
const sourceFile = externalCache.getDocument(keyWithMode,
|
|
158448
|
+
const sourceFile = externalCache.getDocument(keyWithMode, path22);
|
|
158449
158449
|
if (sourceFile && sourceFile.scriptKind === scriptKind && sourceFile.text === getSnapshotText(scriptSnapshot)) {
|
|
158450
158450
|
Debug.assert(acquiring);
|
|
158451
158451
|
entry = {
|
|
@@ -158466,7 +158466,7 @@ ${lanes.join("\n")}
|
|
|
158466
158466
|
scriptKind
|
|
158467
158467
|
);
|
|
158468
158468
|
if (externalCache) {
|
|
158469
|
-
externalCache.setDocument(keyWithMode,
|
|
158469
|
+
externalCache.setDocument(keyWithMode, path22, sourceFile);
|
|
158470
158470
|
}
|
|
158471
158471
|
entry = {
|
|
158472
158472
|
sourceFile,
|
|
@@ -158477,7 +158477,7 @@ ${lanes.join("\n")}
|
|
|
158477
158477
|
if (entry.sourceFile.version !== version22) {
|
|
158478
158478
|
entry.sourceFile = updateLanguageServiceSourceFile(entry.sourceFile, scriptSnapshot, version22, scriptSnapshot.getChangeRange(entry.sourceFile.scriptSnapshot));
|
|
158479
158479
|
if (externalCache) {
|
|
158480
|
-
externalCache.setDocument(keyWithMode,
|
|
158480
|
+
externalCache.setDocument(keyWithMode, path22, entry.sourceFile);
|
|
158481
158481
|
}
|
|
158482
158482
|
}
|
|
158483
158483
|
if (acquiring) {
|
|
@@ -158488,35 +158488,35 @@ ${lanes.join("\n")}
|
|
|
158488
158488
|
return entry.sourceFile;
|
|
158489
158489
|
function setBucketEntry() {
|
|
158490
158490
|
if (!bucketEntry) {
|
|
158491
|
-
bucket.set(
|
|
158491
|
+
bucket.set(path22, entry);
|
|
158492
158492
|
} else if (isDocumentRegistryEntry(bucketEntry)) {
|
|
158493
158493
|
const scriptKindMap = /* @__PURE__ */ new Map();
|
|
158494
158494
|
scriptKindMap.set(bucketEntry.sourceFile.scriptKind, bucketEntry);
|
|
158495
158495
|
scriptKindMap.set(scriptKind, entry);
|
|
158496
|
-
bucket.set(
|
|
158496
|
+
bucket.set(path22, scriptKindMap);
|
|
158497
158497
|
} else {
|
|
158498
158498
|
bucketEntry.set(scriptKind, entry);
|
|
158499
158499
|
}
|
|
158500
158500
|
}
|
|
158501
158501
|
}
|
|
158502
158502
|
function releaseDocument(fileName, compilationSettings, scriptKind, impliedNodeFormat) {
|
|
158503
|
-
const
|
|
158503
|
+
const path22 = toPath(fileName, currentDirectory, getCanonicalFileName);
|
|
158504
158504
|
const key = getKeyForCompilationSettings(compilationSettings);
|
|
158505
|
-
return releaseDocumentWithKey(
|
|
158505
|
+
return releaseDocumentWithKey(path22, key, scriptKind, impliedNodeFormat);
|
|
158506
158506
|
}
|
|
158507
|
-
function releaseDocumentWithKey(
|
|
158507
|
+
function releaseDocumentWithKey(path22, key, scriptKind, impliedNodeFormat) {
|
|
158508
158508
|
const bucket = Debug.checkDefined(buckets.get(getDocumentRegistryBucketKeyWithMode(key, impliedNodeFormat)));
|
|
158509
|
-
const bucketEntry = bucket.get(
|
|
158509
|
+
const bucketEntry = bucket.get(path22);
|
|
158510
158510
|
const entry = getDocumentRegistryEntry(bucketEntry, scriptKind);
|
|
158511
158511
|
entry.languageServiceRefCount--;
|
|
158512
158512
|
Debug.assert(entry.languageServiceRefCount >= 0);
|
|
158513
158513
|
if (entry.languageServiceRefCount === 0) {
|
|
158514
158514
|
if (isDocumentRegistryEntry(bucketEntry)) {
|
|
158515
|
-
bucket.delete(
|
|
158515
|
+
bucket.delete(path22);
|
|
158516
158516
|
} else {
|
|
158517
158517
|
bucketEntry.delete(scriptKind);
|
|
158518
158518
|
if (bucketEntry.size === 1) {
|
|
158519
|
-
bucket.set(
|
|
158519
|
+
bucket.set(path22, firstDefinedIterator(bucketEntry.values(), identity));
|
|
158520
158520
|
}
|
|
158521
158521
|
}
|
|
158522
158522
|
}
|
|
@@ -158552,10 +158552,10 @@ ${lanes.join("\n")}
|
|
|
158552
158552
|
}
|
|
158553
158553
|
function getPathUpdater(oldFileOrDirPath, newFileOrDirPath, getCanonicalFileName, sourceMapper) {
|
|
158554
158554
|
const canonicalOldPath = getCanonicalFileName(oldFileOrDirPath);
|
|
158555
|
-
return (
|
|
158556
|
-
const originalPath = sourceMapper && sourceMapper.tryGetSourcePosition({ fileName:
|
|
158557
|
-
const updatedPath = getUpdatedPath(originalPath ? originalPath.fileName :
|
|
158558
|
-
return originalPath ? updatedPath === void 0 ? void 0 : makeCorrespondingRelativeChange(originalPath.fileName, updatedPath,
|
|
158555
|
+
return (path22) => {
|
|
158556
|
+
const originalPath = sourceMapper && sourceMapper.tryGetSourcePosition({ fileName: path22, pos: 0 });
|
|
158557
|
+
const updatedPath = getUpdatedPath(originalPath ? originalPath.fileName : path22);
|
|
158558
|
+
return originalPath ? updatedPath === void 0 ? void 0 : makeCorrespondingRelativeChange(originalPath.fileName, updatedPath, path22, getCanonicalFileName) : updatedPath;
|
|
158559
158559
|
};
|
|
158560
158560
|
function getUpdatedPath(pathToUpdate) {
|
|
158561
158561
|
if (getCanonicalFileName(pathToUpdate) === canonicalOldPath) return newFileOrDirPath;
|
|
@@ -158631,10 +158631,10 @@ ${lanes.join("\n")}
|
|
|
158631
158631
|
}
|
|
158632
158632
|
return false;
|
|
158633
158633
|
}
|
|
158634
|
-
function relativePath(
|
|
158634
|
+
function relativePath(path22) {
|
|
158635
158635
|
return getRelativePathFromDirectory(
|
|
158636
158636
|
configDir,
|
|
158637
|
-
|
|
158637
|
+
path22,
|
|
158638
158638
|
/*ignoreCase*/
|
|
158639
158639
|
!useCaseSensitiveFileNames2
|
|
158640
158640
|
);
|
|
@@ -159441,8 +159441,8 @@ ${lanes.join("\n")}
|
|
|
159441
159441
|
return toPath(fileName, currentDirectory, getCanonicalFileName);
|
|
159442
159442
|
}
|
|
159443
159443
|
function getDocumentPositionMapper2(generatedFileName, sourceFileName) {
|
|
159444
|
-
const
|
|
159445
|
-
const value = documentPositionMappers.get(
|
|
159444
|
+
const path22 = toPath3(generatedFileName);
|
|
159445
|
+
const value = documentPositionMappers.get(path22);
|
|
159446
159446
|
if (value) return value;
|
|
159447
159447
|
let mapper;
|
|
159448
159448
|
if (host.getDocumentPositionMapper) {
|
|
@@ -159456,7 +159456,7 @@ ${lanes.join("\n")}
|
|
|
159456
159456
|
(f) => !host.fileExists || host.fileExists(f) ? host.readFile(f) : void 0
|
|
159457
159457
|
);
|
|
159458
159458
|
}
|
|
159459
|
-
documentPositionMappers.set(
|
|
159459
|
+
documentPositionMappers.set(path22, mapper || identitySourceMapConsumer);
|
|
159460
159460
|
return mapper || identitySourceMapConsumer;
|
|
159461
159461
|
}
|
|
159462
159462
|
function tryGetSourcePosition(info) {
|
|
@@ -159484,21 +159484,21 @@ ${lanes.join("\n")}
|
|
|
159484
159484
|
function getSourceFile(fileName) {
|
|
159485
159485
|
const program2 = host.getProgram();
|
|
159486
159486
|
if (!program2) return void 0;
|
|
159487
|
-
const
|
|
159488
|
-
const file2 = program2.getSourceFileByPath(
|
|
159489
|
-
return file2 && file2.resolvedPath ===
|
|
159487
|
+
const path22 = toPath3(fileName);
|
|
159488
|
+
const file2 = program2.getSourceFileByPath(path22);
|
|
159489
|
+
return file2 && file2.resolvedPath === path22 ? file2 : void 0;
|
|
159490
159490
|
}
|
|
159491
159491
|
function getOrCreateSourceFileLike(fileName) {
|
|
159492
|
-
const
|
|
159493
|
-
const fileFromCache = sourceFileLike.get(
|
|
159492
|
+
const path22 = toPath3(fileName);
|
|
159493
|
+
const fileFromCache = sourceFileLike.get(path22);
|
|
159494
159494
|
if (fileFromCache !== void 0) return fileFromCache ? fileFromCache : void 0;
|
|
159495
159495
|
if (!host.readFile || host.fileExists && !host.fileExists(fileName)) {
|
|
159496
|
-
sourceFileLike.set(
|
|
159496
|
+
sourceFileLike.set(path22, false);
|
|
159497
159497
|
return void 0;
|
|
159498
159498
|
}
|
|
159499
159499
|
const text = host.readFile(fileName);
|
|
159500
159500
|
const file2 = text ? createSourceFileLike(text) : false;
|
|
159501
|
-
sourceFileLike.set(
|
|
159501
|
+
sourceFileLike.set(path22, file2);
|
|
159502
159502
|
return file2 ? file2 : void 0;
|
|
159503
159503
|
}
|
|
159504
159504
|
function getSourceFileLike(fileName) {
|
|
@@ -167583,12 +167583,12 @@ ${newComment.split("\n").map((c2) => ` * ${c2}`).join("\n")}
|
|
|
167583
167583
|
directoryExists: (directoryName) => {
|
|
167584
167584
|
return directoryProbablyExists(directoryName, host);
|
|
167585
167585
|
},
|
|
167586
|
-
getDirectories: (
|
|
167587
|
-
return host.getDirectories ? host.getDirectories(
|
|
167586
|
+
getDirectories: (path22) => {
|
|
167587
|
+
return host.getDirectories ? host.getDirectories(path22) : [];
|
|
167588
167588
|
},
|
|
167589
|
-
readDirectory: (
|
|
167589
|
+
readDirectory: (path22, extensions, exclude, include, depth) => {
|
|
167590
167590
|
Debug.checkDefined(host.readDirectory, "'LanguageServiceHost.readDirectory' must be implemented to correctly process 'projectReferences'");
|
|
167591
|
-
return host.readDirectory(
|
|
167591
|
+
return host.readDirectory(path22, extensions, exclude, include, depth);
|
|
167592
167592
|
},
|
|
167593
167593
|
onReleaseOldSourceFile,
|
|
167594
167594
|
onReleaseParsedCommandLine,
|
|
@@ -167651,11 +167651,11 @@ ${newComment.split("\n").map((c2) => ` * ${c2}`).join("\n")}
|
|
|
167651
167651
|
program2.getTypeChecker();
|
|
167652
167652
|
return;
|
|
167653
167653
|
function getParsedCommandLine(fileName) {
|
|
167654
|
-
const
|
|
167655
|
-
const existing = parsedCommandLines == null ? void 0 : parsedCommandLines.get(
|
|
167654
|
+
const path22 = toPath(fileName, currentDirectory, getCanonicalFileName);
|
|
167655
|
+
const existing = parsedCommandLines == null ? void 0 : parsedCommandLines.get(path22);
|
|
167656
167656
|
if (existing !== void 0) return existing || void 0;
|
|
167657
167657
|
const result = host.getParsedCommandLine ? host.getParsedCommandLine(fileName) : getParsedCommandLineOfConfigFileUsingSourceFile(fileName);
|
|
167658
|
-
(parsedCommandLines || (parsedCommandLines = /* @__PURE__ */ new Map())).set(
|
|
167658
|
+
(parsedCommandLines || (parsedCommandLines = /* @__PURE__ */ new Map())).set(path22, result || false);
|
|
167659
167659
|
return result;
|
|
167660
167660
|
}
|
|
167661
167661
|
function getParsedCommandLineOfConfigFileUsingSourceFile(configFileName) {
|
|
@@ -167697,7 +167697,7 @@ ${newComment.split("\n").map((c2) => ` * ${c2}`).join("\n")}
|
|
|
167697
167697
|
function getOrCreateSourceFile(fileName, languageVersionOrOptions, onError, shouldCreateNewSourceFile) {
|
|
167698
167698
|
return getOrCreateSourceFileByPath(fileName, toPath(fileName, currentDirectory, getCanonicalFileName), languageVersionOrOptions, onError, shouldCreateNewSourceFile);
|
|
167699
167699
|
}
|
|
167700
|
-
function getOrCreateSourceFileByPath(fileName,
|
|
167700
|
+
function getOrCreateSourceFileByPath(fileName, path22, languageVersionOrOptions, _onError, shouldCreateNewSourceFile) {
|
|
167701
167701
|
Debug.assert(compilerHost, "getOrCreateSourceFileByPath called after typical CompilerHost lifetime, check the callstack something with a reference to an old host.");
|
|
167702
167702
|
const scriptSnapshot = host.getScriptSnapshot(fileName);
|
|
167703
167703
|
if (!scriptSnapshot) {
|
|
@@ -167706,17 +167706,17 @@ ${newComment.split("\n").map((c2) => ` * ${c2}`).join("\n")}
|
|
|
167706
167706
|
const scriptKind = getScriptKind(fileName, host);
|
|
167707
167707
|
const scriptVersion = host.getScriptVersion(fileName);
|
|
167708
167708
|
if (!shouldCreateNewSourceFile) {
|
|
167709
|
-
const oldSourceFile = program2 && program2.getSourceFileByPath(
|
|
167709
|
+
const oldSourceFile = program2 && program2.getSourceFileByPath(path22);
|
|
167710
167710
|
if (oldSourceFile) {
|
|
167711
167711
|
if (scriptKind === oldSourceFile.scriptKind || releasedScriptKinds.has(oldSourceFile.resolvedPath)) {
|
|
167712
|
-
return documentRegistry.updateDocumentWithKey(fileName,
|
|
167712
|
+
return documentRegistry.updateDocumentWithKey(fileName, path22, host, documentRegistryBucketKey, scriptSnapshot, scriptVersion, scriptKind, languageVersionOrOptions);
|
|
167713
167713
|
} else {
|
|
167714
167714
|
documentRegistry.releaseDocumentWithKey(oldSourceFile.resolvedPath, documentRegistry.getKeyForCompilationSettings(program2.getCompilerOptions()), oldSourceFile.scriptKind, oldSourceFile.impliedNodeFormat);
|
|
167715
167715
|
releasedScriptKinds.add(oldSourceFile.resolvedPath);
|
|
167716
167716
|
}
|
|
167717
167717
|
}
|
|
167718
167718
|
}
|
|
167719
|
-
return documentRegistry.acquireDocumentWithKey(fileName,
|
|
167719
|
+
return documentRegistry.acquireDocumentWithKey(fileName, path22, host, documentRegistryBucketKey, scriptSnapshot, scriptVersion, scriptKind, languageVersionOrOptions);
|
|
167720
167720
|
}
|
|
167721
167721
|
}
|
|
167722
167722
|
function getProgram() {
|
|
@@ -168322,7 +168322,7 @@ ${newComment.split("\n").map((c2) => ` * ${c2}`).join("\n")}
|
|
|
168322
168322
|
return isArray(action) ? Promise.all(action.map((a2) => applySingleCodeActionCommand(a2))) : applySingleCodeActionCommand(action);
|
|
168323
168323
|
}
|
|
168324
168324
|
function applySingleCodeActionCommand(action) {
|
|
168325
|
-
const getPath = (
|
|
168325
|
+
const getPath = (path22) => toPath(path22, currentDirectory, getCanonicalFileName);
|
|
168326
168326
|
Debug.assertEqual(action.type, "install package");
|
|
168327
168327
|
return host.installPackage ? host.installPackage({ fileName: getPath(action.file), packageName: action.packageName }) : Promise.reject("Host does not implement `installPackage`");
|
|
168328
168328
|
}
|
|
@@ -168666,8 +168666,8 @@ ${newComment.split("\n").map((c2) => ` * ${c2}`).join("\n")}
|
|
|
168666
168666
|
function isLetterOrDigit(char) {
|
|
168667
168667
|
return char >= 97 && char <= 122 || char >= 65 && char <= 90 || char >= 48 && char <= 57;
|
|
168668
168668
|
}
|
|
168669
|
-
function isNodeModulesFile(
|
|
168670
|
-
return
|
|
168669
|
+
function isNodeModulesFile(path22) {
|
|
168670
|
+
return path22.includes("/node_modules/");
|
|
168671
168671
|
}
|
|
168672
168672
|
}
|
|
168673
168673
|
function getRenameInfo2(fileName, position, preferences) {
|
|
@@ -182311,11 +182311,11 @@ ${newComment.split("\n").map((c2) => ` * ${c2}`).join("\n")}
|
|
|
182311
182311
|
}
|
|
182312
182312
|
});
|
|
182313
182313
|
}
|
|
182314
|
-
function generateJSDocParamTagsForDestructuring(
|
|
182314
|
+
function generateJSDocParamTagsForDestructuring(path22, pattern, initializer3, dotDotDotToken, isJs, isSnippet, checker, options, preferences) {
|
|
182315
182315
|
if (!isJs) {
|
|
182316
182316
|
return [
|
|
182317
182317
|
getJSDocParamAnnotation(
|
|
182318
|
-
|
|
182318
|
+
path22,
|
|
182319
182319
|
initializer3,
|
|
182320
182320
|
dotDotDotToken,
|
|
182321
182321
|
isJs,
|
|
@@ -182329,13 +182329,13 @@ ${newComment.split("\n").map((c2) => ` * ${c2}`).join("\n")}
|
|
|
182329
182329
|
)
|
|
182330
182330
|
];
|
|
182331
182331
|
}
|
|
182332
|
-
return patternWorker(
|
|
182333
|
-
function patternWorker(
|
|
182332
|
+
return patternWorker(path22, pattern, initializer3, dotDotDotToken, { tabstop: 1 });
|
|
182333
|
+
function patternWorker(path23, pattern2, initializer22, dotDotDotToken2, counter) {
|
|
182334
182334
|
if (isObjectBindingPattern(pattern2) && !dotDotDotToken2) {
|
|
182335
182335
|
const oldTabstop = counter.tabstop;
|
|
182336
182336
|
const childCounter = { tabstop: oldTabstop };
|
|
182337
182337
|
const rootParam = getJSDocParamAnnotation(
|
|
182338
|
-
|
|
182338
|
+
path23,
|
|
182339
182339
|
initializer22,
|
|
182340
182340
|
dotDotDotToken2,
|
|
182341
182341
|
isJs,
|
|
@@ -182349,7 +182349,7 @@ ${newComment.split("\n").map((c2) => ` * ${c2}`).join("\n")}
|
|
|
182349
182349
|
);
|
|
182350
182350
|
let childTags = [];
|
|
182351
182351
|
for (const element of pattern2.elements) {
|
|
182352
|
-
const elementTags = elementWorker(
|
|
182352
|
+
const elementTags = elementWorker(path23, element, childCounter);
|
|
182353
182353
|
if (!elementTags) {
|
|
182354
182354
|
childTags = void 0;
|
|
182355
182355
|
break;
|
|
@@ -182364,7 +182364,7 @@ ${newComment.split("\n").map((c2) => ` * ${c2}`).join("\n")}
|
|
|
182364
182364
|
}
|
|
182365
182365
|
return [
|
|
182366
182366
|
getJSDocParamAnnotation(
|
|
182367
|
-
|
|
182367
|
+
path23,
|
|
182368
182368
|
initializer22,
|
|
182369
182369
|
dotDotDotToken2,
|
|
182370
182370
|
isJs,
|
|
@@ -182378,13 +182378,13 @@ ${newComment.split("\n").map((c2) => ` * ${c2}`).join("\n")}
|
|
|
182378
182378
|
)
|
|
182379
182379
|
];
|
|
182380
182380
|
}
|
|
182381
|
-
function elementWorker(
|
|
182381
|
+
function elementWorker(path23, element, counter) {
|
|
182382
182382
|
if (!element.propertyName && isIdentifier(element.name) || isIdentifier(element.name)) {
|
|
182383
182383
|
const propertyName = element.propertyName ? tryGetTextOfPropertyName(element.propertyName) : element.name.text;
|
|
182384
182384
|
if (!propertyName) {
|
|
182385
182385
|
return void 0;
|
|
182386
182386
|
}
|
|
182387
|
-
const paramName = `${
|
|
182387
|
+
const paramName = `${path23}.${propertyName}`;
|
|
182388
182388
|
return [
|
|
182389
182389
|
getJSDocParamAnnotation(
|
|
182390
182390
|
paramName,
|
|
@@ -182402,7 +182402,7 @@ ${newComment.split("\n").map((c2) => ` * ${c2}`).join("\n")}
|
|
|
182402
182402
|
];
|
|
182403
182403
|
} else if (element.propertyName) {
|
|
182404
182404
|
const propertyName = tryGetTextOfPropertyName(element.propertyName);
|
|
182405
|
-
return propertyName && patternWorker(`${
|
|
182405
|
+
return propertyName && patternWorker(`${path23}.${propertyName}`, element.name, element.initializer, element.dotDotDotToken, counter);
|
|
182406
182406
|
}
|
|
182407
182407
|
return void 0;
|
|
182408
182408
|
}
|
|
@@ -186984,21 +186984,21 @@ ${newComment.split("\n").map((c2) => ` * ${c2}`).join("\n")}
|
|
|
186984
186984
|
function getFragmentDirectory(fragment) {
|
|
186985
186985
|
return containsSlash(fragment) ? hasTrailingDirectorySeparator(fragment) ? fragment : getDirectoryPath(fragment) : void 0;
|
|
186986
186986
|
}
|
|
186987
|
-
function getCompletionsForPathMapping(
|
|
186988
|
-
const parsedPath = tryParsePattern(
|
|
186987
|
+
function getCompletionsForPathMapping(path22, patterns, fragment, packageDirectory, extensionOptions, isExports, isImports, program2, host, moduleSpecifierResolutionHost) {
|
|
186988
|
+
const parsedPath = tryParsePattern(path22);
|
|
186989
186989
|
if (!parsedPath) {
|
|
186990
186990
|
return emptyArray;
|
|
186991
186991
|
}
|
|
186992
186992
|
if (typeof parsedPath === "string") {
|
|
186993
186993
|
return justPathMappingName(
|
|
186994
|
-
|
|
186994
|
+
path22,
|
|
186995
186995
|
"script"
|
|
186996
186996
|
/* scriptElement */
|
|
186997
186997
|
);
|
|
186998
186998
|
}
|
|
186999
186999
|
const remainingFragment = tryRemovePrefix(fragment, parsedPath.prefix);
|
|
187000
187000
|
if (remainingFragment === void 0) {
|
|
187001
|
-
const starIsFullPathComponent = endsWith(
|
|
187001
|
+
const starIsFullPathComponent = endsWith(path22, "/*");
|
|
187002
187002
|
return starIsFullPathComponent ? justPathMappingName(
|
|
187003
187003
|
parsedPath.prefix,
|
|
187004
187004
|
"directory"
|
|
@@ -187084,9 +187084,9 @@ ${newComment.split("\n").map((c2) => ` * ${c2}`).join("\n")}
|
|
|
187084
187084
|
function getDirectoryMatches(directoryName) {
|
|
187085
187085
|
return mapDefined(tryGetDirectories(host, directoryName), (dir) => dir === "node_modules" ? void 0 : directoryResult(dir));
|
|
187086
187086
|
}
|
|
187087
|
-
function trimPrefixAndSuffix(
|
|
187087
|
+
function trimPrefixAndSuffix(path22, prefix) {
|
|
187088
187088
|
return firstDefined(matchingSuffixes, (suffix) => {
|
|
187089
|
-
const inner = withoutStartAndEnd(normalizePath(
|
|
187089
|
+
const inner = withoutStartAndEnd(normalizePath(path22), prefix, suffix);
|
|
187090
187090
|
return inner === void 0 ? void 0 : removeLeadingDirectorySeparator(inner);
|
|
187091
187091
|
});
|
|
187092
187092
|
}
|
|
@@ -187094,8 +187094,8 @@ ${newComment.split("\n").map((c2) => ` * ${c2}`).join("\n")}
|
|
|
187094
187094
|
function withoutStartAndEnd(s, start, end) {
|
|
187095
187095
|
return startsWith(s, start) && endsWith(s, end) ? s.slice(start.length, s.length - end.length) : void 0;
|
|
187096
187096
|
}
|
|
187097
|
-
function removeLeadingDirectorySeparator(
|
|
187098
|
-
return
|
|
187097
|
+
function removeLeadingDirectorySeparator(path22) {
|
|
187098
|
+
return path22[0] === directorySeparator ? path22.slice(1) : path22;
|
|
187099
187099
|
}
|
|
187100
187100
|
function getAmbientModuleCompletions(fragment, fragmentDirectory, checker) {
|
|
187101
187101
|
const ambientModules = checker.getAmbientModules().map((sym) => stripQuotes(sym.name));
|
|
@@ -187210,10 +187210,10 @@ ${newComment.split("\n").map((c2) => ` * ${c2}`).join("\n")}
|
|
|
187210
187210
|
/* ESNext */
|
|
187211
187211
|
) ? void 0 : createTextSpan(textStart + offset, length2);
|
|
187212
187212
|
}
|
|
187213
|
-
function isPathRelativeToScript(
|
|
187214
|
-
if (
|
|
187215
|
-
const slashIndex =
|
|
187216
|
-
const slashCharCode =
|
|
187213
|
+
function isPathRelativeToScript(path22) {
|
|
187214
|
+
if (path22 && path22.length >= 2 && path22.charCodeAt(0) === 46) {
|
|
187215
|
+
const slashIndex = path22.length >= 3 && path22.charCodeAt(1) === 46 ? 2 : 1;
|
|
187216
|
+
const slashCharCode = path22.charCodeAt(slashIndex);
|
|
187217
187217
|
return slashCharCode === 47 || slashCharCode === 92;
|
|
187218
187218
|
}
|
|
187219
187219
|
return false;
|
|
@@ -203226,17 +203226,17 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
203226
203226
|
function createNormalizedPathMap() {
|
|
203227
203227
|
const map22 = /* @__PURE__ */ new Map();
|
|
203228
203228
|
return {
|
|
203229
|
-
get(
|
|
203230
|
-
return map22.get(
|
|
203229
|
+
get(path22) {
|
|
203230
|
+
return map22.get(path22);
|
|
203231
203231
|
},
|
|
203232
|
-
set(
|
|
203233
|
-
map22.set(
|
|
203232
|
+
set(path22, value) {
|
|
203233
|
+
map22.set(path22, value);
|
|
203234
203234
|
},
|
|
203235
|
-
contains(
|
|
203236
|
-
return map22.has(
|
|
203235
|
+
contains(path22) {
|
|
203236
|
+
return map22.has(path22);
|
|
203237
203237
|
},
|
|
203238
|
-
remove(
|
|
203239
|
-
map22.delete(
|
|
203238
|
+
remove(path22) {
|
|
203239
|
+
map22.delete(path22);
|
|
203240
203240
|
}
|
|
203241
203241
|
};
|
|
203242
203242
|
}
|
|
@@ -203751,12 +203751,12 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
203751
203751
|
return fileName[0] === "^" || (fileName.includes("walkThroughSnippet:/") || fileName.includes("untitled:/")) && getBaseFileName(fileName)[0] === "^" || fileName.includes(":^") && !fileName.includes(directorySeparator);
|
|
203752
203752
|
}
|
|
203753
203753
|
var ScriptInfo = class {
|
|
203754
|
-
constructor(host, fileName, scriptKind, hasMixedContent,
|
|
203754
|
+
constructor(host, fileName, scriptKind, hasMixedContent, path22, initialVersion) {
|
|
203755
203755
|
this.host = host;
|
|
203756
203756
|
this.fileName = fileName;
|
|
203757
203757
|
this.scriptKind = scriptKind;
|
|
203758
203758
|
this.hasMixedContent = hasMixedContent;
|
|
203759
|
-
this.path =
|
|
203759
|
+
this.path = path22;
|
|
203760
203760
|
this.containingProjects = [];
|
|
203761
203761
|
this.isDynamic = isDynamicFileName(fileName);
|
|
203762
203762
|
this.textStorage = new TextStorage(host, this, initialVersion);
|
|
@@ -204391,8 +204391,8 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
204391
204391
|
useCaseSensitiveFileNames() {
|
|
204392
204392
|
return this.projectService.host.useCaseSensitiveFileNames;
|
|
204393
204393
|
}
|
|
204394
|
-
readDirectory(
|
|
204395
|
-
return this.directoryStructureHost.readDirectory(
|
|
204394
|
+
readDirectory(path22, extensions, exclude, include, depth) {
|
|
204395
|
+
return this.directoryStructureHost.readDirectory(path22, extensions, exclude, include, depth);
|
|
204396
204396
|
}
|
|
204397
204397
|
readFile(fileName) {
|
|
204398
204398
|
return this.projectService.host.readFile(fileName);
|
|
@@ -204401,8 +204401,8 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
204401
204401
|
return this.projectService.host.writeFile(fileName, content);
|
|
204402
204402
|
}
|
|
204403
204403
|
fileExists(file2) {
|
|
204404
|
-
const
|
|
204405
|
-
return !!this.projectService.getScriptInfoForPath(
|
|
204404
|
+
const path22 = this.toPath(file2);
|
|
204405
|
+
return !!this.projectService.getScriptInfoForPath(path22) || !this.isWatchedMissingFile(path22) && this.directoryStructureHost.fileExists(file2);
|
|
204406
204406
|
}
|
|
204407
204407
|
/** @internal */
|
|
204408
204408
|
resolveModuleNameLiterals(moduleLiterals, containingFile, redirectedReference, options, containingSourceFile, reusedNames) {
|
|
@@ -204427,11 +204427,11 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
204427
204427
|
resolveLibrary(libraryName, resolveFrom, options, libFileName) {
|
|
204428
204428
|
return this.resolutionCache.resolveLibrary(libraryName, resolveFrom, options, libFileName);
|
|
204429
204429
|
}
|
|
204430
|
-
directoryExists(
|
|
204431
|
-
return this.directoryStructureHost.directoryExists(
|
|
204430
|
+
directoryExists(path22) {
|
|
204431
|
+
return this.directoryStructureHost.directoryExists(path22);
|
|
204432
204432
|
}
|
|
204433
|
-
getDirectories(
|
|
204434
|
-
return this.directoryStructureHost.getDirectories(
|
|
204433
|
+
getDirectories(path22) {
|
|
204434
|
+
return this.directoryStructureHost.getDirectories(path22);
|
|
204435
204435
|
}
|
|
204436
204436
|
/** @internal */
|
|
204437
204437
|
getCachedDirectoryStructureHost() {
|
|
@@ -204694,16 +204694,16 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
204694
204694
|
}
|
|
204695
204695
|
}));
|
|
204696
204696
|
}
|
|
204697
|
-
getSourceFile(
|
|
204697
|
+
getSourceFile(path22) {
|
|
204698
204698
|
if (!this.program) {
|
|
204699
204699
|
return void 0;
|
|
204700
204700
|
}
|
|
204701
|
-
return this.program.getSourceFileByPath(
|
|
204701
|
+
return this.program.getSourceFileByPath(path22);
|
|
204702
204702
|
}
|
|
204703
204703
|
/** @internal */
|
|
204704
|
-
getSourceFileOrConfigFile(
|
|
204704
|
+
getSourceFileOrConfigFile(path22) {
|
|
204705
204705
|
const options = this.program.getCompilerOptions();
|
|
204706
|
-
return
|
|
204706
|
+
return path22 === options.configFilePath ? options.configFile : this.getSourceFile(path22);
|
|
204707
204707
|
}
|
|
204708
204708
|
close() {
|
|
204709
204709
|
var _a3;
|
|
@@ -204880,8 +204880,8 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
204880
204880
|
}
|
|
204881
204881
|
// add a root file that doesnt exist on host
|
|
204882
204882
|
addMissingFileRoot(fileName) {
|
|
204883
|
-
const
|
|
204884
|
-
this.rootFilesMap.set(
|
|
204883
|
+
const path22 = this.projectService.toPath(fileName);
|
|
204884
|
+
this.rootFilesMap.set(path22, { fileName });
|
|
204885
204885
|
this.markAsDirty();
|
|
204886
204886
|
}
|
|
204887
204887
|
removeFile(info, fileExists, detachFromProject) {
|
|
@@ -205050,22 +205050,22 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
205050
205050
|
const toRemove = new Map(this.typingWatchers);
|
|
205051
205051
|
if (!this.typingWatchers) this.typingWatchers = /* @__PURE__ */ new Map();
|
|
205052
205052
|
this.typingWatchers.isInvoked = false;
|
|
205053
|
-
const createProjectWatcher = (
|
|
205054
|
-
const canonicalPath = this.toPath(
|
|
205053
|
+
const createProjectWatcher = (path22, typingsWatcherType) => {
|
|
205054
|
+
const canonicalPath = this.toPath(path22);
|
|
205055
205055
|
toRemove.delete(canonicalPath);
|
|
205056
205056
|
if (!this.typingWatchers.has(canonicalPath)) {
|
|
205057
205057
|
const watchType = typingsWatcherType === "FileWatcher" ? WatchType.TypingInstallerLocationFile : WatchType.TypingInstallerLocationDirectory;
|
|
205058
205058
|
this.typingWatchers.set(
|
|
205059
205059
|
canonicalPath,
|
|
205060
205060
|
canWatchDirectoryOrFilePath(canonicalPath) ? typingsWatcherType === "FileWatcher" ? this.projectService.watchFactory.watchFile(
|
|
205061
|
-
|
|
205061
|
+
path22,
|
|
205062
205062
|
() => !this.typingWatchers.isInvoked ? this.onTypingInstallerWatchInvoke() : this.writeLog(`TypingWatchers already invoked`),
|
|
205063
205063
|
2e3,
|
|
205064
205064
|
this.projectService.getWatchOptions(this),
|
|
205065
205065
|
watchType,
|
|
205066
205066
|
this
|
|
205067
205067
|
) : this.projectService.watchFactory.watchDirectory(
|
|
205068
|
-
|
|
205068
|
+
path22,
|
|
205069
205069
|
(f) => {
|
|
205070
205070
|
if (this.typingWatchers.isInvoked) return this.writeLog(`TypingWatchers already invoked`);
|
|
205071
205071
|
if (!fileExtensionIs(
|
|
@@ -205080,7 +205080,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
205080
205080
|
this.projectService.getWatchOptions(this),
|
|
205081
205081
|
watchType,
|
|
205082
205082
|
this
|
|
205083
|
-
) : (this.writeLog(`Skipping watcher creation at ${
|
|
205083
|
+
) : (this.writeLog(`Skipping watcher creation at ${path22}:: ${getDetailWatchInfo(watchType, this)}`), noopFileWatcher)
|
|
205084
205084
|
);
|
|
205085
205085
|
}
|
|
205086
205086
|
};
|
|
@@ -205125,14 +205125,14 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
205125
205125
|
/* DirectoryWatcher */
|
|
205126
205126
|
);
|
|
205127
205127
|
}
|
|
205128
|
-
toRemove.forEach((watch,
|
|
205128
|
+
toRemove.forEach((watch, path22) => {
|
|
205129
205129
|
watch.close();
|
|
205130
|
-
this.typingWatchers.delete(
|
|
205130
|
+
this.typingWatchers.delete(path22);
|
|
205131
205131
|
});
|
|
205132
205132
|
}
|
|
205133
205133
|
/** @internal */
|
|
205134
|
-
skipWatchingFailedLookups(
|
|
205135
|
-
const info = this.projectService.getScriptInfoForPath(
|
|
205134
|
+
skipWatchingFailedLookups(path22) {
|
|
205135
|
+
const info = this.projectService.getScriptInfoForPath(path22);
|
|
205136
205136
|
return info == null ? void 0 : info.isDynamic;
|
|
205137
205137
|
}
|
|
205138
205138
|
/** @internal */
|
|
@@ -205170,9 +205170,9 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
205170
205170
|
let hasNewProgram = false;
|
|
205171
205171
|
if (this.program && (!oldProgram || this.program !== oldProgram && this.program.structureIsReused !== 2)) {
|
|
205172
205172
|
hasNewProgram = true;
|
|
205173
|
-
this.rootFilesMap.forEach((value,
|
|
205173
|
+
this.rootFilesMap.forEach((value, path22) => {
|
|
205174
205174
|
var _a22;
|
|
205175
|
-
const file2 = this.program.getSourceFileByPath(
|
|
205175
|
+
const file2 = this.program.getSourceFileByPath(path22);
|
|
205176
205176
|
const info = value.info;
|
|
205177
205177
|
if (!file2 || ((_a22 = value.info) == null ? void 0 : _a22.path) === file2.resolvedPath) return;
|
|
205178
205178
|
value.info = this.projectService.getScriptInfo(file2.fileName);
|
|
@@ -205328,8 +205328,8 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
205328
205328
|
);
|
|
205329
205329
|
return fileWatcher;
|
|
205330
205330
|
}
|
|
205331
|
-
isWatchedMissingFile(
|
|
205332
|
-
return !!this.missingFilesMap && this.missingFilesMap.has(
|
|
205331
|
+
isWatchedMissingFile(path22) {
|
|
205332
|
+
return !!this.missingFilesMap && this.missingFilesMap.has(path22);
|
|
205333
205333
|
}
|
|
205334
205334
|
/** @internal */
|
|
205335
205335
|
addGeneratedFileWatch(generatedFile, sourceFile) {
|
|
@@ -205338,17 +205338,17 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
205338
205338
|
this.generatedFilesMap = this.createGeneratedFileWatcher(generatedFile);
|
|
205339
205339
|
}
|
|
205340
205340
|
} else {
|
|
205341
|
-
const
|
|
205341
|
+
const path22 = this.toPath(sourceFile);
|
|
205342
205342
|
if (this.generatedFilesMap) {
|
|
205343
205343
|
if (isGeneratedFileWatcher(this.generatedFilesMap)) {
|
|
205344
205344
|
Debug.fail(`${this.projectName} Expected to not have --out watcher for generated file with options: ${JSON.stringify(this.compilerOptions)}`);
|
|
205345
205345
|
return;
|
|
205346
205346
|
}
|
|
205347
|
-
if (this.generatedFilesMap.has(
|
|
205347
|
+
if (this.generatedFilesMap.has(path22)) return;
|
|
205348
205348
|
} else {
|
|
205349
205349
|
this.generatedFilesMap = /* @__PURE__ */ new Map();
|
|
205350
205350
|
}
|
|
205351
|
-
this.generatedFilesMap.set(
|
|
205351
|
+
this.generatedFilesMap.set(path22, this.createGeneratedFileWatcher(generatedFile));
|
|
205352
205352
|
}
|
|
205353
205353
|
}
|
|
205354
205354
|
createGeneratedFileWatcher(generatedFile) {
|
|
@@ -205748,7 +205748,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
205748
205748
|
isDefaultProjectForOpenFiles() {
|
|
205749
205749
|
return !!forEachEntry(
|
|
205750
205750
|
this.projectService.openFiles,
|
|
205751
|
-
(_projectRootPath,
|
|
205751
|
+
(_projectRootPath, path22) => this.projectService.tryGetDefaultProjectForFile(this.projectService.getScriptInfoForPath(path22)) === this
|
|
205752
205752
|
);
|
|
205753
205753
|
}
|
|
205754
205754
|
/** @internal */
|
|
@@ -206925,33 +206925,33 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
206925
206925
|
getCurrentDirectory: () => service.host.getCurrentDirectory(),
|
|
206926
206926
|
useCaseSensitiveFileNames: service.host.useCaseSensitiveFileNames
|
|
206927
206927
|
};
|
|
206928
|
-
function watchFile2(
|
|
206928
|
+
function watchFile2(path22, callback) {
|
|
206929
206929
|
return getOrCreateFileWatcher(
|
|
206930
206930
|
watchedFiles,
|
|
206931
|
-
|
|
206931
|
+
path22,
|
|
206932
206932
|
callback,
|
|
206933
|
-
(id) => ({ eventName: CreateFileWatcherEvent, data: { id, path:
|
|
206933
|
+
(id) => ({ eventName: CreateFileWatcherEvent, data: { id, path: path22 } })
|
|
206934
206934
|
);
|
|
206935
206935
|
}
|
|
206936
|
-
function watchDirectory(
|
|
206936
|
+
function watchDirectory(path22, callback, recursive) {
|
|
206937
206937
|
return getOrCreateFileWatcher(
|
|
206938
206938
|
recursive ? watchedDirectoriesRecursive : watchedDirectories,
|
|
206939
|
-
|
|
206939
|
+
path22,
|
|
206940
206940
|
callback,
|
|
206941
206941
|
(id) => ({
|
|
206942
206942
|
eventName: CreateDirectoryWatcherEvent,
|
|
206943
206943
|
data: {
|
|
206944
206944
|
id,
|
|
206945
|
-
path:
|
|
206945
|
+
path: path22,
|
|
206946
206946
|
recursive: !!recursive,
|
|
206947
206947
|
// Special case node_modules as we watch it for changes to closed script infos as well
|
|
206948
|
-
ignoreUpdate: !
|
|
206948
|
+
ignoreUpdate: !path22.endsWith("/node_modules") ? true : void 0
|
|
206949
206949
|
}
|
|
206950
206950
|
})
|
|
206951
206951
|
);
|
|
206952
206952
|
}
|
|
206953
|
-
function getOrCreateFileWatcher({ pathToId, idToCallbacks },
|
|
206954
|
-
const key = service.toPath(
|
|
206953
|
+
function getOrCreateFileWatcher({ pathToId, idToCallbacks }, path22, callback, event) {
|
|
206954
|
+
const key = service.toPath(path22);
|
|
206955
206955
|
let id = pathToId.get(key);
|
|
206956
206956
|
if (!id) pathToId.set(key, id = ids++);
|
|
206957
206957
|
let callbacks = idToCallbacks.get(id);
|
|
@@ -207120,13 +207120,13 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
207120
207120
|
return getNormalizedAbsolutePath(fileName, this.host.getCurrentDirectory());
|
|
207121
207121
|
}
|
|
207122
207122
|
/** @internal */
|
|
207123
|
-
setDocument(key,
|
|
207124
|
-
const info = Debug.checkDefined(this.getScriptInfoForPath(
|
|
207123
|
+
setDocument(key, path22, sourceFile) {
|
|
207124
|
+
const info = Debug.checkDefined(this.getScriptInfoForPath(path22));
|
|
207125
207125
|
info.cacheSourceFile = { key, sourceFile };
|
|
207126
207126
|
}
|
|
207127
207127
|
/** @internal */
|
|
207128
|
-
getDocument(key,
|
|
207129
|
-
const info = this.getScriptInfoForPath(
|
|
207128
|
+
getDocument(key, path22) {
|
|
207129
|
+
const info = this.getScriptInfoForPath(path22);
|
|
207130
207130
|
return info && info.cacheSourceFile && info.cacheSourceFile.key === key ? info.cacheSourceFile.sourceFile : void 0;
|
|
207131
207131
|
}
|
|
207132
207132
|
/** @internal */
|
|
@@ -207248,7 +207248,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
207248
207248
|
const event = {
|
|
207249
207249
|
eventName: ProjectsUpdatedInBackgroundEvent,
|
|
207250
207250
|
data: {
|
|
207251
|
-
openFiles: arrayFrom(this.openFiles.keys(), (
|
|
207251
|
+
openFiles: arrayFrom(this.openFiles.keys(), (path22) => this.getScriptInfoForPath(path22).fileName)
|
|
207252
207252
|
}
|
|
207253
207253
|
};
|
|
207254
207254
|
this.eventHandler(event);
|
|
@@ -207470,11 +207470,11 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
207470
207470
|
}
|
|
207471
207471
|
delayUpdateSourceInfoProjects(sourceInfos) {
|
|
207472
207472
|
if (sourceInfos) {
|
|
207473
|
-
sourceInfos.forEach((_value,
|
|
207473
|
+
sourceInfos.forEach((_value, path22) => this.delayUpdateProjectsOfScriptInfoPath(path22));
|
|
207474
207474
|
}
|
|
207475
207475
|
}
|
|
207476
|
-
delayUpdateProjectsOfScriptInfoPath(
|
|
207477
|
-
const info = this.getScriptInfoForPath(
|
|
207476
|
+
delayUpdateProjectsOfScriptInfoPath(path22) {
|
|
207477
|
+
const info = this.getScriptInfoForPath(path22);
|
|
207478
207478
|
if (info) {
|
|
207479
207479
|
this.delayUpdateProjectGraphs(
|
|
207480
207480
|
info.containingProjects,
|
|
@@ -207568,8 +207568,8 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
207568
207568
|
const project = this.getConfiguredProjectByCanonicalConfigFilePath(projectCanonicalPath);
|
|
207569
207569
|
if (!project) return;
|
|
207570
207570
|
if (configuredProjectForConfig !== project && this.getHostPreferences().includeCompletionsForModuleExports) {
|
|
207571
|
-
const
|
|
207572
|
-
if (find((_a3 = project.getCurrentProgram()) == null ? void 0 : _a3.getResolvedProjectReferences(), (ref) => (ref == null ? void 0 : ref.sourceFile.path) ===
|
|
207571
|
+
const path22 = this.toPath(configFileName);
|
|
207572
|
+
if (find((_a3 = project.getCurrentProgram()) == null ? void 0 : _a3.getResolvedProjectReferences(), (ref) => (ref == null ? void 0 : ref.sourceFile.path) === path22)) {
|
|
207573
207573
|
project.markAutoImportProviderAsDirty();
|
|
207574
207574
|
}
|
|
207575
207575
|
}
|
|
@@ -207613,21 +207613,21 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
207613
207613
|
project.markAutoImportProviderAsDirty();
|
|
207614
207614
|
} else {
|
|
207615
207615
|
if (project.initialLoadPending) {
|
|
207616
|
-
(_b = (_a3 = this.configFileExistenceInfoCache.get(projectCanonicalPath)) == null ? void 0 : _a3.openFilesImpactedByConfigFile) == null ? void 0 : _b.forEach((
|
|
207616
|
+
(_b = (_a3 = this.configFileExistenceInfoCache.get(projectCanonicalPath)) == null ? void 0 : _a3.openFilesImpactedByConfigFile) == null ? void 0 : _b.forEach((path23) => {
|
|
207617
207617
|
var _a22;
|
|
207618
|
-
if (!((_a22 = this.pendingOpenFileProjectUpdates) == null ? void 0 : _a22.has(
|
|
207618
|
+
if (!((_a22 = this.pendingOpenFileProjectUpdates) == null ? void 0 : _a22.has(path23))) {
|
|
207619
207619
|
(this.pendingOpenFileProjectUpdates ?? (this.pendingOpenFileProjectUpdates = /* @__PURE__ */ new Map())).set(
|
|
207620
|
-
|
|
207621
|
-
this.configFileForOpenFiles.get(
|
|
207620
|
+
path23,
|
|
207621
|
+
this.configFileForOpenFiles.get(path23)
|
|
207622
207622
|
);
|
|
207623
207623
|
}
|
|
207624
207624
|
});
|
|
207625
207625
|
return;
|
|
207626
207626
|
}
|
|
207627
|
-
const
|
|
207628
|
-
project.resolutionCache.removeResolutionsFromProjectReferenceRedirects(
|
|
207627
|
+
const path22 = this.toPath(canonicalConfigFilePath);
|
|
207628
|
+
project.resolutionCache.removeResolutionsFromProjectReferenceRedirects(path22);
|
|
207629
207629
|
this.delayUpdateProjectGraph(project);
|
|
207630
|
-
if (this.getHostPreferences().includeCompletionsForModuleExports && find((_c = project.getCurrentProgram()) == null ? void 0 : _c.getResolvedProjectReferences(), (ref) => (ref == null ? void 0 : ref.sourceFile.path) ===
|
|
207630
|
+
if (this.getHostPreferences().includeCompletionsForModuleExports && find((_c = project.getCurrentProgram()) == null ? void 0 : _c.getResolvedProjectReferences(), (ref) => (ref == null ? void 0 : ref.sourceFile.path) === path22)) {
|
|
207631
207631
|
project.markAutoImportProviderAsDirty();
|
|
207632
207632
|
}
|
|
207633
207633
|
}
|
|
@@ -207652,20 +207652,20 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
207652
207652
|
canonicalConfigFilePath,
|
|
207653
207653
|
"Change in config file detected"
|
|
207654
207654
|
);
|
|
207655
|
-
this.openFiles.forEach((_projectRootPath,
|
|
207655
|
+
this.openFiles.forEach((_projectRootPath, path22) => {
|
|
207656
207656
|
var _a3, _b;
|
|
207657
|
-
const configFileForOpenFile = this.configFileForOpenFiles.get(
|
|
207658
|
-
if (!((_a3 = configFileExistenceInfo.openFilesImpactedByConfigFile) == null ? void 0 : _a3.has(
|
|
207659
|
-
this.configFileForOpenFiles.delete(
|
|
207660
|
-
const info = this.getScriptInfoForPath(
|
|
207657
|
+
const configFileForOpenFile = this.configFileForOpenFiles.get(path22);
|
|
207658
|
+
if (!((_a3 = configFileExistenceInfo.openFilesImpactedByConfigFile) == null ? void 0 : _a3.has(path22))) return;
|
|
207659
|
+
this.configFileForOpenFiles.delete(path22);
|
|
207660
|
+
const info = this.getScriptInfoForPath(path22);
|
|
207661
207661
|
const newConfigFileNameForInfo = this.getConfigFileNameForFile(
|
|
207662
207662
|
info,
|
|
207663
207663
|
/*findFromCacheOnly*/
|
|
207664
207664
|
false
|
|
207665
207665
|
);
|
|
207666
207666
|
if (!newConfigFileNameForInfo) return;
|
|
207667
|
-
if (!((_b = this.pendingOpenFileProjectUpdates) == null ? void 0 : _b.has(
|
|
207668
|
-
(this.pendingOpenFileProjectUpdates ?? (this.pendingOpenFileProjectUpdates = /* @__PURE__ */ new Map())).set(
|
|
207667
|
+
if (!((_b = this.pendingOpenFileProjectUpdates) == null ? void 0 : _b.has(path22))) {
|
|
207668
|
+
(this.pendingOpenFileProjectUpdates ?? (this.pendingOpenFileProjectUpdates = /* @__PURE__ */ new Map())).set(path22, configFileForOpenFile);
|
|
207669
207669
|
}
|
|
207670
207670
|
});
|
|
207671
207671
|
this.delayEnsureProjectForOpenFiles();
|
|
@@ -207760,8 +207760,8 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
207760
207760
|
return project;
|
|
207761
207761
|
}
|
|
207762
207762
|
assignOrphanScriptInfosToInferredProject() {
|
|
207763
|
-
this.openFiles.forEach((projectRootPath,
|
|
207764
|
-
const info = this.getScriptInfoForPath(
|
|
207763
|
+
this.openFiles.forEach((projectRootPath, path22) => {
|
|
207764
|
+
const info = this.getScriptInfoForPath(path22);
|
|
207765
207765
|
if (info.isOrphan()) {
|
|
207766
207766
|
this.assignOrphanScriptInfoToInferredProject(info, projectRootPath);
|
|
207767
207767
|
}
|
|
@@ -208073,8 +208073,8 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
208073
208073
|
this.configuredProjects.forEach(printProjectWithoutFileNames);
|
|
208074
208074
|
this.inferredProjects.forEach(printProjectWithoutFileNames);
|
|
208075
208075
|
this.logger.info("Open files: ");
|
|
208076
|
-
this.openFiles.forEach((projectRootPath,
|
|
208077
|
-
const info = this.getScriptInfoForPath(
|
|
208076
|
+
this.openFiles.forEach((projectRootPath, path22) => {
|
|
208077
|
+
const info = this.getScriptInfoForPath(path22);
|
|
208078
208078
|
this.logger.info(` FileName: ${info.fileName} ProjectRootPath: ${projectRootPath}`);
|
|
208079
208079
|
this.logger.info(` Projects: ${info.containingProjects.map((p) => p.getProjectName())}`);
|
|
208080
208080
|
});
|
|
@@ -208400,12 +208400,12 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
208400
208400
|
const newRootFile = propertyReader.getFileName(f);
|
|
208401
208401
|
const fileName = toNormalizedPath(newRootFile);
|
|
208402
208402
|
const isDynamic = isDynamicFileName(fileName);
|
|
208403
|
-
let
|
|
208403
|
+
let path22;
|
|
208404
208404
|
if (!isDynamic && !project.fileExists(newRootFile)) {
|
|
208405
|
-
|
|
208406
|
-
const existingValue = projectRootFilesMap.get(
|
|
208405
|
+
path22 = normalizedPathToPath(fileName, this.currentDirectory, this.toCanonicalFileName);
|
|
208406
|
+
const existingValue = projectRootFilesMap.get(path22);
|
|
208407
208407
|
if (existingValue) {
|
|
208408
|
-
if (((_a3 = existingValue.info) == null ? void 0 : _a3.path) ===
|
|
208408
|
+
if (((_a3 = existingValue.info) == null ? void 0 : _a3.path) === path22) {
|
|
208409
208409
|
project.removeFile(
|
|
208410
208410
|
existingValue.info,
|
|
208411
208411
|
/*fileExists*/
|
|
@@ -208417,7 +208417,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
208417
208417
|
}
|
|
208418
208418
|
existingValue.fileName = fileName;
|
|
208419
208419
|
} else {
|
|
208420
|
-
projectRootFilesMap.set(
|
|
208420
|
+
projectRootFilesMap.set(path22, { fileName });
|
|
208421
208421
|
}
|
|
208422
208422
|
} else {
|
|
208423
208423
|
const scriptKind = propertyReader.getScriptKind(f, this.hostConfiguration.extraFileExtensions);
|
|
@@ -208431,8 +208431,8 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
208431
208431
|
/*deferredDeleteOk*/
|
|
208432
208432
|
false
|
|
208433
208433
|
));
|
|
208434
|
-
|
|
208435
|
-
const existingValue = projectRootFilesMap.get(
|
|
208434
|
+
path22 = scriptInfo.path;
|
|
208435
|
+
const existingValue = projectRootFilesMap.get(path22);
|
|
208436
208436
|
if (!existingValue || existingValue.info !== scriptInfo) {
|
|
208437
208437
|
project.addRoot(scriptInfo, fileName);
|
|
208438
208438
|
if (scriptInfo.isScriptOpen()) {
|
|
@@ -208442,11 +208442,11 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
208442
208442
|
existingValue.fileName = fileName;
|
|
208443
208443
|
}
|
|
208444
208444
|
}
|
|
208445
|
-
newRootScriptInfoMap.set(
|
|
208445
|
+
newRootScriptInfoMap.set(path22, true);
|
|
208446
208446
|
}
|
|
208447
208447
|
if (projectRootFilesMap.size > newRootScriptInfoMap.size) {
|
|
208448
|
-
projectRootFilesMap.forEach((value,
|
|
208449
|
-
if (!newRootScriptInfoMap.has(
|
|
208448
|
+
projectRootFilesMap.forEach((value, path22) => {
|
|
208449
|
+
if (!newRootScriptInfoMap.has(path22)) {
|
|
208450
208450
|
if (value.info) {
|
|
208451
208451
|
project.removeFile(
|
|
208452
208452
|
value.info,
|
|
@@ -208455,7 +208455,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
208455
208455
|
true
|
|
208456
208456
|
);
|
|
208457
208457
|
} else {
|
|
208458
|
-
projectRootFilesMap.delete(
|
|
208458
|
+
projectRootFilesMap.delete(path22);
|
|
208459
208459
|
}
|
|
208460
208460
|
}
|
|
208461
208461
|
});
|
|
@@ -208692,8 +208692,8 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
208692
208692
|
}
|
|
208693
208693
|
/** @internal */
|
|
208694
208694
|
getScriptInfoOrConfig(uncheckedFileName) {
|
|
208695
|
-
const
|
|
208696
|
-
const info = this.getScriptInfoForNormalizedPath(
|
|
208695
|
+
const path22 = toNormalizedPath(uncheckedFileName);
|
|
208696
|
+
const info = this.getScriptInfoForNormalizedPath(path22);
|
|
208697
208697
|
if (info) return info;
|
|
208698
208698
|
const configProject = this.configuredProjects.get(this.toPath(uncheckedFileName));
|
|
208699
208699
|
return configProject && configProject.getCompilerOptions().configFile;
|
|
@@ -208705,7 +208705,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
208705
208705
|
this.filenameToScriptInfo.entries(),
|
|
208706
208706
|
(entry) => entry[1].deferredDelete ? void 0 : entry
|
|
208707
208707
|
),
|
|
208708
|
-
([
|
|
208708
|
+
([path22, scriptInfo]) => ({ path: path22, fileName: scriptInfo.fileName })
|
|
208709
208709
|
);
|
|
208710
208710
|
this.logger.msg(
|
|
208711
208711
|
`Could not find file ${JSON.stringify(fileName)}.
|
|
@@ -208737,7 +208737,7 @@ All files are: ${JSON.stringify(names)}`,
|
|
|
208737
208737
|
if (!projects) {
|
|
208738
208738
|
projects = createMultiMap();
|
|
208739
208739
|
projects.add(toAddInfo.path, project);
|
|
208740
|
-
} else if (!forEachEntry(projects, (projs,
|
|
208740
|
+
} else if (!forEachEntry(projects, (projs, path22) => path22 === toAddInfo.path ? false : contains(projs, project))) {
|
|
208741
208741
|
projects.add(toAddInfo.path, project);
|
|
208742
208742
|
}
|
|
208743
208743
|
}
|
|
@@ -208899,8 +208899,8 @@ All files are: ${JSON.stringify(names)}`,
|
|
|
208899
208899
|
}
|
|
208900
208900
|
getOrCreateScriptInfoWorker(fileName, currentDirectory, openedByClient, fileContent, scriptKind, hasMixedContent, hostToQueryFileExistsOn, deferredDeleteOk) {
|
|
208901
208901
|
Debug.assert(fileContent === void 0 || openedByClient, "ScriptInfo needs to be opened by client to be able to set its user defined content");
|
|
208902
|
-
const
|
|
208903
|
-
let info = this.filenameToScriptInfo.get(
|
|
208902
|
+
const path22 = normalizedPathToPath(fileName, currentDirectory, this.toCanonicalFileName);
|
|
208903
|
+
let info = this.filenameToScriptInfo.get(path22);
|
|
208904
208904
|
if (!info) {
|
|
208905
208905
|
const isDynamic = isDynamicFileName(fileName);
|
|
208906
208906
|
Debug.assert(isRootedDiskPath(fileName) || isDynamic || openedByClient, "", () => `${JSON.stringify({ fileName, currentDirectory, hostCurrentDirectory: this.currentDirectory, openKeys: arrayFrom(this.openFilesWithNonRootedDiskPath.keys()) })}
|
|
@@ -208912,7 +208912,7 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
208912
208912
|
if (!openedByClient && !isDynamic && !(hostToQueryFileExistsOn || this.host).fileExists(fileName)) {
|
|
208913
208913
|
return;
|
|
208914
208914
|
}
|
|
208915
|
-
info = new ScriptInfo(this.host, fileName, scriptKind, hasMixedContent,
|
|
208915
|
+
info = new ScriptInfo(this.host, fileName, scriptKind, hasMixedContent, path22, this.filenameToScriptInfoVersion.get(path22));
|
|
208916
208916
|
this.filenameToScriptInfo.set(info.path, info);
|
|
208917
208917
|
this.filenameToScriptInfoVersion.delete(info.path);
|
|
208918
208918
|
if (!openedByClient) {
|
|
@@ -209059,9 +209059,9 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
209059
209059
|
getSourceFileLike(fileName, projectNameOrProject, declarationInfo) {
|
|
209060
209060
|
const project = projectNameOrProject.projectName ? projectNameOrProject : this.findProject(projectNameOrProject);
|
|
209061
209061
|
if (project) {
|
|
209062
|
-
const
|
|
209063
|
-
const sourceFile = project.getSourceFile(
|
|
209064
|
-
if (sourceFile && sourceFile.resolvedPath ===
|
|
209062
|
+
const path22 = project.toPath(fileName);
|
|
209063
|
+
const sourceFile = project.getSourceFile(path22);
|
|
209064
|
+
if (sourceFile && sourceFile.resolvedPath === path22) return sourceFile;
|
|
209065
209065
|
}
|
|
209066
209066
|
const info = this.getOrCreateScriptInfoNotOpenedByClient(
|
|
209067
209067
|
fileName,
|
|
@@ -209227,8 +209227,8 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
209227
209227
|
}
|
|
209228
209228
|
});
|
|
209229
209229
|
});
|
|
209230
|
-
this.openFiles.forEach((_projectRootPath,
|
|
209231
|
-
const info = this.getScriptInfoForPath(
|
|
209230
|
+
this.openFiles.forEach((_projectRootPath, path22) => {
|
|
209231
|
+
const info = this.getScriptInfoForPath(path22);
|
|
209232
209232
|
if (find(info.containingProjects, isExternalProject)) return;
|
|
209233
209233
|
this.tryFindDefaultConfiguredProjectAndLoadAncestorsForOpenScriptInfo(
|
|
209234
209234
|
info,
|
|
@@ -209281,14 +209281,14 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
209281
209281
|
const pendingOpenFileProjectUpdates = this.pendingOpenFileProjectUpdates;
|
|
209282
209282
|
this.pendingOpenFileProjectUpdates = void 0;
|
|
209283
209283
|
pendingOpenFileProjectUpdates == null ? void 0 : pendingOpenFileProjectUpdates.forEach(
|
|
209284
|
-
(_config,
|
|
209285
|
-
this.getScriptInfoForPath(
|
|
209284
|
+
(_config, path22) => this.tryFindDefaultConfiguredProjectAndLoadAncestorsForOpenScriptInfo(
|
|
209285
|
+
this.getScriptInfoForPath(path22),
|
|
209286
209286
|
5
|
|
209287
209287
|
/* Create */
|
|
209288
209288
|
)
|
|
209289
209289
|
);
|
|
209290
|
-
this.openFiles.forEach((projectRootPath,
|
|
209291
|
-
const info = this.getScriptInfoForPath(
|
|
209290
|
+
this.openFiles.forEach((projectRootPath, path22) => {
|
|
209291
|
+
const info = this.getScriptInfoForPath(path22);
|
|
209292
209292
|
if (info.isOrphan()) {
|
|
209293
209293
|
this.assignOrphanScriptInfoToInferredProject(info, projectRootPath);
|
|
209294
209294
|
} else {
|
|
@@ -209799,9 +209799,9 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
209799
209799
|
}
|
|
209800
209800
|
});
|
|
209801
209801
|
if (!toRemoveConfiguredProjects.size) return toRemoveConfiguredProjects;
|
|
209802
|
-
forEachEntry(this.openFiles, (_projectRootPath,
|
|
209803
|
-
if (openFilesWithRetainedConfiguredProject == null ? void 0 : openFilesWithRetainedConfiguredProject.has(
|
|
209804
|
-
const info = this.getScriptInfoForPath(
|
|
209802
|
+
forEachEntry(this.openFiles, (_projectRootPath, path22) => {
|
|
209803
|
+
if (openFilesWithRetainedConfiguredProject == null ? void 0 : openFilesWithRetainedConfiguredProject.has(path22)) return;
|
|
209804
|
+
const info = this.getScriptInfoForPath(path22);
|
|
209805
209805
|
if (find(info.containingProjects, isExternalProject)) return;
|
|
209806
209806
|
const result = this.tryFindDefaultConfiguredProjectAndLoadAncestorsForOpenScriptInfo(
|
|
209807
209807
|
info,
|
|
@@ -209850,8 +209850,8 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
209850
209850
|
sourceInfos = info.sourceMapFilePath.sourceInfos;
|
|
209851
209851
|
}
|
|
209852
209852
|
if (!sourceInfos) return;
|
|
209853
|
-
if (!forEachKey(sourceInfos, (
|
|
209854
|
-
const info2 = this.getScriptInfoForPath(
|
|
209853
|
+
if (!forEachKey(sourceInfos, (path22) => {
|
|
209854
|
+
const info2 = this.getScriptInfoForPath(path22);
|
|
209855
209855
|
return !!info2 && (info2.isScriptOpen() || !info2.isOrphan());
|
|
209856
209856
|
})) {
|
|
209857
209857
|
return;
|
|
@@ -209875,7 +209875,7 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
209875
209875
|
sourceInfos = info.sourceMapFilePath.sourceInfos;
|
|
209876
209876
|
}
|
|
209877
209877
|
if (sourceInfos) {
|
|
209878
|
-
sourceInfos.forEach((_value,
|
|
209878
|
+
sourceInfos.forEach((_value, path22) => toRemoveScriptInfos.delete(path22));
|
|
209879
209879
|
}
|
|
209880
209880
|
}
|
|
209881
209881
|
});
|
|
@@ -210358,9 +210358,9 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
210358
210358
|
}
|
|
210359
210359
|
);
|
|
210360
210360
|
}
|
|
210361
|
-
watchPackageJsonFile(file2,
|
|
210361
|
+
watchPackageJsonFile(file2, path22, project) {
|
|
210362
210362
|
Debug.assert(project !== void 0);
|
|
210363
|
-
let result = (this.packageJsonFilesMap ?? (this.packageJsonFilesMap = /* @__PURE__ */ new Map())).get(
|
|
210363
|
+
let result = (this.packageJsonFilesMap ?? (this.packageJsonFilesMap = /* @__PURE__ */ new Map())).get(path22);
|
|
210364
210364
|
if (!result) {
|
|
210365
210365
|
let watcher = this.watchFactory.watchFile(
|
|
210366
210366
|
file2,
|
|
@@ -210368,11 +210368,11 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
210368
210368
|
switch (eventKind) {
|
|
210369
210369
|
case 0:
|
|
210370
210370
|
case 1:
|
|
210371
|
-
this.packageJsonCache.addOrUpdate(fileName,
|
|
210371
|
+
this.packageJsonCache.addOrUpdate(fileName, path22);
|
|
210372
210372
|
this.onPackageJsonChange(result);
|
|
210373
210373
|
break;
|
|
210374
210374
|
case 2:
|
|
210375
|
-
this.packageJsonCache.delete(
|
|
210375
|
+
this.packageJsonCache.delete(path22);
|
|
210376
210376
|
this.onPackageJsonChange(result);
|
|
210377
210377
|
result.projects.clear();
|
|
210378
210378
|
result.close();
|
|
@@ -210389,11 +210389,11 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
210389
210389
|
if (result.projects.size || !watcher) return;
|
|
210390
210390
|
watcher.close();
|
|
210391
210391
|
watcher = void 0;
|
|
210392
|
-
(_a3 = this.packageJsonFilesMap) == null ? void 0 : _a3.delete(
|
|
210393
|
-
this.packageJsonCache.invalidate(
|
|
210392
|
+
(_a3 = this.packageJsonFilesMap) == null ? void 0 : _a3.delete(path22);
|
|
210393
|
+
this.packageJsonCache.invalidate(path22);
|
|
210394
210394
|
}
|
|
210395
210395
|
};
|
|
210396
|
-
this.packageJsonFilesMap.set(
|
|
210396
|
+
this.packageJsonFilesMap.set(path22, result);
|
|
210397
210397
|
}
|
|
210398
210398
|
result.projects.add(project);
|
|
210399
210399
|
(project.packageJsonWatches ?? (project.packageJsonWatches = /* @__PURE__ */ new Set())).add(result);
|
|
@@ -210583,14 +210583,14 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
210583
210583
|
);
|
|
210584
210584
|
}
|
|
210585
210585
|
};
|
|
210586
|
-
function addOrUpdate(fileName,
|
|
210586
|
+
function addOrUpdate(fileName, path22) {
|
|
210587
210587
|
const packageJsonInfo = Debug.checkDefined(createPackageJsonInfo(fileName, host.host));
|
|
210588
|
-
packageJsons.set(
|
|
210589
|
-
directoriesWithoutPackageJson.delete(getDirectoryPath(
|
|
210588
|
+
packageJsons.set(path22, packageJsonInfo);
|
|
210589
|
+
directoriesWithoutPackageJson.delete(getDirectoryPath(path22));
|
|
210590
210590
|
}
|
|
210591
|
-
function invalidate(
|
|
210592
|
-
packageJsons.delete(
|
|
210593
|
-
directoriesWithoutPackageJson.delete(getDirectoryPath(
|
|
210591
|
+
function invalidate(path22) {
|
|
210592
|
+
packageJsons.delete(path22);
|
|
210593
|
+
directoriesWithoutPackageJson.delete(getDirectoryPath(path22));
|
|
210594
210594
|
}
|
|
210595
210595
|
function directoryHasPackageJson(directory) {
|
|
210596
210596
|
return packageJsons.has(combinePaths(directory, "package.json")) ? -1 : directoriesWithoutPackageJson.has(directory) ? 0 : 3;
|
|
@@ -210787,8 +210787,8 @@ ${json2}${newLine}`;
|
|
|
210787
210787
|
function combineProjectOutput(defaultValue, getValue, projects, action) {
|
|
210788
210788
|
const outputs = flatMapToMutable(isArray(projects) ? projects : projects.projects, (project) => action(project, defaultValue));
|
|
210789
210789
|
if (!isArray(projects) && projects.symLinkedProjects) {
|
|
210790
|
-
projects.symLinkedProjects.forEach((projects2,
|
|
210791
|
-
const value = getValue(
|
|
210790
|
+
projects.symLinkedProjects.forEach((projects2, path22) => {
|
|
210791
|
+
const value = getValue(path22);
|
|
210792
210792
|
outputs.push(...flatMap(projects2, (project) => action(project, value)));
|
|
210793
210793
|
});
|
|
210794
210794
|
}
|
|
@@ -210934,9 +210934,9 @@ ${json2}${newLine}`;
|
|
|
210934
210934
|
});
|
|
210935
210935
|
return results.filter((o) => o.references.length !== 0);
|
|
210936
210936
|
}
|
|
210937
|
-
function forEachProjectInProjects(projects,
|
|
210937
|
+
function forEachProjectInProjects(projects, path22, cb) {
|
|
210938
210938
|
for (const project of isArray(projects) ? projects : projects.projects) {
|
|
210939
|
-
cb(project,
|
|
210939
|
+
cb(project, path22);
|
|
210940
210940
|
}
|
|
210941
210941
|
if (!isArray(projects) && projects.symLinkedProjects) {
|
|
210942
210942
|
projects.symLinkedProjects.forEach((symlinkedProjects, symlinkedPath) => {
|
|
@@ -210950,8 +210950,8 @@ ${json2}${newLine}`;
|
|
|
210950
210950
|
const resultsMap = /* @__PURE__ */ new Map();
|
|
210951
210951
|
const queue = createQueue();
|
|
210952
210952
|
queue.enqueue({ project: defaultProject, location: initialLocation });
|
|
210953
|
-
forEachProjectInProjects(projects, initialLocation.fileName, (project,
|
|
210954
|
-
const location = { fileName:
|
|
210953
|
+
forEachProjectInProjects(projects, initialLocation.fileName, (project, path22) => {
|
|
210954
|
+
const location = { fileName: path22, pos: initialLocation.pos };
|
|
210955
210955
|
queue.enqueue({ project, location });
|
|
210956
210956
|
});
|
|
210957
210957
|
const projectService = defaultProject.projectService;
|
|
@@ -212793,8 +212793,8 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
212793
212793
|
nodeModulesPathParts.packageRootIndex
|
|
212794
212794
|
);
|
|
212795
212795
|
const packageName = getPackageNameFromTypesPackageName(unmangleScopedPackageName(packageNamePathPart));
|
|
212796
|
-
const
|
|
212797
|
-
if (entrypoints && some(entrypoints, (e) => project.toPath(e) ===
|
|
212796
|
+
const path22 = project.toPath(fileName);
|
|
212797
|
+
if (entrypoints && some(entrypoints, (e) => project.toPath(e) === path22)) {
|
|
212798
212798
|
return (_b = auxiliaryProject.resolutionCache.resolveSingleModuleNameWithoutWatching(packageName, resolveFromFile).resolvedModule) == null ? void 0 : _b.resolvedFileName;
|
|
212799
212799
|
} else {
|
|
212800
212800
|
const pathToFileInPackage = fileName.substring(nodeModulesPathParts.packageRootIndex + 1);
|
|
@@ -213574,7 +213574,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
213574
213574
|
}
|
|
213575
213575
|
return combineProjectOutput(
|
|
213576
213576
|
info,
|
|
213577
|
-
(
|
|
213577
|
+
(path22) => this.projectService.getScriptInfoForPath(path22),
|
|
213578
213578
|
projects,
|
|
213579
213579
|
(project, info2) => {
|
|
213580
213580
|
if (!project.compileOnSaveEnabled || !project.languageServiceEnabled || project.isOrphan()) {
|
|
@@ -213601,7 +213601,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
213601
213601
|
return args.richResponse ? { emitSkipped: true, diagnostics: [] } : false;
|
|
213602
213602
|
}
|
|
213603
213603
|
const scriptInfo = project.getScriptInfo(file2);
|
|
213604
|
-
const { emitSkipped, diagnostics } = project.emitFile(scriptInfo, (
|
|
213604
|
+
const { emitSkipped, diagnostics } = project.emitFile(scriptInfo, (path22, data, writeByteOrderMark) => this.host.writeFile(path22, data, writeByteOrderMark));
|
|
213605
213605
|
return args.richResponse ? {
|
|
213606
213606
|
emitSkipped,
|
|
213607
213607
|
diagnostics: args.includeLinePosition ? this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(diagnostics) : diagnostics.map((d) => formatDiagnosticToProtocol(
|
|
@@ -215671,7 +215671,7 @@ ${error51.message}`;
|
|
|
215671
215671
|
return typescript.sys.fileExists(fileName);
|
|
215672
215672
|
});
|
|
215673
215673
|
if (filePath !== void 0) {
|
|
215674
|
-
const { config: config2, error: error51 } = typescript.readConfigFile(filePath, (
|
|
215674
|
+
const { config: config2, error: error51 } = typescript.readConfigFile(filePath, (path22) => typescript.sys.readFile(path22));
|
|
215675
215675
|
if (error51) {
|
|
215676
215676
|
throw new Error(`Error in ${filePath}: ${error51.messageText.toString()}`);
|
|
215677
215677
|
}
|
|
@@ -215794,42 +215794,42 @@ var require_defaults = __commonJS({
|
|
|
215794
215794
|
var require_env_paths = __commonJS({
|
|
215795
215795
|
"node_modules/.pnpm/env-paths@2.2.1/node_modules/env-paths/index.js"(exports2, module2) {
|
|
215796
215796
|
"use strict";
|
|
215797
|
-
var
|
|
215797
|
+
var path22 = require("path");
|
|
215798
215798
|
var os7 = require("os");
|
|
215799
215799
|
var homedir = os7.homedir();
|
|
215800
215800
|
var tmpdir = os7.tmpdir();
|
|
215801
215801
|
var { env } = process;
|
|
215802
215802
|
var macos = (name) => {
|
|
215803
|
-
const library =
|
|
215803
|
+
const library = path22.join(homedir, "Library");
|
|
215804
215804
|
return {
|
|
215805
|
-
data:
|
|
215806
|
-
config:
|
|
215807
|
-
cache:
|
|
215808
|
-
log:
|
|
215809
|
-
temp:
|
|
215805
|
+
data: path22.join(library, "Application Support", name),
|
|
215806
|
+
config: path22.join(library, "Preferences", name),
|
|
215807
|
+
cache: path22.join(library, "Caches", name),
|
|
215808
|
+
log: path22.join(library, "Logs", name),
|
|
215809
|
+
temp: path22.join(tmpdir, name)
|
|
215810
215810
|
};
|
|
215811
215811
|
};
|
|
215812
215812
|
var windows = (name) => {
|
|
215813
|
-
const appData = env.APPDATA ||
|
|
215814
|
-
const localAppData = env.LOCALAPPDATA ||
|
|
215813
|
+
const appData = env.APPDATA || path22.join(homedir, "AppData", "Roaming");
|
|
215814
|
+
const localAppData = env.LOCALAPPDATA || path22.join(homedir, "AppData", "Local");
|
|
215815
215815
|
return {
|
|
215816
215816
|
// Data/config/cache/log are invented by me as Windows isn't opinionated about this
|
|
215817
|
-
data:
|
|
215818
|
-
config:
|
|
215819
|
-
cache:
|
|
215820
|
-
log:
|
|
215821
|
-
temp:
|
|
215817
|
+
data: path22.join(localAppData, name, "Data"),
|
|
215818
|
+
config: path22.join(appData, name, "Config"),
|
|
215819
|
+
cache: path22.join(localAppData, name, "Cache"),
|
|
215820
|
+
log: path22.join(localAppData, name, "Log"),
|
|
215821
|
+
temp: path22.join(tmpdir, name)
|
|
215822
215822
|
};
|
|
215823
215823
|
};
|
|
215824
215824
|
var linux = (name) => {
|
|
215825
|
-
const username =
|
|
215825
|
+
const username = path22.basename(homedir);
|
|
215826
215826
|
return {
|
|
215827
|
-
data:
|
|
215828
|
-
config:
|
|
215829
|
-
cache:
|
|
215827
|
+
data: path22.join(env.XDG_DATA_HOME || path22.join(homedir, ".local", "share"), name),
|
|
215828
|
+
config: path22.join(env.XDG_CONFIG_HOME || path22.join(homedir, ".config"), name),
|
|
215829
|
+
cache: path22.join(env.XDG_CACHE_HOME || path22.join(homedir, ".cache"), name),
|
|
215830
215830
|
// https://wiki.debian.org/XDGBaseDirectorySpecification#state
|
|
215831
|
-
log:
|
|
215832
|
-
temp:
|
|
215831
|
+
log: path22.join(env.XDG_STATE_HOME || path22.join(homedir, ".local", "state"), name),
|
|
215832
|
+
temp: path22.join(tmpdir, username, name)
|
|
215833
215833
|
};
|
|
215834
215834
|
};
|
|
215835
215835
|
var envPaths = (name, options) => {
|
|
@@ -215910,11 +215910,11 @@ var require_util = __commonJS({
|
|
|
215910
215910
|
map2.set(key, result);
|
|
215911
215911
|
return result;
|
|
215912
215912
|
}
|
|
215913
|
-
function getPropertyByPath(source,
|
|
215914
|
-
if (typeof
|
|
215915
|
-
return source[
|
|
215913
|
+
function getPropertyByPath(source, path22) {
|
|
215914
|
+
if (typeof path22 === "string" && Object.prototype.hasOwnProperty.call(source, path22)) {
|
|
215915
|
+
return source[path22];
|
|
215916
215916
|
}
|
|
215917
|
-
const parsedPath = typeof
|
|
215917
|
+
const parsedPath = typeof path22 === "string" ? path22.split(".") : path22;
|
|
215918
215918
|
return parsedPath.reduce((previous, key) => {
|
|
215919
215919
|
if (previous === void 0) {
|
|
215920
215920
|
return previous;
|
|
@@ -215925,9 +215925,9 @@ var require_util = __commonJS({
|
|
|
215925
215925
|
function removeUndefinedValuesFromObject(options) {
|
|
215926
215926
|
return Object.fromEntries(Object.entries(options).filter(([, value]) => value !== void 0));
|
|
215927
215927
|
}
|
|
215928
|
-
async function isDirectory(
|
|
215928
|
+
async function isDirectory(path22) {
|
|
215929
215929
|
try {
|
|
215930
|
-
const stat = await fs_1.promises.stat(
|
|
215930
|
+
const stat = await fs_1.promises.stat(path22);
|
|
215931
215931
|
return stat.isDirectory();
|
|
215932
215932
|
} catch (e) {
|
|
215933
215933
|
if (e.code === "ENOENT") {
|
|
@@ -215936,9 +215936,9 @@ var require_util = __commonJS({
|
|
|
215936
215936
|
throw e;
|
|
215937
215937
|
}
|
|
215938
215938
|
}
|
|
215939
|
-
function isDirectorySync(
|
|
215939
|
+
function isDirectorySync(path22) {
|
|
215940
215940
|
try {
|
|
215941
|
-
const stat = fs_1.default.statSync(
|
|
215941
|
+
const stat = fs_1.default.statSync(path22);
|
|
215942
215942
|
return stat.isDirectory();
|
|
215943
215943
|
} catch (e) {
|
|
215944
215944
|
if (e.code === "ENOENT") {
|
|
@@ -216036,7 +216036,7 @@ var require_ExplorerBase = __commonJS({
|
|
|
216036
216036
|
const idx = importStack.indexOf(fullPath);
|
|
216037
216037
|
if (idx !== -1) {
|
|
216038
216038
|
throw new Error(`Circular import detected:
|
|
216039
|
-
${[...importStack, fullPath].map((
|
|
216039
|
+
${[...importStack, fullPath].map((path22, i2) => `${i2 + 1}. ${path22}`).join("\n")} (same as ${idx + 1}.)`);
|
|
216040
216040
|
}
|
|
216041
216041
|
}
|
|
216042
216042
|
}
|
|
@@ -216223,9 +216223,9 @@ var require_Explorer = __commonJS({
|
|
|
216223
216223
|
throw error51;
|
|
216224
216224
|
}
|
|
216225
216225
|
}
|
|
216226
|
-
async #fileExists(
|
|
216226
|
+
async #fileExists(path22) {
|
|
216227
216227
|
try {
|
|
216228
|
-
await promises_1.default.stat(
|
|
216228
|
+
await promises_1.default.stat(path22);
|
|
216229
216229
|
return true;
|
|
216230
216230
|
} catch (e) {
|
|
216231
216231
|
return false;
|
|
@@ -216385,9 +216385,9 @@ var require_ExplorerSync = __commonJS({
|
|
|
216385
216385
|
throw error51;
|
|
216386
216386
|
}
|
|
216387
216387
|
}
|
|
216388
|
-
#fileExists(
|
|
216388
|
+
#fileExists(path22) {
|
|
216389
216389
|
try {
|
|
216390
|
-
fs_1.default.statSync(
|
|
216390
|
+
fs_1.default.statSync(path22);
|
|
216391
216391
|
return true;
|
|
216392
216392
|
} catch (e) {
|
|
216393
216393
|
return false;
|
|
@@ -216513,7 +216513,7 @@ var require_dist = __commonJS({
|
|
|
216513
216513
|
};
|
|
216514
216514
|
}
|
|
216515
216515
|
function getResolvedSearchPlaces(moduleName, toolDefinedSearchPlaces, userConfiguredOptions) {
|
|
216516
|
-
const userConfiguredSearchPlaces = userConfiguredOptions.searchPlaces?.map((
|
|
216516
|
+
const userConfiguredSearchPlaces = userConfiguredOptions.searchPlaces?.map((path22) => path22.replace("{name}", moduleName));
|
|
216517
216517
|
if (userConfiguredOptions.mergeSearchPlaces) {
|
|
216518
216518
|
return [...userConfiguredSearchPlaces ?? [], ...toolDefinedSearchPlaces];
|
|
216519
216519
|
}
|
|
@@ -216863,8 +216863,8 @@ var require_utils = __commonJS({
|
|
|
216863
216863
|
}
|
|
216864
216864
|
return output;
|
|
216865
216865
|
};
|
|
216866
|
-
exports2.basename = (
|
|
216867
|
-
const segs =
|
|
216866
|
+
exports2.basename = (path22, { windows } = {}) => {
|
|
216867
|
+
const segs = path22.split(windows ? /[\\/]/ : "/");
|
|
216868
216868
|
const last = segs[segs.length - 1];
|
|
216869
216869
|
if (last === "") {
|
|
216870
216870
|
return segs[segs.length - 2];
|
|
@@ -218433,7 +218433,7 @@ var require_src = __commonJS({
|
|
|
218433
218433
|
|
|
218434
218434
|
// src/cli.ts
|
|
218435
218435
|
var import_node_os6 = __toESM(require("node:os"), 1);
|
|
218436
|
-
var
|
|
218436
|
+
var import_node_path21 = __toESM(require("node:path"), 1);
|
|
218437
218437
|
var import_node_crypto4 = require("node:crypto");
|
|
218438
218438
|
|
|
218439
218439
|
// node_modules/.pnpm/commander@15.0.0/node_modules/commander/lib/error.js
|
|
@@ -221547,9 +221547,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
221547
221547
|
* @param {string} [path]
|
|
221548
221548
|
* @return {(string|null|Command)}
|
|
221549
221549
|
*/
|
|
221550
|
-
executableDir(
|
|
221551
|
-
if (
|
|
221552
|
-
this._executableDir =
|
|
221550
|
+
executableDir(path22) {
|
|
221551
|
+
if (path22 === void 0) return this._executableDir;
|
|
221552
|
+
this._executableDir = path22;
|
|
221553
221553
|
return this;
|
|
221554
221554
|
}
|
|
221555
221555
|
/**
|
|
@@ -221857,7 +221857,7 @@ var categories_default_default = {
|
|
|
221857
221857
|
// package.json
|
|
221858
221858
|
var package_default = {
|
|
221859
221859
|
name: "claude-use",
|
|
221860
|
-
version: "0.
|
|
221860
|
+
version: "0.6.0",
|
|
221861
221861
|
description: "A profile manager and launcher for Claude Code that lets one person run multiple logins from one machine while controlling what gets shared between them.",
|
|
221862
221862
|
license: "Apache-2.0",
|
|
221863
221863
|
author: "Joseph Mearman <joseph@mearman.co.uk>",
|
|
@@ -222775,10 +222775,10 @@ function mergeDefs(...defs) {
|
|
|
222775
222775
|
function cloneDef(schema) {
|
|
222776
222776
|
return mergeDefs(schema._zod.def);
|
|
222777
222777
|
}
|
|
222778
|
-
function getElementAtPath(obj,
|
|
222779
|
-
if (!
|
|
222778
|
+
function getElementAtPath(obj, path22) {
|
|
222779
|
+
if (!path22)
|
|
222780
222780
|
return obj;
|
|
222781
|
-
return
|
|
222781
|
+
return path22.reduce((acc, key) => acc?.[key], obj);
|
|
222782
222782
|
}
|
|
222783
222783
|
function promiseAllObject(promisesObj) {
|
|
222784
222784
|
const keys = Object.keys(promisesObj);
|
|
@@ -223187,11 +223187,11 @@ function explicitlyAborted(x, startIndex = 0) {
|
|
|
223187
223187
|
}
|
|
223188
223188
|
return false;
|
|
223189
223189
|
}
|
|
223190
|
-
function prefixIssues(
|
|
223190
|
+
function prefixIssues(path22, issues) {
|
|
223191
223191
|
return issues.map((iss) => {
|
|
223192
223192
|
var _a3;
|
|
223193
223193
|
(_a3 = iss).path ?? (_a3.path = []);
|
|
223194
|
-
iss.path.unshift(
|
|
223194
|
+
iss.path.unshift(path22);
|
|
223195
223195
|
return iss;
|
|
223196
223196
|
});
|
|
223197
223197
|
}
|
|
@@ -223338,16 +223338,16 @@ function flattenError(error51, mapper = (issue2) => issue2.message) {
|
|
|
223338
223338
|
}
|
|
223339
223339
|
function formatError(error51, mapper = (issue2) => issue2.message) {
|
|
223340
223340
|
const fieldErrors = { _errors: [] };
|
|
223341
|
-
const processError = (error52,
|
|
223341
|
+
const processError = (error52, path22 = []) => {
|
|
223342
223342
|
for (const issue2 of error52.issues) {
|
|
223343
223343
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
223344
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
223344
|
+
issue2.errors.map((issues) => processError({ issues }, [...path22, ...issue2.path]));
|
|
223345
223345
|
} else if (issue2.code === "invalid_key") {
|
|
223346
|
-
processError({ issues: issue2.issues }, [...
|
|
223346
|
+
processError({ issues: issue2.issues }, [...path22, ...issue2.path]);
|
|
223347
223347
|
} else if (issue2.code === "invalid_element") {
|
|
223348
|
-
processError({ issues: issue2.issues }, [...
|
|
223348
|
+
processError({ issues: issue2.issues }, [...path22, ...issue2.path]);
|
|
223349
223349
|
} else {
|
|
223350
|
-
const fullpath = [...
|
|
223350
|
+
const fullpath = [...path22, ...issue2.path];
|
|
223351
223351
|
if (fullpath.length === 0) {
|
|
223352
223352
|
fieldErrors._errors.push(mapper(issue2));
|
|
223353
223353
|
} else {
|
|
@@ -223374,17 +223374,17 @@ function formatError(error51, mapper = (issue2) => issue2.message) {
|
|
|
223374
223374
|
}
|
|
223375
223375
|
function treeifyError(error51, mapper = (issue2) => issue2.message) {
|
|
223376
223376
|
const result = { errors: [] };
|
|
223377
|
-
const processError = (error52,
|
|
223377
|
+
const processError = (error52, path22 = []) => {
|
|
223378
223378
|
var _a3, _b;
|
|
223379
223379
|
for (const issue2 of error52.issues) {
|
|
223380
223380
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
223381
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
223381
|
+
issue2.errors.map((issues) => processError({ issues }, [...path22, ...issue2.path]));
|
|
223382
223382
|
} else if (issue2.code === "invalid_key") {
|
|
223383
|
-
processError({ issues: issue2.issues }, [...
|
|
223383
|
+
processError({ issues: issue2.issues }, [...path22, ...issue2.path]);
|
|
223384
223384
|
} else if (issue2.code === "invalid_element") {
|
|
223385
|
-
processError({ issues: issue2.issues }, [...
|
|
223385
|
+
processError({ issues: issue2.issues }, [...path22, ...issue2.path]);
|
|
223386
223386
|
} else {
|
|
223387
|
-
const fullpath = [...
|
|
223387
|
+
const fullpath = [...path22, ...issue2.path];
|
|
223388
223388
|
if (fullpath.length === 0) {
|
|
223389
223389
|
result.errors.push(mapper(issue2));
|
|
223390
223390
|
continue;
|
|
@@ -223416,8 +223416,8 @@ function treeifyError(error51, mapper = (issue2) => issue2.message) {
|
|
|
223416
223416
|
}
|
|
223417
223417
|
function toDotPath(_path) {
|
|
223418
223418
|
const segs = [];
|
|
223419
|
-
const
|
|
223420
|
-
for (const seg of
|
|
223419
|
+
const path22 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
223420
|
+
for (const seg of path22) {
|
|
223421
223421
|
if (typeof seg === "number")
|
|
223422
223422
|
segs.push(`[${seg}]`);
|
|
223423
223423
|
else if (typeof seg === "symbol")
|
|
@@ -236109,13 +236109,13 @@ function resolveRef(ref, ctx) {
|
|
|
236109
236109
|
if (!ref.startsWith("#")) {
|
|
236110
236110
|
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
236111
236111
|
}
|
|
236112
|
-
const
|
|
236113
|
-
if (
|
|
236112
|
+
const path22 = ref.slice(1).split("/").filter(Boolean);
|
|
236113
|
+
if (path22.length === 0) {
|
|
236114
236114
|
return ctx.rootSchema;
|
|
236115
236115
|
}
|
|
236116
236116
|
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
236117
|
-
if (
|
|
236118
|
-
const key =
|
|
236117
|
+
if (path22[0] === defsKey) {
|
|
236118
|
+
const key = path22[1];
|
|
236119
236119
|
if (!key || !ctx.defs[key]) {
|
|
236120
236120
|
throw new Error(`Reference not found: ${ref}`);
|
|
236121
236121
|
}
|
|
@@ -238311,7 +238311,7 @@ function resyncFarm(params) {
|
|
|
238311
238311
|
...resolved.diagnostics,
|
|
238312
238312
|
...reconciliation.diagnostics,
|
|
238313
238313
|
...outcome.diagnostics,
|
|
238314
|
-
...recoveryDiagnostics(recovery)
|
|
238314
|
+
...recoveryDiagnostics(recovery, params.identity)
|
|
238315
238315
|
];
|
|
238316
238316
|
const farmExists = params.fs.lstat(farmRoot) !== void 0;
|
|
238317
238317
|
const nothingAdopted = outcome.adopted.length === 0 && outcome.conflicts.length === 0;
|
|
@@ -238334,7 +238334,7 @@ function resyncFarm(params) {
|
|
|
238334
238334
|
diagnostics.push({
|
|
238335
238335
|
code: "FARM_PREVIOUS_RETAINED",
|
|
238336
238336
|
severity: "warning",
|
|
238337
|
-
message: `The superseded farm was left at ${swap.retainedPrevious} because it still holds ${swap.collided.join(", ")}, which the new farm has its own entry for. Nothing was overwritten in either direction;
|
|
238337
|
+
message: `The superseded farm was left at ${swap.retainedPrevious} because it still holds ${swap.collided.join(", ")}, which the new farm has its own entry for. Nothing was overwritten in either direction; run \`claude-use identity resolve ${params.identity}\` to resolve it interactively.`,
|
|
238338
238338
|
subject: swap.retainedPrevious
|
|
238339
238339
|
});
|
|
238340
238340
|
}
|
|
@@ -238352,7 +238352,7 @@ function resyncFarm(params) {
|
|
|
238352
238352
|
lock.release();
|
|
238353
238353
|
}
|
|
238354
238354
|
}
|
|
238355
|
-
function recoveryDiagnostics(recovery) {
|
|
238355
|
+
function recoveryDiagnostics(recovery, identity) {
|
|
238356
238356
|
if (!recovery.recovered) {
|
|
238357
238357
|
return [];
|
|
238358
238358
|
}
|
|
@@ -238367,7 +238367,9 @@ function recoveryDiagnostics(recovery) {
|
|
|
238367
238367
|
parts.push(`finished carrying local state out of ${recovery.completed.length} superseded farm(s)`);
|
|
238368
238368
|
}
|
|
238369
238369
|
if (recovery.retained.length > 0) {
|
|
238370
|
-
parts.push(
|
|
238370
|
+
parts.push(
|
|
238371
|
+
`kept ${recovery.retained.join(", ")}, which still holds data the current farm also has an entry for \u2014 run \`claude-use identity resolve ${identity}\` to resolve it interactively`
|
|
238372
|
+
);
|
|
238371
238373
|
}
|
|
238372
238374
|
return [
|
|
238373
238375
|
{
|
|
@@ -239110,7 +239112,7 @@ function registerCheckCommand(program2, paths) {
|
|
|
239110
239112
|
// src/configure.ts
|
|
239111
239113
|
var import_node_fs6 = __toESM(require("node:fs"), 1);
|
|
239112
239114
|
var import_node_os4 = __toESM(require("node:os"), 1);
|
|
239113
|
-
var
|
|
239115
|
+
var import_node_path17 = __toESM(require("node:path"), 1);
|
|
239114
239116
|
|
|
239115
239117
|
// node_modules/.pnpm/@clack+core@1.4.3/node_modules/@clack/core/dist/index.mjs
|
|
239116
239118
|
var import_node_process2 = require("node:process");
|
|
@@ -240155,7 +240157,45 @@ var i = `${(0, import_node_util3.styleText)("gray", S_BAR)} `;
|
|
|
240155
240157
|
|
|
240156
240158
|
// src/identityManager.ts
|
|
240157
240159
|
var import_node_fs4 = __toESM(require("node:fs"), 1);
|
|
240160
|
+
var import_node_path15 = __toESM(require("node:path"), 1);
|
|
240161
|
+
|
|
240162
|
+
// src/launcher/farmResolve.ts
|
|
240158
240163
|
var import_node_path14 = __toESM(require("node:path"), 1);
|
|
240164
|
+
async function resolveFarmConflicts(params) {
|
|
240165
|
+
const farmRoot = import_node_path14.default.join(params.identitiesDir, params.identity);
|
|
240166
|
+
const previousPrefix = `.${params.identity}.previous.`;
|
|
240167
|
+
const previousRoots = [...params.fs.readdir(params.identitiesDir)].filter((name) => name.startsWith(previousPrefix)).sort().map((name) => import_node_path14.default.join(params.identitiesDir, name));
|
|
240168
|
+
const resolved = [];
|
|
240169
|
+
const removed = [];
|
|
240170
|
+
const retained = [];
|
|
240171
|
+
for (const previousRoot of previousRoots) {
|
|
240172
|
+
const { collided } = carryOver({ fs: params.fs, previousRoot, farmRoot });
|
|
240173
|
+
let anySkipped = false;
|
|
240174
|
+
for (const name of collided) {
|
|
240175
|
+
const choice = await params.decide({ previousRoot, farmRoot, name });
|
|
240176
|
+
resolved.push({ previousRoot, farmRoot, name, choice });
|
|
240177
|
+
if (choice === "skip") {
|
|
240178
|
+
anySkipped = true;
|
|
240179
|
+
continue;
|
|
240180
|
+
}
|
|
240181
|
+
if (choice === "keep-new") {
|
|
240182
|
+
params.fs.removeRecursive(import_node_path14.default.join(previousRoot, name));
|
|
240183
|
+
continue;
|
|
240184
|
+
}
|
|
240185
|
+
params.fs.removeRecursive(import_node_path14.default.join(farmRoot, name));
|
|
240186
|
+
params.fs.rename(import_node_path14.default.join(previousRoot, name), import_node_path14.default.join(farmRoot, name));
|
|
240187
|
+
}
|
|
240188
|
+
if (anySkipped) {
|
|
240189
|
+
retained.push(previousRoot);
|
|
240190
|
+
} else {
|
|
240191
|
+
params.fs.removeRecursive(previousRoot);
|
|
240192
|
+
removed.push(previousRoot);
|
|
240193
|
+
}
|
|
240194
|
+
}
|
|
240195
|
+
return { resolved, removed, retained };
|
|
240196
|
+
}
|
|
240197
|
+
|
|
240198
|
+
// src/identityManager.ts
|
|
240159
240199
|
var IdentityNotFoundError = class extends Error {
|
|
240160
240200
|
constructor(name) {
|
|
240161
240201
|
super(`No identity named "${name}" \u2014 run \`claude-use identity add ${name}\` first.`);
|
|
@@ -240173,7 +240213,7 @@ var IdentityAlreadyExistsError = class extends Error {
|
|
|
240173
240213
|
identityName;
|
|
240174
240214
|
};
|
|
240175
240215
|
function identityJsonPath(paths, name) {
|
|
240176
|
-
return
|
|
240216
|
+
return import_node_path15.default.join(paths.identitiesDir, name, "identity.json");
|
|
240177
240217
|
}
|
|
240178
240218
|
function identityExists(paths, name) {
|
|
240179
240219
|
return import_node_fs4.default.existsSync(identityJsonPath(paths, name));
|
|
@@ -240196,6 +240236,19 @@ function useIdentity(paths, name) {
|
|
|
240196
240236
|
writeTextAtomic(paths.activeIdentityFile, `${name}
|
|
240197
240237
|
`);
|
|
240198
240238
|
}
|
|
240239
|
+
function tryRunAtIdentityShortcut(paths, argv) {
|
|
240240
|
+
if (argv.length !== 1) {
|
|
240241
|
+
return false;
|
|
240242
|
+
}
|
|
240243
|
+
const [token] = argv;
|
|
240244
|
+
if (token === void 0 || !token.startsWith("@") || token.length === 1) {
|
|
240245
|
+
return false;
|
|
240246
|
+
}
|
|
240247
|
+
const name = token.slice(1);
|
|
240248
|
+
useIdentity(paths, name);
|
|
240249
|
+
console.log(`Active identity is now "${name}".`);
|
|
240250
|
+
return true;
|
|
240251
|
+
}
|
|
240199
240252
|
function readActiveIdentity(paths) {
|
|
240200
240253
|
if (!import_node_fs4.default.existsSync(paths.activeIdentityFile)) {
|
|
240201
240254
|
return void 0;
|
|
@@ -240244,6 +240297,34 @@ function registerIdentityCommand(program2, paths) {
|
|
|
240244
240297
|
useIdentity(paths, name);
|
|
240245
240298
|
console.log(`Active identity is now "${name}".`);
|
|
240246
240299
|
});
|
|
240300
|
+
identity.command("resolve <name>").description("Interactively resolve a superseded farm's colliding data left behind by a prior launch.").action(async (name) => {
|
|
240301
|
+
const result = await resolveFarmConflicts({
|
|
240302
|
+
fs: realFarmFs,
|
|
240303
|
+
identitiesDir: paths.identitiesDir,
|
|
240304
|
+
identity: name,
|
|
240305
|
+
decide: async (conflict) => {
|
|
240306
|
+
const choice = await realPromptsPort.select({
|
|
240307
|
+
message: `"${conflict.name}" exists both in the superseded farm (${conflict.previousRoot}) and the current one (${conflict.farmRoot}). Which should be kept?`,
|
|
240308
|
+
options: [
|
|
240309
|
+
{ value: "keep-new", label: "Keep the current farm's copy", hint: "discards the superseded one" },
|
|
240310
|
+
{ value: "keep-old", label: "Keep the superseded farm's copy", hint: "replaces the current one" },
|
|
240311
|
+
{ value: "skip", label: "Skip for now", hint: "leaves both copies, asks again next time" }
|
|
240312
|
+
]
|
|
240313
|
+
});
|
|
240314
|
+
return realPromptsPort.isCancel(choice) ? "skip" : choice;
|
|
240315
|
+
}
|
|
240316
|
+
});
|
|
240317
|
+
if (result.resolved.length === 0) {
|
|
240318
|
+
console.log(`No superseded farm data to resolve for identity "${name}".`);
|
|
240319
|
+
return;
|
|
240320
|
+
}
|
|
240321
|
+
for (const conflict of result.resolved) {
|
|
240322
|
+
console.log(` ${conflict.name}: ${conflict.choice}`);
|
|
240323
|
+
}
|
|
240324
|
+
console.log(
|
|
240325
|
+
`Resolved ${result.resolved.length} conflict(s) \u2014 ${result.removed.length} superseded director(ies) fully cleared, ${result.retained.length} still retained pending a skipped conflict.`
|
|
240326
|
+
);
|
|
240327
|
+
});
|
|
240247
240328
|
identity.command("list").description("List every identity, marking the active one.").action(() => {
|
|
240248
240329
|
const entries = listIdentities(paths);
|
|
240249
240330
|
if (entries.length === 0) {
|
|
@@ -240275,7 +240356,7 @@ function registerIdentityCommand(program2, paths) {
|
|
|
240275
240356
|
|
|
240276
240357
|
// src/configProfiles.ts
|
|
240277
240358
|
var import_node_fs5 = __toESM(require("node:fs"), 1);
|
|
240278
|
-
var
|
|
240359
|
+
var import_node_path16 = __toESM(require("node:path"), 1);
|
|
240279
240360
|
|
|
240280
240361
|
// src/cli/parsers.ts
|
|
240281
240362
|
function splitTopLevelCommas(input) {
|
|
@@ -240343,7 +240424,7 @@ var InvalidCategoryNameError = class extends Error {
|
|
|
240343
240424
|
categoryName;
|
|
240344
240425
|
};
|
|
240345
240426
|
function profileJsonPath(paths, name) {
|
|
240346
|
-
return
|
|
240427
|
+
return import_node_path16.default.join(paths.configProfilesDir, `${name}.json`);
|
|
240347
240428
|
}
|
|
240348
240429
|
function profileExists(paths, name) {
|
|
240349
240430
|
return import_node_fs5.default.existsSync(profileJsonPath(paths, name));
|
|
@@ -240601,7 +240682,7 @@ function chooseWriteTarget(params) {
|
|
|
240601
240682
|
for (let index = params.levels.length - 1; index >= 0; index -= 1) {
|
|
240602
240683
|
const level = params.levels[index];
|
|
240603
240684
|
if (level !== void 0 && (level.hasPortable || level.hasPortableLocal)) {
|
|
240604
|
-
return { tier: "portable-local", localConfigPath:
|
|
240685
|
+
return { tier: "portable-local", localConfigPath: import_node_path17.default.join(level.dir, PORTABLE_LOCAL_CONFIG_FILENAME) };
|
|
240605
240686
|
}
|
|
240606
240687
|
}
|
|
240607
240688
|
const normalisedCwd = normaliseRulePath(params.cwd, params.home);
|
|
@@ -240693,8 +240774,8 @@ function buildWriteTargetLevels(cwd, home, walkUpLimit) {
|
|
|
240693
240774
|
const dirs = walkDirectoryAncestors(cwd, { home, ...limit === void 0 ? {} : { limit } });
|
|
240694
240775
|
return dirs.map((dir) => ({
|
|
240695
240776
|
dir,
|
|
240696
|
-
hasPortable: import_node_fs6.default.existsSync(
|
|
240697
|
-
hasPortableLocal: import_node_fs6.default.existsSync(
|
|
240777
|
+
hasPortable: import_node_fs6.default.existsSync(import_node_path17.default.join(dir, PORTABLE_CONFIG_FILENAME)),
|
|
240778
|
+
hasPortableLocal: import_node_fs6.default.existsSync(import_node_path17.default.join(dir, PORTABLE_LOCAL_CONFIG_FILENAME))
|
|
240698
240779
|
}));
|
|
240699
240780
|
}
|
|
240700
240781
|
function resolveWriteTarget(context) {
|
|
@@ -240951,7 +241032,7 @@ function registerConfigureCommand(program2, paths) {
|
|
|
240951
241032
|
|
|
240952
241033
|
// src/claudeShim.ts
|
|
240953
241034
|
var import_node_fs7 = __toESM(require("node:fs"), 1);
|
|
240954
|
-
var
|
|
241035
|
+
var import_node_path18 = __toESM(require("node:path"), 1);
|
|
240955
241036
|
var ClaudeShimStateSchema = external_exports.strictObject({
|
|
240956
241037
|
targetPath: external_exports.string().min(1),
|
|
240957
241038
|
method: external_exports.enum(["hardlink", "copy"]),
|
|
@@ -240986,15 +241067,15 @@ function isInvokedAsClaude(invokedName) {
|
|
|
240986
241067
|
return invokedName === "claude" || invokedName.toLowerCase() === "claude.exe";
|
|
240987
241068
|
}
|
|
240988
241069
|
function resolveOwnInstallDirs(paths, ownExecutablePath) {
|
|
240989
|
-
const dirs = [
|
|
241070
|
+
const dirs = [import_node_path18.default.dirname(ownExecutablePath)];
|
|
240990
241071
|
const state = readJson(paths.claudeShimFile, ClaudeShimStateSchema);
|
|
240991
241072
|
if (state !== void 0) {
|
|
240992
|
-
dirs.push(
|
|
241073
|
+
dirs.push(import_node_path18.default.dirname(state.targetPath));
|
|
240993
241074
|
}
|
|
240994
241075
|
return dirs;
|
|
240995
241076
|
}
|
|
240996
241077
|
function resolveClaudeTargetPath(ownExecutablePath, dir) {
|
|
240997
|
-
return
|
|
241078
|
+
return import_node_path18.default.join(dir ?? import_node_path18.default.dirname(ownExecutablePath), claudeTargetFilename(ownExecutablePath));
|
|
240998
241079
|
}
|
|
240999
241080
|
function isEnoent3(error51) {
|
|
241000
241081
|
return typeof error51 === "object" && error51 !== null && "code" in error51 && error51.code === "ENOENT";
|
|
@@ -241019,13 +241100,13 @@ function enableClaudeShim(params, linkFs = nodeLinkFs) {
|
|
|
241019
241100
|
throw new UnsupportedShimSourceError(realContentPath);
|
|
241020
241101
|
}
|
|
241021
241102
|
const targetPath = resolveClaudeTargetPath(params.ownExecutablePath, params.dir);
|
|
241022
|
-
import_node_fs7.default.mkdirSync(
|
|
241103
|
+
import_node_fs7.default.mkdirSync(import_node_path18.default.dirname(targetPath), { recursive: true });
|
|
241023
241104
|
const existing = lstatOrUndefined(targetPath);
|
|
241024
241105
|
if (existing !== void 0) {
|
|
241025
241106
|
const ownStat = import_node_fs7.default.statSync(realContentPath);
|
|
241026
241107
|
const state = readJson(params.paths.claudeShimFile, ClaudeShimStateSchema);
|
|
241027
241108
|
const sameInode = existing.dev === ownStat.dev && existing.ino === ownStat.ino;
|
|
241028
|
-
const markerMatches = state !== void 0 &&
|
|
241109
|
+
const markerMatches = state !== void 0 && import_node_path18.default.resolve(state.targetPath) === targetPath;
|
|
241029
241110
|
if (!sameInode && !markerMatches && !params.force) {
|
|
241030
241111
|
throw new ForeignClaudeEntryError(targetPath, "enable");
|
|
241031
241112
|
}
|
|
@@ -241050,7 +241131,7 @@ function enableClaudeShim(params, linkFs = nodeLinkFs) {
|
|
|
241050
241131
|
function disableClaudeShim(params) {
|
|
241051
241132
|
const realContentPath = import_node_fs7.default.realpathSync(params.contentSourcePath);
|
|
241052
241133
|
const state = readJson(params.paths.claudeShimFile, ClaudeShimStateSchema);
|
|
241053
|
-
const targetPath = params.dir !== void 0 ?
|
|
241134
|
+
const targetPath = params.dir !== void 0 ? import_node_path18.default.join(params.dir, claudeTargetFilename(params.ownExecutablePath)) : state?.targetPath ?? resolveClaudeTargetPath(params.ownExecutablePath);
|
|
241054
241135
|
const existing = lstatOrUndefined(targetPath);
|
|
241055
241136
|
if (existing === void 0) {
|
|
241056
241137
|
if (state !== void 0) {
|
|
@@ -241060,7 +241141,7 @@ function disableClaudeShim(params) {
|
|
|
241060
241141
|
}
|
|
241061
241142
|
const ownStat = import_node_fs7.default.statSync(realContentPath);
|
|
241062
241143
|
const sameInode = existing.dev === ownStat.dev && existing.ino === ownStat.ino;
|
|
241063
|
-
const markerMatches = state !== void 0 &&
|
|
241144
|
+
const markerMatches = state !== void 0 && import_node_path18.default.resolve(state.targetPath) === targetPath;
|
|
241064
241145
|
if (!sameInode && !markerMatches && !params.force) {
|
|
241065
241146
|
throw new ForeignClaudeEntryError(targetPath, "disable");
|
|
241066
241147
|
}
|
|
@@ -241069,15 +241150,15 @@ function disableClaudeShim(params) {
|
|
|
241069
241150
|
return { action: "disabled", targetPath };
|
|
241070
241151
|
}
|
|
241071
241152
|
function findPathShadow(params) {
|
|
241072
|
-
const resolvedTargetDir =
|
|
241153
|
+
const resolvedTargetDir = import_node_path18.default.resolve(params.targetDir);
|
|
241073
241154
|
for (const dir of params.pathDirs) {
|
|
241074
241155
|
const found = params.findExecutableInDir(dir, params.targetFilename);
|
|
241075
241156
|
if (found === void 0) {
|
|
241076
241157
|
continue;
|
|
241077
241158
|
}
|
|
241078
|
-
return
|
|
241159
|
+
return import_node_path18.default.resolve(dir) === resolvedTargetDir ? { status: "ok" } : { status: "shadowed", by: found };
|
|
241079
241160
|
}
|
|
241080
|
-
return params.pathDirs.some((dir) =>
|
|
241161
|
+
return params.pathDirs.some((dir) => import_node_path18.default.resolve(dir) === resolvedTargetDir) ? { status: "ok" } : { status: "not-on-path" };
|
|
241081
241162
|
}
|
|
241082
241163
|
function registerShimCommand(program2, paths) {
|
|
241083
241164
|
const shim = program2.command("shim").description(
|
|
@@ -241091,21 +241172,21 @@ function registerShimCommand(program2, paths) {
|
|
|
241091
241172
|
ownExecutablePath,
|
|
241092
241173
|
contentSourcePath,
|
|
241093
241174
|
platform: process.platform,
|
|
241094
|
-
...options.dir === void 0 ? {} : { dir:
|
|
241175
|
+
...options.dir === void 0 ? {} : { dir: import_node_path18.default.resolve(options.dir) },
|
|
241095
241176
|
force: options.force ?? false
|
|
241096
241177
|
});
|
|
241097
241178
|
console.log(`${result.action === "enabled" ? "Installed" : "Reinstalled"} \`claude\` at ${result.targetPath} (${result.method}).`);
|
|
241098
241179
|
const shadow = findPathShadow({
|
|
241099
|
-
pathDirs: (process.env.PATH ?? "").split(
|
|
241100
|
-
targetDir:
|
|
241101
|
-
targetFilename:
|
|
241180
|
+
pathDirs: (process.env.PATH ?? "").split(import_node_path18.default.delimiter).filter((dir) => dir !== ""),
|
|
241181
|
+
targetDir: import_node_path18.default.dirname(result.targetPath),
|
|
241182
|
+
targetFilename: import_node_path18.default.basename(result.targetPath),
|
|
241102
241183
|
findExecutableInDir
|
|
241103
241184
|
});
|
|
241104
241185
|
if (shadow.status === "not-on-path") {
|
|
241105
|
-
console.warn(`warning: ${
|
|
241186
|
+
console.warn(`warning: ${import_node_path18.default.dirname(result.targetPath)} is not on PATH \u2014 add it, or use \`claude-use run\` instead.`);
|
|
241106
241187
|
} else if (shadow.status === "shadowed") {
|
|
241107
241188
|
console.warn(
|
|
241108
|
-
`warning: 'claude' on PATH currently resolves to ${shadow.by}, not ${result.targetPath}. Put ${
|
|
241189
|
+
`warning: 'claude' on PATH currently resolves to ${shadow.by}, not ${result.targetPath}. Put ${import_node_path18.default.dirname(result.targetPath)} ahead of it on PATH.`
|
|
241109
241190
|
);
|
|
241110
241191
|
}
|
|
241111
241192
|
});
|
|
@@ -241116,7 +241197,7 @@ function registerShimCommand(program2, paths) {
|
|
|
241116
241197
|
paths,
|
|
241117
241198
|
ownExecutablePath,
|
|
241118
241199
|
contentSourcePath,
|
|
241119
|
-
...options.dir === void 0 ? {} : { dir:
|
|
241200
|
+
...options.dir === void 0 ? {} : { dir: import_node_path18.default.resolve(options.dir) },
|
|
241120
241201
|
force: options.force ?? false
|
|
241121
241202
|
});
|
|
241122
241203
|
console.log(
|
|
@@ -241127,7 +241208,7 @@ function registerShimCommand(program2, paths) {
|
|
|
241127
241208
|
|
|
241128
241209
|
// src/doctor.ts
|
|
241129
241210
|
var import_node_fs8 = __toESM(require("node:fs"), 1);
|
|
241130
|
-
var
|
|
241211
|
+
var import_node_path19 = __toESM(require("node:path"), 1);
|
|
241131
241212
|
function validateJson(schema, input) {
|
|
241132
241213
|
if (input.raw === void 0) {
|
|
241133
241214
|
return { ok: false, message: `${input.path} is missing.` };
|
|
@@ -241350,13 +241431,13 @@ function registerDoctorCommand(program2, paths) {
|
|
|
241350
241431
|
).action(() => {
|
|
241351
241432
|
const identityNames = import_node_fs8.default.existsSync(paths.identitiesDir) ? import_node_fs8.default.readdirSync(paths.identitiesDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort() : [];
|
|
241352
241433
|
const identities = identityNames.map((name) => {
|
|
241353
|
-
const farmRoot =
|
|
241354
|
-
const identityPath =
|
|
241434
|
+
const farmRoot = import_node_path19.default.join(paths.identitiesDir, name);
|
|
241435
|
+
const identityPath = import_node_path19.default.join(farmRoot, "identity.json");
|
|
241355
241436
|
return { name, path: identityPath, raw: realFsPort.readFileUtf8(identityPath), farmRoot };
|
|
241356
241437
|
});
|
|
241357
241438
|
const profileNames = import_node_fs8.default.existsSync(paths.configProfilesDir) ? import_node_fs8.default.readdirSync(paths.configProfilesDir, { withFileTypes: true }).filter((entry) => entry.isFile() && entry.name.endsWith(".json")).map((entry) => entry.name.slice(0, -".json".length)).sort() : [];
|
|
241358
241439
|
const configProfiles = profileNames.map((name) => {
|
|
241359
|
-
const profilePath =
|
|
241440
|
+
const profilePath = import_node_path19.default.join(paths.configProfilesDir, `${name}.json`);
|
|
241360
241441
|
return { name, path: profilePath, raw: realFsPort.readFileUtf8(profilePath) };
|
|
241361
241442
|
});
|
|
241362
241443
|
const ownExecutablePath = realOwnExecutablePath();
|
|
@@ -241500,13 +241581,13 @@ function buildCliOverride(params) {
|
|
|
241500
241581
|
entryPairs = { ...entryPairs, ...parseBoolPairList(params.env.CLAUDE_USE_ENTRY_OVERRIDE) };
|
|
241501
241582
|
}
|
|
241502
241583
|
for (const flagValue of params.shareFlags) {
|
|
241503
|
-
for (const
|
|
241504
|
-
entryPairs[
|
|
241584
|
+
for (const path22 of splitTopLevelCommas(flagValue)) {
|
|
241585
|
+
entryPairs[path22] = true;
|
|
241505
241586
|
}
|
|
241506
241587
|
}
|
|
241507
241588
|
for (const flagValue of params.hideFlags) {
|
|
241508
|
-
for (const
|
|
241509
|
-
entryPairs[
|
|
241589
|
+
for (const path22 of splitTopLevelCommas(flagValue)) {
|
|
241590
|
+
entryPairs[path22] = false;
|
|
241510
241591
|
}
|
|
241511
241592
|
}
|
|
241512
241593
|
const hasCategories = Object.keys(categoryPairs).length > 0;
|
|
@@ -241521,7 +241602,7 @@ function buildCliOverride(params) {
|
|
|
241521
241602
|
}
|
|
241522
241603
|
|
|
241523
241604
|
// src/launcher/flags.ts
|
|
241524
|
-
var
|
|
241605
|
+
var import_node_path20 = __toESM(require("node:path"), 1);
|
|
241525
241606
|
function isEnvFlagSet(value) {
|
|
241526
241607
|
return value === "1";
|
|
241527
241608
|
}
|
|
@@ -241550,7 +241631,7 @@ function buildEnv(params) {
|
|
|
241550
241631
|
}
|
|
241551
241632
|
return {
|
|
241552
241633
|
...params.baseEnv,
|
|
241553
|
-
CLAUDE_CONFIG_DIR:
|
|
241634
|
+
CLAUDE_CONFIG_DIR: import_node_path20.default.join(params.identitiesDir, params.resolvedIdentityName)
|
|
241554
241635
|
};
|
|
241555
241636
|
}
|
|
241556
241637
|
|
|
@@ -241630,7 +241711,7 @@ function runLauncher(params) {
|
|
|
241630
241711
|
}
|
|
241631
241712
|
throw error51;
|
|
241632
241713
|
}
|
|
241633
|
-
for (const diagnostic of recoveryDiagnostics(recovery)) {
|
|
241714
|
+
for (const diagnostic of recoveryDiagnostics(recovery, farmIdentity)) {
|
|
241634
241715
|
log.warn(`claude-use: ${diagnostic.code}: ${diagnostic.message}`);
|
|
241635
241716
|
}
|
|
241636
241717
|
}
|
|
@@ -241793,10 +241874,10 @@ function runClaude(argvOverride) {
|
|
|
241793
241874
|
});
|
|
241794
241875
|
}
|
|
241795
241876
|
function main() {
|
|
241796
|
-
const invokedName =
|
|
241877
|
+
const invokedName = import_node_path21.default.basename(process.argv[1] ?? "claude-use");
|
|
241797
241878
|
if (isInvokedAsClaude(invokedName)) {
|
|
241798
241879
|
runClaude();
|
|
241799
|
-
} else {
|
|
241880
|
+
} else if (!tryRunAtIdentityShortcut(resolveLayoutPaths(), process.argv.slice(2))) {
|
|
241800
241881
|
buildClaudeUseProgram().parse(process.argv);
|
|
241801
241882
|
}
|
|
241802
241883
|
}
|