@typescript-deploys/pr-build 5.0.0-pr-51373-23 → 5.0.0-pr-50403-6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/tsc.js +325 -205
- package/lib/tsserver.js +356 -227
- package/lib/tsserverlibrary.d.ts +20 -7
- package/lib/tsserverlibrary.js +357 -228
- package/lib/typescript.d.ts +20 -7
- package/lib/typescript.js +357 -228
- package/lib/typingsInstaller.js +79 -87
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -23,7 +23,7 @@ var __export = (target, all) => {
|
|
|
23
23
|
|
|
24
24
|
// src/compiler/corePublic.ts
|
|
25
25
|
var versionMajorMinor = "5.0";
|
|
26
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
26
|
+
var version = `${versionMajorMinor}.0-insiders.20221207`;
|
|
27
27
|
|
|
28
28
|
// src/compiler/core.ts
|
|
29
29
|
var emptyArray = [];
|
|
@@ -1695,22 +1695,8 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
|
|
|
1695
1695
|
function enableDebugInfo() {
|
|
1696
1696
|
if (isDebugInfoEnabled)
|
|
1697
1697
|
return;
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
function getWeakTypeTextMap() {
|
|
1701
|
-
if (weakTypeTextMap === void 0) {
|
|
1702
|
-
if (typeof WeakMap === "function")
|
|
1703
|
-
weakTypeTextMap = /* @__PURE__ */ new WeakMap();
|
|
1704
|
-
}
|
|
1705
|
-
return weakTypeTextMap;
|
|
1706
|
-
}
|
|
1707
|
-
function getWeakNodeTextMap() {
|
|
1708
|
-
if (weakNodeTextMap === void 0) {
|
|
1709
|
-
if (typeof WeakMap === "function")
|
|
1710
|
-
weakNodeTextMap = /* @__PURE__ */ new WeakMap();
|
|
1711
|
-
}
|
|
1712
|
-
return weakNodeTextMap;
|
|
1713
|
-
}
|
|
1698
|
+
const weakTypeTextMap = /* @__PURE__ */ new WeakMap();
|
|
1699
|
+
const weakNodeTextMap = /* @__PURE__ */ new WeakMap();
|
|
1714
1700
|
Object.defineProperties(objectAllocator.getSymbolConstructor().prototype, {
|
|
1715
1701
|
__tsDebuggerDisplay: {
|
|
1716
1702
|
value() {
|
|
@@ -1739,11 +1725,10 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
|
|
|
1739
1725
|
} },
|
|
1740
1726
|
__debugTypeToString: {
|
|
1741
1727
|
value() {
|
|
1742
|
-
|
|
1743
|
-
let text = map2 == null ? void 0 : map2.get(this);
|
|
1728
|
+
let text = weakTypeTextMap.get(this);
|
|
1744
1729
|
if (text === void 0) {
|
|
1745
1730
|
text = this.checker.typeToString(this);
|
|
1746
|
-
|
|
1731
|
+
weakTypeTextMap.set(this, text);
|
|
1747
1732
|
}
|
|
1748
1733
|
return text;
|
|
1749
1734
|
}
|
|
@@ -1795,13 +1780,12 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
|
|
|
1795
1780
|
value(includeTrivia) {
|
|
1796
1781
|
if (nodeIsSynthesized(this))
|
|
1797
1782
|
return "";
|
|
1798
|
-
|
|
1799
|
-
let text = map2 == null ? void 0 : map2.get(this);
|
|
1783
|
+
let text = weakNodeTextMap.get(this);
|
|
1800
1784
|
if (text === void 0) {
|
|
1801
1785
|
const parseNode = getParseTreeNode(this);
|
|
1802
1786
|
const sourceFile = parseNode && getSourceFileOfNode(parseNode);
|
|
1803
1787
|
text = sourceFile ? getSourceTextOfNodeFromSourceFile(sourceFile, parseNode, includeTrivia) : "";
|
|
1804
|
-
|
|
1788
|
+
weakNodeTextMap.set(this, text);
|
|
1805
1789
|
}
|
|
1806
1790
|
return text;
|
|
1807
1791
|
}
|
|
@@ -31157,6 +31141,9 @@ function parseListTypeOption(opt, value = "", errors) {
|
|
|
31157
31141
|
if (startsWith(value, "-")) {
|
|
31158
31142
|
return void 0;
|
|
31159
31143
|
}
|
|
31144
|
+
if (opt.type === "listOrElement" && !stringContains(value, ",")) {
|
|
31145
|
+
return validateJsonOptionValue(opt, value, errors);
|
|
31146
|
+
}
|
|
31160
31147
|
if (value === "") {
|
|
31161
31148
|
return [];
|
|
31162
31149
|
}
|
|
@@ -31166,6 +31153,10 @@ function parseListTypeOption(opt, value = "", errors) {
|
|
|
31166
31153
|
return mapDefined(values, (v) => validateJsonOptionValue(opt.element, parseInt(v), errors));
|
|
31167
31154
|
case "string":
|
|
31168
31155
|
return mapDefined(values, (v) => validateJsonOptionValue(opt.element, v || "", errors));
|
|
31156
|
+
case "boolean":
|
|
31157
|
+
case "object":
|
|
31158
|
+
case "listOrElement":
|
|
31159
|
+
return Debug.fail(`List of ${opt.element.type} is not yet supported.`);
|
|
31169
31160
|
default:
|
|
31170
31161
|
return mapDefined(values, (v) => parseCustomTypeOption(opt.element, v, errors));
|
|
31171
31162
|
}
|
|
@@ -31299,6 +31290,9 @@ function parseOptionValue(args, i, diagnostics, opt, options, errors) {
|
|
|
31299
31290
|
i++;
|
|
31300
31291
|
}
|
|
31301
31292
|
break;
|
|
31293
|
+
case "listOrElement":
|
|
31294
|
+
Debug.fail("listOrElement not supported here");
|
|
31295
|
+
break;
|
|
31302
31296
|
default:
|
|
31303
31297
|
options[opt.name] = parseCustomTypeOption(opt, args[i], errors);
|
|
31304
31298
|
i++;
|
|
@@ -31450,6 +31444,15 @@ var commandLineTypeAcquisitionMapCache;
|
|
|
31450
31444
|
function getCommandLineTypeAcquisitionMap() {
|
|
31451
31445
|
return commandLineTypeAcquisitionMapCache || (commandLineTypeAcquisitionMapCache = commandLineOptionsToMap(typeAcquisitionDeclarations));
|
|
31452
31446
|
}
|
|
31447
|
+
var extendsOptionDeclaration = {
|
|
31448
|
+
name: "extends",
|
|
31449
|
+
type: "listOrElement",
|
|
31450
|
+
element: {
|
|
31451
|
+
name: "extends",
|
|
31452
|
+
type: "string"
|
|
31453
|
+
},
|
|
31454
|
+
category: Diagnostics.File_Management
|
|
31455
|
+
};
|
|
31453
31456
|
var _tsconfigRootOptions;
|
|
31454
31457
|
function getTsconfigRootOptionsMap() {
|
|
31455
31458
|
if (_tsconfigRootOptions === void 0) {
|
|
@@ -31481,11 +31484,7 @@ function getTsconfigRootOptionsMap() {
|
|
|
31481
31484
|
elementOptions: getCommandLineTypeAcquisitionMap(),
|
|
31482
31485
|
extraKeyDiagnostics: typeAcquisitionDidYouMeanDiagnostics
|
|
31483
31486
|
},
|
|
31484
|
-
|
|
31485
|
-
name: "extends",
|
|
31486
|
-
type: "string",
|
|
31487
|
-
category: Diagnostics.File_Management
|
|
31488
|
-
},
|
|
31487
|
+
extendsOptionDeclaration,
|
|
31489
31488
|
{
|
|
31490
31489
|
name: "references",
|
|
31491
31490
|
type: "list",
|
|
@@ -31624,10 +31623,10 @@ function convertToObjectWorker(sourceFile, rootExpression, errors, returnValue,
|
|
|
31624
31623
|
let invalidReported;
|
|
31625
31624
|
switch (valueExpression.kind) {
|
|
31626
31625
|
case 110 /* TrueKeyword */:
|
|
31627
|
-
reportInvalidOptionValue(option && option.type !== "boolean");
|
|
31626
|
+
reportInvalidOptionValue(option && option.type !== "boolean" && (option.type !== "listOrElement" || option.element.type !== "boolean"));
|
|
31628
31627
|
return validateValue(true);
|
|
31629
31628
|
case 95 /* FalseKeyword */:
|
|
31630
|
-
reportInvalidOptionValue(option && option.type !== "boolean");
|
|
31629
|
+
reportInvalidOptionValue(option && option.type !== "boolean" && (option.type !== "listOrElement" || option.element.type !== "boolean"));
|
|
31631
31630
|
return validateValue(false);
|
|
31632
31631
|
case 104 /* NullKeyword */:
|
|
31633
31632
|
reportInvalidOptionValue(option && option.name === "extends");
|
|
@@ -31636,8 +31635,11 @@ function convertToObjectWorker(sourceFile, rootExpression, errors, returnValue,
|
|
|
31636
31635
|
if (!isDoubleQuotedString(valueExpression)) {
|
|
31637
31636
|
errors.push(createDiagnosticForNodeInSourceFile(sourceFile, valueExpression, Diagnostics.String_literal_with_double_quotes_expected));
|
|
31638
31637
|
}
|
|
31639
|
-
reportInvalidOptionValue(option && (isString(option.type) && option.type !== "string"));
|
|
31638
|
+
reportInvalidOptionValue(option && isString(option.type) && option.type !== "string" && (option.type !== "listOrElement" || isString(option.element.type) && option.element.type !== "string"));
|
|
31640
31639
|
const text = valueExpression.text;
|
|
31640
|
+
if (option) {
|
|
31641
|
+
Debug.assert(option.type !== "listOrElement" || option.element.type === "string", "Only string or array of string is handled for now");
|
|
31642
|
+
}
|
|
31641
31643
|
if (option && !isString(option.type)) {
|
|
31642
31644
|
const customOption = option;
|
|
31643
31645
|
if (!customOption.type.has(text.toLowerCase())) {
|
|
@@ -31652,16 +31654,16 @@ function convertToObjectWorker(sourceFile, rootExpression, errors, returnValue,
|
|
|
31652
31654
|
}
|
|
31653
31655
|
return validateValue(text);
|
|
31654
31656
|
case 8 /* NumericLiteral */:
|
|
31655
|
-
reportInvalidOptionValue(option && option.type !== "number");
|
|
31657
|
+
reportInvalidOptionValue(option && option.type !== "number" && (option.type !== "listOrElement" || option.element.type !== "number"));
|
|
31656
31658
|
return validateValue(Number(valueExpression.text));
|
|
31657
31659
|
case 221 /* PrefixUnaryExpression */:
|
|
31658
31660
|
if (valueExpression.operator !== 40 /* MinusToken */ || valueExpression.operand.kind !== 8 /* NumericLiteral */) {
|
|
31659
31661
|
break;
|
|
31660
31662
|
}
|
|
31661
|
-
reportInvalidOptionValue(option && option.type !== "number");
|
|
31663
|
+
reportInvalidOptionValue(option && option.type !== "number" && (option.type !== "listOrElement" || option.element.type !== "number"));
|
|
31662
31664
|
return validateValue(-Number(valueExpression.operand.text));
|
|
31663
31665
|
case 207 /* ObjectLiteralExpression */:
|
|
31664
|
-
reportInvalidOptionValue(option && option.type !== "object");
|
|
31666
|
+
reportInvalidOptionValue(option && option.type !== "object" && (option.type !== "listOrElement" || option.element.type !== "object"));
|
|
31665
31667
|
const objectLiteralExpression = valueExpression;
|
|
31666
31668
|
if (option) {
|
|
31667
31669
|
const { elementOptions, extraKeyDiagnostics, name: optionName } = option;
|
|
@@ -31680,7 +31682,7 @@ function convertToObjectWorker(sourceFile, rootExpression, errors, returnValue,
|
|
|
31680
31682
|
));
|
|
31681
31683
|
}
|
|
31682
31684
|
case 206 /* ArrayLiteralExpression */:
|
|
31683
|
-
reportInvalidOptionValue(option && option.type !== "list");
|
|
31685
|
+
reportInvalidOptionValue(option && option.type !== "list" && option.type !== "listOrElement");
|
|
31684
31686
|
return validateValue(convertArrayLiteralExpressionToJson(
|
|
31685
31687
|
valueExpression.elements,
|
|
31686
31688
|
option && option.element
|
|
@@ -31715,7 +31717,7 @@ function convertToObjectWorker(sourceFile, rootExpression, errors, returnValue,
|
|
|
31715
31717
|
}
|
|
31716
31718
|
}
|
|
31717
31719
|
function getCompilerOptionValueTypeString(option) {
|
|
31718
|
-
return option.type === "list" ? "Array" : isString(option.type) ? option.type : "string";
|
|
31720
|
+
return option.type === "listOrElement" ? `${getCompilerOptionValueTypeString(option.element)} or Array` : option.type === "list" ? "Array" : isString(option.type) ? option.type : "string";
|
|
31719
31721
|
}
|
|
31720
31722
|
function isCompilerOptionsValue(option, value) {
|
|
31721
31723
|
if (option) {
|
|
@@ -31724,6 +31726,9 @@ function isCompilerOptionsValue(option, value) {
|
|
|
31724
31726
|
if (option.type === "list") {
|
|
31725
31727
|
return isArray(value);
|
|
31726
31728
|
}
|
|
31729
|
+
if (option.type === "listOrElement") {
|
|
31730
|
+
return isArray(value) || isCompilerOptionsValue(option.element, value);
|
|
31731
|
+
}
|
|
31727
31732
|
const expectedType = isString(option.type) ? option.type : "string";
|
|
31728
31733
|
return typeof value === expectedType;
|
|
31729
31734
|
}
|
|
@@ -31803,12 +31808,17 @@ function matchesSpecs(path, includeSpecs, excludeSpecs, host) {
|
|
|
31803
31808
|
return returnTrue;
|
|
31804
31809
|
}
|
|
31805
31810
|
function getCustomTypeMapOfCommandLineOption(optionDefinition) {
|
|
31806
|
-
|
|
31807
|
-
|
|
31808
|
-
|
|
31809
|
-
|
|
31810
|
-
|
|
31811
|
-
|
|
31811
|
+
switch (optionDefinition.type) {
|
|
31812
|
+
case "string":
|
|
31813
|
+
case "number":
|
|
31814
|
+
case "boolean":
|
|
31815
|
+
case "object":
|
|
31816
|
+
return void 0;
|
|
31817
|
+
case "list":
|
|
31818
|
+
case "listOrElement":
|
|
31819
|
+
return getCustomTypeMapOfCommandLineOption(optionDefinition.element);
|
|
31820
|
+
default:
|
|
31821
|
+
return optionDefinition.type;
|
|
31812
31822
|
}
|
|
31813
31823
|
}
|
|
31814
31824
|
function getNameOfCompilerOptionValue(value, customTypeMap) {
|
|
@@ -31835,6 +31845,7 @@ function serializeOptionBaseObject(options, { optionsNameMap }, pathOptions) {
|
|
|
31835
31845
|
const value = options[name];
|
|
31836
31846
|
const optionDefinition = optionsNameMap.get(name.toLowerCase());
|
|
31837
31847
|
if (optionDefinition) {
|
|
31848
|
+
Debug.assert(optionDefinition.type !== "listOrElement");
|
|
31838
31849
|
const customTypeMap = getCustomTypeMapOfCommandLineOption(optionDefinition);
|
|
31839
31850
|
if (!customTypeMap) {
|
|
31840
31851
|
if (pathOptions && optionDefinition.isFilePath) {
|
|
@@ -31983,6 +31994,7 @@ function convertToOptionValueWithAbsolutePaths(option, value, toAbsolutePath) {
|
|
|
31983
31994
|
} else if (option.isFilePath) {
|
|
31984
31995
|
return toAbsolutePath(value);
|
|
31985
31996
|
}
|
|
31997
|
+
Debug.assert(option.type !== "listOrElement");
|
|
31986
31998
|
}
|
|
31987
31999
|
return value;
|
|
31988
32000
|
}
|
|
@@ -32176,30 +32188,49 @@ function parseConfig(json, sourceFile, host, basePath, configFileName, resolutio
|
|
|
32176
32188
|
}
|
|
32177
32189
|
if (ownConfig.extendedConfigPath) {
|
|
32178
32190
|
resolutionStack = resolutionStack.concat([resolvedPath]);
|
|
32179
|
-
const
|
|
32191
|
+
const result = { options: {} };
|
|
32192
|
+
if (isString(ownConfig.extendedConfigPath)) {
|
|
32193
|
+
applyExtendedConfig(result, ownConfig.extendedConfigPath);
|
|
32194
|
+
} else {
|
|
32195
|
+
ownConfig.extendedConfigPath.forEach((extendedConfigPath) => applyExtendedConfig(result, extendedConfigPath));
|
|
32196
|
+
}
|
|
32197
|
+
if (!ownConfig.raw.include && result.include)
|
|
32198
|
+
ownConfig.raw.include = result.include;
|
|
32199
|
+
if (!ownConfig.raw.exclude && result.exclude)
|
|
32200
|
+
ownConfig.raw.exclude = result.exclude;
|
|
32201
|
+
if (!ownConfig.raw.files && result.files)
|
|
32202
|
+
ownConfig.raw.files = result.files;
|
|
32203
|
+
if (ownConfig.raw.compileOnSave === void 0 && result.compileOnSave)
|
|
32204
|
+
ownConfig.raw.compileOnSave = result.compileOnSave;
|
|
32205
|
+
if (sourceFile && result.extendedSourceFiles)
|
|
32206
|
+
sourceFile.extendedSourceFiles = arrayFrom(result.extendedSourceFiles.keys());
|
|
32207
|
+
ownConfig.options = assign(result.options, ownConfig.options);
|
|
32208
|
+
ownConfig.watchOptions = ownConfig.watchOptions && result.watchOptions ? assign(result.watchOptions, ownConfig.watchOptions) : ownConfig.watchOptions || result.watchOptions;
|
|
32209
|
+
}
|
|
32210
|
+
return ownConfig;
|
|
32211
|
+
function applyExtendedConfig(result, extendedConfigPath) {
|
|
32212
|
+
const extendedConfig = getExtendedConfig(sourceFile, extendedConfigPath, host, resolutionStack, errors, extendedConfigCache, result);
|
|
32180
32213
|
if (extendedConfig && isSuccessfulParsedTsconfig(extendedConfig)) {
|
|
32181
|
-
const
|
|
32182
|
-
const raw = ownConfig.raw;
|
|
32214
|
+
const extendsRaw = extendedConfig.raw;
|
|
32183
32215
|
let relativeDifference;
|
|
32184
|
-
const
|
|
32185
|
-
if (
|
|
32186
|
-
|
|
32187
|
-
relativeDifference || (relativeDifference = convertToRelativePath(getDirectoryPath(
|
|
32216
|
+
const setPropertyInResultIfNotUndefined = (propertyName) => {
|
|
32217
|
+
if (extendsRaw[propertyName]) {
|
|
32218
|
+
result[propertyName] = map(extendsRaw[propertyName], (path) => isRootedDiskPath(path) ? path : combinePaths(
|
|
32219
|
+
relativeDifference || (relativeDifference = convertToRelativePath(getDirectoryPath(extendedConfigPath), basePath, createGetCanonicalFileName(host.useCaseSensitiveFileNames))),
|
|
32188
32220
|
path
|
|
32189
32221
|
));
|
|
32190
32222
|
}
|
|
32191
32223
|
};
|
|
32192
|
-
|
|
32193
|
-
|
|
32194
|
-
|
|
32195
|
-
if (
|
|
32196
|
-
|
|
32224
|
+
setPropertyInResultIfNotUndefined("include");
|
|
32225
|
+
setPropertyInResultIfNotUndefined("exclude");
|
|
32226
|
+
setPropertyInResultIfNotUndefined("files");
|
|
32227
|
+
if (extendsRaw.compileOnSave !== void 0) {
|
|
32228
|
+
result.compileOnSave = extendsRaw.compileOnSave;
|
|
32197
32229
|
}
|
|
32198
|
-
|
|
32199
|
-
|
|
32230
|
+
assign(result.options, extendedConfig.options);
|
|
32231
|
+
result.watchOptions = result.watchOptions && extendedConfig.watchOptions ? assign({}, result.watchOptions, extendedConfig.watchOptions) : result.watchOptions || extendedConfig.watchOptions;
|
|
32200
32232
|
}
|
|
32201
32233
|
}
|
|
32202
|
-
return ownConfig;
|
|
32203
32234
|
}
|
|
32204
32235
|
function parseOwnConfigOfJson(json, host, basePath, configFileName, errors) {
|
|
32205
32236
|
if (hasProperty(json, "excludes")) {
|
|
@@ -32211,11 +32242,22 @@ function parseOwnConfigOfJson(json, host, basePath, configFileName, errors) {
|
|
|
32211
32242
|
json.compileOnSave = convertCompileOnSaveOptionFromJson(json, basePath, errors);
|
|
32212
32243
|
let extendedConfigPath;
|
|
32213
32244
|
if (json.extends) {
|
|
32214
|
-
if (!
|
|
32215
|
-
errors.push(createCompilerDiagnostic(Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "extends",
|
|
32245
|
+
if (!isCompilerOptionsValue(extendsOptionDeclaration, json.extends)) {
|
|
32246
|
+
errors.push(createCompilerDiagnostic(Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "extends", getCompilerOptionValueTypeString(extendsOptionDeclaration)));
|
|
32216
32247
|
} else {
|
|
32217
32248
|
const newBase = configFileName ? directoryOfCombinedPath(configFileName, basePath) : basePath;
|
|
32218
|
-
|
|
32249
|
+
if (isString(json.extends)) {
|
|
32250
|
+
extendedConfigPath = getExtendsConfigPath(json.extends, host, newBase, errors, createCompilerDiagnostic);
|
|
32251
|
+
} else {
|
|
32252
|
+
extendedConfigPath = [];
|
|
32253
|
+
for (const fileName of json.extends) {
|
|
32254
|
+
if (isString(fileName)) {
|
|
32255
|
+
extendedConfigPath = append(extendedConfigPath, getExtendsConfigPath(fileName, host, newBase, errors, createCompilerDiagnostic));
|
|
32256
|
+
} else {
|
|
32257
|
+
errors.push(createCompilerDiagnostic(Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "extends", getCompilerOptionValueTypeString(extendsOptionDeclaration.element)));
|
|
32258
|
+
}
|
|
32259
|
+
}
|
|
32260
|
+
}
|
|
32219
32261
|
}
|
|
32220
32262
|
}
|
|
32221
32263
|
return { raw: json, options, watchOptions, typeAcquisition, extendedConfigPath };
|
|
@@ -32251,13 +32293,29 @@ function parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileNa
|
|
|
32251
32293
|
switch (key) {
|
|
32252
32294
|
case "extends":
|
|
32253
32295
|
const newBase = configFileName ? directoryOfCombinedPath(configFileName, basePath) : basePath;
|
|
32254
|
-
|
|
32255
|
-
|
|
32256
|
-
|
|
32257
|
-
|
|
32258
|
-
|
|
32259
|
-
|
|
32260
|
-
|
|
32296
|
+
if (isString(value)) {
|
|
32297
|
+
extendedConfigPath = getExtendsConfigPath(
|
|
32298
|
+
value,
|
|
32299
|
+
host,
|
|
32300
|
+
newBase,
|
|
32301
|
+
errors,
|
|
32302
|
+
(message, arg0) => createDiagnosticForNodeInSourceFile(sourceFile, valueNode, message, arg0)
|
|
32303
|
+
);
|
|
32304
|
+
} else {
|
|
32305
|
+
extendedConfigPath = [];
|
|
32306
|
+
for (let index = 0; index < value.length; index++) {
|
|
32307
|
+
const fileName = value[index];
|
|
32308
|
+
if (isString(fileName)) {
|
|
32309
|
+
extendedConfigPath = append(extendedConfigPath, getExtendsConfigPath(
|
|
32310
|
+
fileName,
|
|
32311
|
+
host,
|
|
32312
|
+
newBase,
|
|
32313
|
+
errors,
|
|
32314
|
+
(message, arg0) => createDiagnosticForNodeInSourceFile(sourceFile, valueNode.elements[index], message, arg0)
|
|
32315
|
+
));
|
|
32316
|
+
}
|
|
32317
|
+
}
|
|
32318
|
+
}
|
|
32261
32319
|
return;
|
|
32262
32320
|
}
|
|
32263
32321
|
},
|
|
@@ -32307,7 +32365,8 @@ function getExtendsConfigPath(extendedConfig, host, basePath, errors, createDiag
|
|
|
32307
32365
|
errors.push(createDiagnostic(Diagnostics.File_0_not_found, extendedConfig));
|
|
32308
32366
|
return void 0;
|
|
32309
32367
|
}
|
|
32310
|
-
function getExtendedConfig(sourceFile, extendedConfigPath, host, resolutionStack, errors, extendedConfigCache) {
|
|
32368
|
+
function getExtendedConfig(sourceFile, extendedConfigPath, host, resolutionStack, errors, extendedConfigCache, result) {
|
|
32369
|
+
var _a2;
|
|
32311
32370
|
const path = host.useCaseSensitiveFileNames ? extendedConfigPath : toFileNameLowerCase(extendedConfigPath);
|
|
32312
32371
|
let value;
|
|
32313
32372
|
let extendedResult;
|
|
@@ -32333,9 +32392,11 @@ function getExtendedConfig(sourceFile, extendedConfigPath, host, resolutionStack
|
|
|
32333
32392
|
}
|
|
32334
32393
|
}
|
|
32335
32394
|
if (sourceFile) {
|
|
32336
|
-
|
|
32395
|
+
((_a2 = result.extendedSourceFiles) != null ? _a2 : result.extendedSourceFiles = /* @__PURE__ */ new Set()).add(extendedResult.fileName);
|
|
32337
32396
|
if (extendedResult.extendedSourceFiles) {
|
|
32338
|
-
|
|
32397
|
+
for (const extenedSourceFile of extendedResult.extendedSourceFiles) {
|
|
32398
|
+
result.extendedSourceFiles.add(extenedSourceFile);
|
|
32399
|
+
}
|
|
32339
32400
|
}
|
|
32340
32401
|
}
|
|
32341
32402
|
if (extendedResult.parseDiagnostics.length) {
|
|
@@ -32394,7 +32455,9 @@ function convertJsonOption(opt, value, basePath, errors) {
|
|
|
32394
32455
|
const optType = opt.type;
|
|
32395
32456
|
if (optType === "list" && isArray(value)) {
|
|
32396
32457
|
return convertJsonOptionOfListType(opt, value, basePath, errors);
|
|
32397
|
-
} else if (
|
|
32458
|
+
} else if (optType === "listOrElement") {
|
|
32459
|
+
return isArray(value) ? convertJsonOptionOfListType(opt, value, basePath, errors) : convertJsonOption(opt.element, value, basePath, errors);
|
|
32460
|
+
} else if (!isString(opt.type)) {
|
|
32398
32461
|
return convertJsonOptionOfCustomType(opt, value, errors);
|
|
32399
32462
|
}
|
|
32400
32463
|
const validatedValue = validateJsonOptionValue(opt, value, errors);
|
|
@@ -32406,7 +32469,9 @@ function convertJsonOption(opt, value, basePath, errors) {
|
|
|
32406
32469
|
function normalizeOptionValue(option, basePath, value) {
|
|
32407
32470
|
if (isNullOrUndefined(value))
|
|
32408
32471
|
return void 0;
|
|
32409
|
-
if (option.type === "
|
|
32472
|
+
if (option.type === "listOrElement" && !isArray(value))
|
|
32473
|
+
return normalizeOptionValue(option.element, basePath, value);
|
|
32474
|
+
else if (option.type === "list" || option.type === "listOrElement") {
|
|
32410
32475
|
const listOption = option;
|
|
32411
32476
|
if (listOption.element.isFilePath || !isString(listOption.element.type)) {
|
|
32412
32477
|
return filter(map(value, (v) => normalizeOptionValue(listOption.element, basePath, v)), (v) => listOption.listPreserveFalsyValues ? true : !!v);
|
|
@@ -32658,6 +32723,8 @@ function getDefaultValueForOption(option) {
|
|
|
32658
32723
|
return option.isFilePath ? `./${defaultValue && typeof defaultValue === "string" ? defaultValue : ""}` : "";
|
|
32659
32724
|
case "list":
|
|
32660
32725
|
return [];
|
|
32726
|
+
case "listOrElement":
|
|
32727
|
+
return getDefaultValueForOption(option.element);
|
|
32661
32728
|
case "object":
|
|
32662
32729
|
return {};
|
|
32663
32730
|
default:
|
|
@@ -32876,8 +32943,10 @@ function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFil
|
|
|
32876
32943
|
options = redirectedReference.commandLine.options;
|
|
32877
32944
|
}
|
|
32878
32945
|
const containingDirectory = containingFile ? getDirectoryPath(containingFile) : void 0;
|
|
32879
|
-
|
|
32880
|
-
|
|
32946
|
+
let result = containingDirectory ? cache == null ? void 0 : cache.getFromDirectoryCache(typeReferenceDirectiveName, resolutionMode, containingDirectory, redirectedReference) : void 0;
|
|
32947
|
+
if (!result && containingDirectory && !isExternalModuleNameRelative(typeReferenceDirectiveName)) {
|
|
32948
|
+
result = cache == null ? void 0 : cache.getFromNonRelativeNameCache(typeReferenceDirectiveName, resolutionMode, containingDirectory, redirectedReference);
|
|
32949
|
+
}
|
|
32881
32950
|
if (result) {
|
|
32882
32951
|
if (traceEnabled) {
|
|
32883
32952
|
trace(host, Diagnostics.Resolving_type_reference_directive_0_containing_file_1, typeReferenceDirectiveName, containingFile);
|
|
@@ -32953,7 +33022,12 @@ function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFil
|
|
|
32953
33022
|
affectingLocations: initializeResolutionField(affectingLocations),
|
|
32954
33023
|
resolutionDiagnostics: initializeResolutionField(diagnostics)
|
|
32955
33024
|
};
|
|
32956
|
-
|
|
33025
|
+
if (containingDirectory) {
|
|
33026
|
+
cache == null ? void 0 : cache.getOrCreateCacheForDirectory(containingDirectory, redirectedReference).set(typeReferenceDirectiveName, resolutionMode, result);
|
|
33027
|
+
if (!isExternalModuleNameRelative(typeReferenceDirectiveName)) {
|
|
33028
|
+
cache == null ? void 0 : cache.getOrCreateCacheForNonRelativeName(typeReferenceDirectiveName, resolutionMode, redirectedReference).set(containingDirectory, result);
|
|
33029
|
+
}
|
|
33030
|
+
}
|
|
32957
33031
|
if (traceEnabled)
|
|
32958
33032
|
traceResult(result);
|
|
32959
33033
|
return result;
|
|
@@ -33073,23 +33147,27 @@ function createCacheWithRedirects(ownOptions) {
|
|
|
33073
33147
|
if (ownOptions)
|
|
33074
33148
|
redirectsMap.set(ownOptions, ownMap);
|
|
33075
33149
|
return {
|
|
33150
|
+
getMapOfCacheRedirects,
|
|
33076
33151
|
getOrCreateMapOfCacheRedirects,
|
|
33077
33152
|
update,
|
|
33078
33153
|
clear: clear2
|
|
33079
33154
|
};
|
|
33155
|
+
function getMapOfCacheRedirects(redirectedReference) {
|
|
33156
|
+
return redirectedReference ? getOrCreateMap(redirectedReference.commandLine.options, false) : ownMap;
|
|
33157
|
+
}
|
|
33080
33158
|
function getOrCreateMapOfCacheRedirects(redirectedReference) {
|
|
33081
|
-
return redirectedReference ? getOrCreateMap(redirectedReference.commandLine.options) : ownMap;
|
|
33159
|
+
return redirectedReference ? getOrCreateMap(redirectedReference.commandLine.options, true) : ownMap;
|
|
33082
33160
|
}
|
|
33083
33161
|
function update(newOptions) {
|
|
33084
33162
|
if (ownOptions !== newOptions) {
|
|
33085
33163
|
if (ownOptions)
|
|
33086
|
-
ownMap = getOrCreateMap(newOptions);
|
|
33164
|
+
ownMap = getOrCreateMap(newOptions, true);
|
|
33087
33165
|
else
|
|
33088
33166
|
redirectsMap.set(newOptions, ownMap);
|
|
33089
33167
|
ownOptions = newOptions;
|
|
33090
33168
|
}
|
|
33091
33169
|
}
|
|
33092
|
-
function getOrCreateMap(redirectOptions) {
|
|
33170
|
+
function getOrCreateMap(redirectOptions, create) {
|
|
33093
33171
|
let result = redirectsMap.get(redirectOptions);
|
|
33094
33172
|
if (result)
|
|
33095
33173
|
return result;
|
|
@@ -33103,9 +33181,13 @@ function createCacheWithRedirects(ownOptions) {
|
|
|
33103
33181
|
else if (!redirectsKeyToMap.has(ownKey))
|
|
33104
33182
|
redirectsKeyToMap.set(ownKey, ownMap);
|
|
33105
33183
|
}
|
|
33106
|
-
|
|
33184
|
+
if (create)
|
|
33185
|
+
result != null ? result : result = /* @__PURE__ */ new Map();
|
|
33186
|
+
if (result)
|
|
33187
|
+
redirectsKeyToMap.set(key, result);
|
|
33107
33188
|
}
|
|
33108
|
-
|
|
33189
|
+
if (result)
|
|
33190
|
+
redirectsMap.set(redirectOptions, result);
|
|
33109
33191
|
return result;
|
|
33110
33192
|
}
|
|
33111
33193
|
function clear2() {
|
|
@@ -33157,8 +33239,10 @@ function getOrCreateCache(cacheWithRedirects, redirectedReference, key, create)
|
|
|
33157
33239
|
}
|
|
33158
33240
|
return result;
|
|
33159
33241
|
}
|
|
33160
|
-
function createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName,
|
|
33242
|
+
function createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, options) {
|
|
33243
|
+
const directoryToModuleNameMap = createCacheWithRedirects(options);
|
|
33161
33244
|
return {
|
|
33245
|
+
getFromDirectoryCache,
|
|
33162
33246
|
getOrCreateCacheForDirectory,
|
|
33163
33247
|
clear: clear2,
|
|
33164
33248
|
update
|
|
@@ -33166,13 +33250,18 @@ function createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileNam
|
|
|
33166
33250
|
function clear2() {
|
|
33167
33251
|
directoryToModuleNameMap.clear();
|
|
33168
33252
|
}
|
|
33169
|
-
function update(
|
|
33170
|
-
directoryToModuleNameMap.update(
|
|
33253
|
+
function update(options2) {
|
|
33254
|
+
directoryToModuleNameMap.update(options2);
|
|
33171
33255
|
}
|
|
33172
33256
|
function getOrCreateCacheForDirectory(directoryName, redirectedReference) {
|
|
33173
33257
|
const path = toPath(directoryName, currentDirectory, getCanonicalFileName);
|
|
33174
33258
|
return getOrCreateCache(directoryToModuleNameMap, redirectedReference, path, () => createModeAwareCache());
|
|
33175
33259
|
}
|
|
33260
|
+
function getFromDirectoryCache(name, mode, directoryName, redirectedReference) {
|
|
33261
|
+
var _a2, _b;
|
|
33262
|
+
const path = toPath(directoryName, currentDirectory, getCanonicalFileName);
|
|
33263
|
+
return (_b = (_a2 = directoryToModuleNameMap.getMapOfCacheRedirects(redirectedReference)) == null ? void 0 : _a2.get(path)) == null ? void 0 : _b.get(name, mode);
|
|
33264
|
+
}
|
|
33176
33265
|
}
|
|
33177
33266
|
function createModeAwareCacheKey(specifier, mode) {
|
|
33178
33267
|
return mode === void 0 ? specifier : `${mode}|${specifier}`;
|
|
@@ -33221,33 +33310,32 @@ function zipToModeAwareCache(file, keys, values, nameAndModeGetter) {
|
|
|
33221
33310
|
}
|
|
33222
33311
|
return map2;
|
|
33223
33312
|
}
|
|
33224
|
-
function
|
|
33225
|
-
|
|
33226
|
-
|
|
33313
|
+
function getOriginalOrResolvedModuleFileName(result) {
|
|
33314
|
+
return result.resolvedModule && (result.resolvedModule.originalPath || result.resolvedModule.resolvedFileName);
|
|
33315
|
+
}
|
|
33316
|
+
function getOriginalOrResolvedTypeReferenceFileName(result) {
|
|
33317
|
+
return result.resolvedTypeReferenceDirective && (result.resolvedTypeReferenceDirective.originalPath || result.resolvedTypeReferenceDirective.resolvedFileName);
|
|
33318
|
+
}
|
|
33319
|
+
function createNonRelativeNameResolutionCache(currentDirectory, getCanonicalFileName, options, getResolvedFileName) {
|
|
33227
33320
|
const moduleNameToDirectoryMap = createCacheWithRedirects(options);
|
|
33228
|
-
const packageJsonInfoCache = createPackageJsonInfoCache(currentDirectory, getCanonicalFileName);
|
|
33229
33321
|
return {
|
|
33230
|
-
|
|
33231
|
-
|
|
33232
|
-
getOrCreateCacheForModuleName,
|
|
33322
|
+
getFromNonRelativeNameCache,
|
|
33323
|
+
getOrCreateCacheForNonRelativeName,
|
|
33233
33324
|
clear: clear2,
|
|
33234
|
-
update
|
|
33235
|
-
getPackageJsonInfoCache: () => packageJsonInfoCache,
|
|
33236
|
-
clearAllExceptPackageJsonInfoCache
|
|
33325
|
+
update
|
|
33237
33326
|
};
|
|
33238
33327
|
function clear2() {
|
|
33239
|
-
clearAllExceptPackageJsonInfoCache();
|
|
33240
|
-
packageJsonInfoCache.clear();
|
|
33241
|
-
}
|
|
33242
|
-
function clearAllExceptPackageJsonInfoCache() {
|
|
33243
|
-
perDirectoryResolutionCache.clear();
|
|
33244
33328
|
moduleNameToDirectoryMap.clear();
|
|
33245
33329
|
}
|
|
33246
33330
|
function update(options2) {
|
|
33247
|
-
directoryToModuleNameMap.update(options2);
|
|
33248
33331
|
moduleNameToDirectoryMap.update(options2);
|
|
33249
33332
|
}
|
|
33250
|
-
function
|
|
33333
|
+
function getFromNonRelativeNameCache(nonRelativeModuleName, mode, directoryName, redirectedReference) {
|
|
33334
|
+
var _a2, _b;
|
|
33335
|
+
Debug.assert(!isExternalModuleNameRelative(nonRelativeModuleName));
|
|
33336
|
+
return (_b = (_a2 = moduleNameToDirectoryMap.getMapOfCacheRedirects(redirectedReference)) == null ? void 0 : _a2.get(createModeAwareCacheKey(nonRelativeModuleName, mode))) == null ? void 0 : _b.get(directoryName);
|
|
33337
|
+
}
|
|
33338
|
+
function getOrCreateCacheForNonRelativeName(nonRelativeModuleName, mode, redirectedReference) {
|
|
33251
33339
|
Debug.assert(!isExternalModuleNameRelative(nonRelativeModuleName));
|
|
33252
33340
|
return getOrCreateCache(moduleNameToDirectoryMap, redirectedReference, createModeAwareCacheKey(nonRelativeModuleName, mode), createPerModuleNameCache);
|
|
33253
33341
|
}
|
|
@@ -33263,7 +33351,7 @@ function createModuleResolutionCache(currentDirectory, getCanonicalFileName, opt
|
|
|
33263
33351
|
return;
|
|
33264
33352
|
}
|
|
33265
33353
|
directoryPathMap.set(path, result);
|
|
33266
|
-
const resolvedFileName =
|
|
33354
|
+
const resolvedFileName = getResolvedFileName(result);
|
|
33267
33355
|
const commonPrefix = resolvedFileName && getCommonPrefix(path, resolvedFileName);
|
|
33268
33356
|
let current = path;
|
|
33269
33357
|
while (current !== commonPrefix) {
|
|
@@ -33297,14 +33385,22 @@ function createModuleResolutionCache(currentDirectory, getCanonicalFileName, opt
|
|
|
33297
33385
|
}
|
|
33298
33386
|
}
|
|
33299
33387
|
}
|
|
33300
|
-
function
|
|
33301
|
-
const
|
|
33302
|
-
const
|
|
33303
|
-
|
|
33388
|
+
function createModuleOrTypeReferenceResolutionCache(currentDirectory, getCanonicalFileName, options, packageJsonInfoCache, getResolvedFileName) {
|
|
33389
|
+
const perDirectoryResolutionCache = createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, options);
|
|
33390
|
+
const nonRelativeNameResolutionCache = createNonRelativeNameResolutionCache(
|
|
33391
|
+
currentDirectory,
|
|
33392
|
+
getCanonicalFileName,
|
|
33393
|
+
options,
|
|
33394
|
+
getResolvedFileName
|
|
33395
|
+
);
|
|
33396
|
+
packageJsonInfoCache != null ? packageJsonInfoCache : packageJsonInfoCache = createPackageJsonInfoCache(currentDirectory, getCanonicalFileName);
|
|
33304
33397
|
return {
|
|
33305
33398
|
...packageJsonInfoCache,
|
|
33306
33399
|
...perDirectoryResolutionCache,
|
|
33400
|
+
...nonRelativeNameResolutionCache,
|
|
33307
33401
|
clear: clear2,
|
|
33402
|
+
update,
|
|
33403
|
+
getPackageJsonInfoCache: () => packageJsonInfoCache,
|
|
33308
33404
|
clearAllExceptPackageJsonInfoCache
|
|
33309
33405
|
};
|
|
33310
33406
|
function clear2() {
|
|
@@ -33313,8 +33409,33 @@ function createTypeReferenceDirectiveResolutionCache(currentDirectory, getCanoni
|
|
|
33313
33409
|
}
|
|
33314
33410
|
function clearAllExceptPackageJsonInfoCache() {
|
|
33315
33411
|
perDirectoryResolutionCache.clear();
|
|
33412
|
+
nonRelativeNameResolutionCache.clear();
|
|
33413
|
+
}
|
|
33414
|
+
function update(options2) {
|
|
33415
|
+
perDirectoryResolutionCache.update(options2);
|
|
33416
|
+
nonRelativeNameResolutionCache.update(options2);
|
|
33316
33417
|
}
|
|
33317
33418
|
}
|
|
33419
|
+
function createModuleResolutionCache(currentDirectory, getCanonicalFileName, options) {
|
|
33420
|
+
const result = createModuleOrTypeReferenceResolutionCache(
|
|
33421
|
+
currentDirectory,
|
|
33422
|
+
getCanonicalFileName,
|
|
33423
|
+
options,
|
|
33424
|
+
void 0,
|
|
33425
|
+
getOriginalOrResolvedModuleFileName
|
|
33426
|
+
);
|
|
33427
|
+
result.getOrCreateCacheForModuleName = (nonRelativeName, mode, redirectedReference) => result.getOrCreateCacheForNonRelativeName(nonRelativeName, mode, redirectedReference);
|
|
33428
|
+
return result;
|
|
33429
|
+
}
|
|
33430
|
+
function createTypeReferenceDirectiveResolutionCache(currentDirectory, getCanonicalFileName, options, packageJsonInfoCache) {
|
|
33431
|
+
return createModuleOrTypeReferenceResolutionCache(
|
|
33432
|
+
currentDirectory,
|
|
33433
|
+
getCanonicalFileName,
|
|
33434
|
+
options,
|
|
33435
|
+
packageJsonInfoCache,
|
|
33436
|
+
getOriginalOrResolvedTypeReferenceFileName
|
|
33437
|
+
);
|
|
33438
|
+
}
|
|
33318
33439
|
function resolveModuleName(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
33319
33440
|
const traceEnabled = isTraceEnabled(compilerOptions, host);
|
|
33320
33441
|
if (redirectedReference) {
|
|
@@ -33327,8 +33448,7 @@ function resolveModuleName(moduleName, containingFile, compilerOptions, host, ca
|
|
|
33327
33448
|
}
|
|
33328
33449
|
}
|
|
33329
33450
|
const containingDirectory = getDirectoryPath(containingFile);
|
|
33330
|
-
|
|
33331
|
-
let result = perFolderCache && perFolderCache.get(moduleName, resolutionMode);
|
|
33451
|
+
let result = cache == null ? void 0 : cache.getFromDirectoryCache(moduleName, resolutionMode, containingDirectory, redirectedReference);
|
|
33332
33452
|
if (result) {
|
|
33333
33453
|
if (traceEnabled) {
|
|
33334
33454
|
trace(host, Diagnostics.Resolution_for_module_0_was_found_in_cache_from_location_1, moduleName, containingDirectory);
|
|
@@ -33378,11 +33498,9 @@ function resolveModuleName(moduleName, containingFile, compilerOptions, host, ca
|
|
|
33378
33498
|
if (result && result.resolvedModule)
|
|
33379
33499
|
perfLogger.logInfoEvent(`Module "${moduleName}" resolved to "${result.resolvedModule.resolvedFileName}"`);
|
|
33380
33500
|
perfLogger.logStopResolveModule(result && result.resolvedModule ? "" + result.resolvedModule.resolvedFileName : "null");
|
|
33381
|
-
|
|
33382
|
-
|
|
33383
|
-
|
|
33384
|
-
cache.getOrCreateCacheForModuleName(moduleName, resolutionMode, redirectedReference).set(containingDirectory, result);
|
|
33385
|
-
}
|
|
33501
|
+
cache == null ? void 0 : cache.getOrCreateCacheForDirectory(containingDirectory, redirectedReference).set(moduleName, resolutionMode, result);
|
|
33502
|
+
if (!isExternalModuleNameRelative(moduleName)) {
|
|
33503
|
+
cache == null ? void 0 : cache.getOrCreateCacheForNonRelativeName(moduleName, resolutionMode, redirectedReference).set(containingDirectory, result);
|
|
33386
33504
|
}
|
|
33387
33505
|
}
|
|
33388
33506
|
if (traceEnabled) {
|
|
@@ -34292,7 +34410,7 @@ function loadModuleFromNearestNodeModulesDirectoryTypesScope(moduleName, directo
|
|
|
34292
34410
|
return loadModuleFromNearestNodeModulesDirectoryWorker(4 /* Declaration */, moduleName, directory, state, true, void 0, void 0);
|
|
34293
34411
|
}
|
|
34294
34412
|
function loadModuleFromNearestNodeModulesDirectoryWorker(extensions, moduleName, directory, state, typesScopeOnly, cache, redirectedReference) {
|
|
34295
|
-
const
|
|
34413
|
+
const mode = state.features === 0 ? void 0 : state.features & 32 /* EsmMode */ ? 99 /* ESNext */ : 1 /* CommonJS */;
|
|
34296
34414
|
const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
|
|
34297
34415
|
const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
|
|
34298
34416
|
if (priorityExtensions) {
|
|
@@ -34306,7 +34424,7 @@ function loadModuleFromNearestNodeModulesDirectoryWorker(extensions, moduleName,
|
|
|
34306
34424
|
function lookup(extensions2) {
|
|
34307
34425
|
return forEachAncestorDirectory(normalizeSlashes(directory), (ancestorDirectory) => {
|
|
34308
34426
|
if (getBaseFileName(ancestorDirectory) !== "node_modules") {
|
|
34309
|
-
const resolutionFromCache = tryFindNonRelativeModuleNameInCache(
|
|
34427
|
+
const resolutionFromCache = tryFindNonRelativeModuleNameInCache(cache, moduleName, mode, ancestorDirectory, redirectedReference, state);
|
|
34310
34428
|
if (resolutionFromCache) {
|
|
34311
34429
|
return resolutionFromCache;
|
|
34312
34430
|
}
|
|
@@ -34452,8 +34570,8 @@ function getPackageNameFromTypesPackageName(mangledName) {
|
|
|
34452
34570
|
function unmangleScopedPackageName(typesPackageName) {
|
|
34453
34571
|
return stringContains(typesPackageName, mangledScopedPackageSeparator) ? "@" + typesPackageName.replace(mangledScopedPackageSeparator, directorySeparator) : typesPackageName;
|
|
34454
34572
|
}
|
|
34455
|
-
function tryFindNonRelativeModuleNameInCache(cache, moduleName, containingDirectory, state) {
|
|
34456
|
-
const result = cache && cache.
|
|
34573
|
+
function tryFindNonRelativeModuleNameInCache(cache, moduleName, mode, containingDirectory, redirectedReference, state) {
|
|
34574
|
+
const result = cache && cache.getFromNonRelativeNameCache(moduleName, mode, containingDirectory, redirectedReference);
|
|
34457
34575
|
if (result) {
|
|
34458
34576
|
if (state.traceEnabled) {
|
|
34459
34577
|
trace(state.host, Diagnostics.Resolution_for_module_0_was_found_in_cache_from_location_1, moduleName, containingDirectory);
|
|
@@ -34496,9 +34614,8 @@ function classicNameResolver(moduleName, containingFile, compilerOptions, host,
|
|
|
34496
34614
|
return { value: resolvedUsingSettings };
|
|
34497
34615
|
}
|
|
34498
34616
|
if (!isExternalModuleNameRelative(moduleName)) {
|
|
34499
|
-
const perModuleNameCache = cache && cache.getOrCreateCacheForModuleName(moduleName, void 0, redirectedReference);
|
|
34500
34617
|
const resolved2 = forEachAncestorDirectory(containingDirectory, (directory) => {
|
|
34501
|
-
const resolutionFromCache = tryFindNonRelativeModuleNameInCache(
|
|
34618
|
+
const resolutionFromCache = tryFindNonRelativeModuleNameInCache(cache, moduleName, void 0, directory, redirectedReference, state);
|
|
34502
34619
|
if (resolutionFromCache) {
|
|
34503
34620
|
return resolutionFromCache;
|
|
34504
34621
|
}
|
|
@@ -48770,7 +48887,7 @@ function createTypeChecker(host) {
|
|
|
48770
48887
|
return links.resolvedJSDocType;
|
|
48771
48888
|
}
|
|
48772
48889
|
function getSubstitutionType(baseType, constraint) {
|
|
48773
|
-
if (constraint.flags & 3 /* AnyOrUnknown */ || constraint === baseType
|
|
48890
|
+
if (constraint.flags & 3 /* AnyOrUnknown */ || constraint === baseType) {
|
|
48774
48891
|
return baseType;
|
|
48775
48892
|
}
|
|
48776
48893
|
const id = `${getTypeId(baseType)}>${getTypeId(constraint)}`;
|
|
@@ -62654,6 +62771,7 @@ function createTypeChecker(host) {
|
|
|
62654
62771
|
}
|
|
62655
62772
|
function checkExpressionWithTypeArguments(node) {
|
|
62656
62773
|
checkGrammarExpressionWithTypeArguments(node);
|
|
62774
|
+
forEach(node.typeArguments, checkSourceElement);
|
|
62657
62775
|
const exprType = node.kind === 230 /* ExpressionWithTypeArguments */ ? checkExpression(node.expression) : isThisIdentifier(node.exprName) ? checkThisExpression(node.exprName) : checkExpression(node.exprName);
|
|
62658
62776
|
const typeArguments = node.typeArguments;
|
|
62659
62777
|
if (exprType === silentNeverType || isErrorType(exprType) || !some(typeArguments)) {
|
|
@@ -98010,6 +98128,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
98010
98128
|
getSymlinkCache,
|
|
98011
98129
|
realpath: (_o = host.realpath) == null ? void 0 : _o.bind(host),
|
|
98012
98130
|
useCaseSensitiveFileNames: () => host.useCaseSensitiveFileNames(),
|
|
98131
|
+
getCanonicalFileName,
|
|
98013
98132
|
getFileIncludeReasons: () => fileReasons,
|
|
98014
98133
|
structureIsReused,
|
|
98015
98134
|
writeFile: writeFile2
|
|
@@ -98050,7 +98169,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
98050
98169
|
const containingFileName = getNormalizedAbsolutePath(containingFile.originalFileName, currentDirectory);
|
|
98051
98170
|
const containingDir = getDirectoryPath(containingFileName);
|
|
98052
98171
|
const redirectedReference = getRedirectReferenceForResolution(containingFile);
|
|
98053
|
-
const fromCache = moduleResolutionCache.
|
|
98172
|
+
const fromCache = moduleResolutionCache.getFromNonRelativeNameCache(name, mode, containingDir, redirectedReference);
|
|
98054
98173
|
if (fromCache)
|
|
98055
98174
|
addResolutionDiagnostics(fromCache);
|
|
98056
98175
|
}
|
|
@@ -100578,14 +100697,13 @@ var BuilderState;
|
|
|
100578
100697
|
const referencedMap = options.module !== 0 /* None */ && !isOutFile ? createManyToManyPathMap() : void 0;
|
|
100579
100698
|
const exportedModulesMap = referencedMap ? createManyToManyPathMap() : void 0;
|
|
100580
100699
|
const useOldState = canReuseOldState(referencedMap, oldState);
|
|
100581
|
-
const getCanonicalFileName = createGetCanonicalFileName(newProgram.useCaseSensitiveFileNames());
|
|
100582
100700
|
newProgram.getTypeChecker();
|
|
100583
100701
|
for (const sourceFile of newProgram.getSourceFiles()) {
|
|
100584
100702
|
const version2 = Debug.checkDefined(sourceFile.version, "Program intended to be used with Builder should have source files with versions set");
|
|
100585
100703
|
const oldUncommittedSignature = useOldState ? (_a2 = oldState.oldSignatures) == null ? void 0 : _a2.get(sourceFile.resolvedPath) : void 0;
|
|
100586
100704
|
const signature = oldUncommittedSignature === void 0 ? useOldState ? (_b = oldState.fileInfos.get(sourceFile.resolvedPath)) == null ? void 0 : _b.signature : void 0 : oldUncommittedSignature || void 0;
|
|
100587
100705
|
if (referencedMap) {
|
|
100588
|
-
const newReferences = getReferencedFiles(newProgram, sourceFile, getCanonicalFileName);
|
|
100706
|
+
const newReferences = getReferencedFiles(newProgram, sourceFile, newProgram.getCanonicalFileName);
|
|
100589
100707
|
if (newReferences) {
|
|
100590
100708
|
referencedMap.set(sourceFile.resolvedPath, newReferences);
|
|
100591
100709
|
}
|
|
@@ -100647,6 +100765,26 @@ var BuilderState;
|
|
|
100647
100765
|
(state.hasCalledUpdateShapeSignature || (state.hasCalledUpdateShapeSignature = /* @__PURE__ */ new Set())).add(path);
|
|
100648
100766
|
}
|
|
100649
100767
|
BuilderState2.updateSignatureOfFile = updateSignatureOfFile;
|
|
100768
|
+
function computeDtsSignature(programOfThisState, sourceFile, cancellationToken, host, onNewSignature) {
|
|
100769
|
+
programOfThisState.emit(
|
|
100770
|
+
sourceFile,
|
|
100771
|
+
(fileName, text, _writeByteOrderMark, _onError, sourceFiles, data) => {
|
|
100772
|
+
Debug.assert(isDeclarationFileName(fileName), `File extension for signature expected to be dts: Got:: ${fileName}`);
|
|
100773
|
+
onNewSignature(computeSignatureWithDiagnostics(
|
|
100774
|
+
programOfThisState,
|
|
100775
|
+
sourceFile,
|
|
100776
|
+
text,
|
|
100777
|
+
host,
|
|
100778
|
+
data
|
|
100779
|
+
), sourceFiles);
|
|
100780
|
+
},
|
|
100781
|
+
cancellationToken,
|
|
100782
|
+
true,
|
|
100783
|
+
void 0,
|
|
100784
|
+
true
|
|
100785
|
+
);
|
|
100786
|
+
}
|
|
100787
|
+
BuilderState2.computeDtsSignature = computeDtsSignature;
|
|
100650
100788
|
function updateShapeSignature(state, programOfThisState, sourceFile, cancellationToken, host, useFileVersionAsSignature = state.useFileVersionAsSignature) {
|
|
100651
100789
|
var _a2;
|
|
100652
100790
|
if ((_a2 = state.hasCalledUpdateShapeSignature) == null ? void 0 : _a2.has(sourceFile.resolvedPath))
|
|
@@ -100655,26 +100793,12 @@ var BuilderState;
|
|
|
100655
100793
|
const prevSignature = info.signature;
|
|
100656
100794
|
let latestSignature;
|
|
100657
100795
|
if (!sourceFile.isDeclarationFile && !useFileVersionAsSignature) {
|
|
100658
|
-
programOfThisState
|
|
100659
|
-
|
|
100660
|
-
(
|
|
100661
|
-
|
|
100662
|
-
|
|
100663
|
-
|
|
100664
|
-
sourceFile,
|
|
100665
|
-
text,
|
|
100666
|
-
host,
|
|
100667
|
-
data
|
|
100668
|
-
);
|
|
100669
|
-
if (latestSignature !== prevSignature) {
|
|
100670
|
-
updateExportedModules(state, sourceFile, sourceFiles[0].exportedModulesFromDeclarationEmit);
|
|
100671
|
-
}
|
|
100672
|
-
},
|
|
100673
|
-
cancellationToken,
|
|
100674
|
-
true,
|
|
100675
|
-
void 0,
|
|
100676
|
-
true
|
|
100677
|
-
);
|
|
100796
|
+
computeDtsSignature(programOfThisState, sourceFile, cancellationToken, host, (signature, sourceFiles) => {
|
|
100797
|
+
latestSignature = signature;
|
|
100798
|
+
if (latestSignature !== prevSignature) {
|
|
100799
|
+
updateExportedModules(state, sourceFile, sourceFiles[0].exportedModulesFromDeclarationEmit);
|
|
100800
|
+
}
|
|
100801
|
+
});
|
|
100678
100802
|
}
|
|
100679
100803
|
if (latestSignature === void 0) {
|
|
100680
100804
|
latestSignature = sourceFile.version;
|
|
@@ -100698,27 +100822,24 @@ var BuilderState;
|
|
|
100698
100822
|
if (!state.exportedModulesMap)
|
|
100699
100823
|
return;
|
|
100700
100824
|
(state.oldExportedModulesMap || (state.oldExportedModulesMap = /* @__PURE__ */ new Map())).set(sourceFile.resolvedPath, state.exportedModulesMap.getValues(sourceFile.resolvedPath) || false);
|
|
100701
|
-
|
|
100702
|
-
state.exportedModulesMap.deleteKey(sourceFile.resolvedPath);
|
|
100703
|
-
return;
|
|
100704
|
-
}
|
|
100705
|
-
let exportedModules;
|
|
100706
|
-
exportedModulesFromDeclarationEmit.forEach((symbol) => addExportedModule(getReferencedFilesFromImportedModuleSymbol(symbol)));
|
|
100825
|
+
const exportedModules = getExportedModules(exportedModulesFromDeclarationEmit);
|
|
100707
100826
|
if (exportedModules) {
|
|
100708
100827
|
state.exportedModulesMap.set(sourceFile.resolvedPath, exportedModules);
|
|
100709
100828
|
} else {
|
|
100710
100829
|
state.exportedModulesMap.deleteKey(sourceFile.resolvedPath);
|
|
100711
100830
|
}
|
|
100712
|
-
function addExportedModule(exportedModulePaths) {
|
|
100713
|
-
if (exportedModulePaths == null ? void 0 : exportedModulePaths.length) {
|
|
100714
|
-
if (!exportedModules) {
|
|
100715
|
-
exportedModules = /* @__PURE__ */ new Set();
|
|
100716
|
-
}
|
|
100717
|
-
exportedModulePaths.forEach((path) => exportedModules.add(path));
|
|
100718
|
-
}
|
|
100719
|
-
}
|
|
100720
100831
|
}
|
|
100721
100832
|
BuilderState2.updateExportedModules = updateExportedModules;
|
|
100833
|
+
function getExportedModules(exportedModulesFromDeclarationEmit) {
|
|
100834
|
+
let exportedModules;
|
|
100835
|
+
exportedModulesFromDeclarationEmit == null ? void 0 : exportedModulesFromDeclarationEmit.forEach(
|
|
100836
|
+
(symbol) => getReferencedFilesFromImportedModuleSymbol(symbol).forEach(
|
|
100837
|
+
(path) => (exportedModules != null ? exportedModules : exportedModules = /* @__PURE__ */ new Set()).add(path)
|
|
100838
|
+
)
|
|
100839
|
+
);
|
|
100840
|
+
return exportedModules;
|
|
100841
|
+
}
|
|
100842
|
+
BuilderState2.getExportedModules = getExportedModules;
|
|
100722
100843
|
function getAllDependencies(state, programOfThisState, sourceFile) {
|
|
100723
100844
|
const compilerOptions = programOfThisState.getCompilerOptions();
|
|
100724
100845
|
if (outFile(compilerOptions)) {
|
|
@@ -100860,9 +100981,9 @@ function getPendingEmitKind(optionsOrEmitKind, oldOptionsOrEmitKind) {
|
|
|
100860
100981
|
function hasSameKeys(map1, map2) {
|
|
100861
100982
|
return map1 === map2 || map1 !== void 0 && map2 !== void 0 && map1.size === map2.size && !forEachKey(map1, (key) => !map2.has(key));
|
|
100862
100983
|
}
|
|
100863
|
-
function createBuilderProgramState(newProgram, oldState
|
|
100984
|
+
function createBuilderProgramState(newProgram, oldState) {
|
|
100864
100985
|
var _a2, _b;
|
|
100865
|
-
const state = BuilderState.create(newProgram, oldState,
|
|
100986
|
+
const state = BuilderState.create(newProgram, oldState, false);
|
|
100866
100987
|
state.program = newProgram;
|
|
100867
100988
|
const compilerOptions = newProgram.getCompilerOptions();
|
|
100868
100989
|
state.compilerOptions = compilerOptions;
|
|
@@ -100970,7 +101091,6 @@ function convertToDiagnostics(diagnostics, newProgram) {
|
|
|
100970
101091
|
if (!diagnostics.length)
|
|
100971
101092
|
return emptyArray;
|
|
100972
101093
|
let buildInfoDirectory;
|
|
100973
|
-
let getCanonicalFileName;
|
|
100974
101094
|
return diagnostics.map((diagnostic) => {
|
|
100975
101095
|
const result = convertToDiagnosticRelatedInformation(diagnostic, newProgram, toPath3);
|
|
100976
101096
|
result.reportsUnnecessary = diagnostic.reportsUnnecessary;
|
|
@@ -100983,7 +101103,7 @@ function convertToDiagnostics(diagnostics, newProgram) {
|
|
|
100983
101103
|
});
|
|
100984
101104
|
function toPath3(path) {
|
|
100985
101105
|
buildInfoDirectory != null ? buildInfoDirectory : buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(getTsBuildInfoEmitOutputFilePath(newProgram.getCompilerOptions()), newProgram.getCurrentDirectory()));
|
|
100986
|
-
return toPath(path, buildInfoDirectory,
|
|
101106
|
+
return toPath(path, buildInfoDirectory, newProgram.getCanonicalFileName);
|
|
100987
101107
|
}
|
|
100988
101108
|
}
|
|
100989
101109
|
function convertToDiagnosticRelatedInformation(diagnostic, newProgram, toPath3) {
|
|
@@ -101154,7 +101274,7 @@ function handleDtsMayChangeOf(state, path, cancellationToken, host) {
|
|
|
101154
101274
|
sourceFile,
|
|
101155
101275
|
cancellationToken,
|
|
101156
101276
|
host,
|
|
101157
|
-
|
|
101277
|
+
true
|
|
101158
101278
|
);
|
|
101159
101279
|
if (getEmitDeclarations(state.compilerOptions)) {
|
|
101160
101280
|
addToAffectedFilesPendingEmit(state, path, state.compilerOptions.declarationMap ? 24 /* AllDts */ : 8 /* Dts */);
|
|
@@ -101281,7 +101401,6 @@ function isProgramBundleEmitBuildInfo(info) {
|
|
|
101281
101401
|
function getBuildInfo2(state, bundle) {
|
|
101282
101402
|
var _a2, _b, _c;
|
|
101283
101403
|
const currentDirectory = Debug.checkDefined(state.program).getCurrentDirectory();
|
|
101284
|
-
const getCanonicalFileName = createGetCanonicalFileName(state.program.useCaseSensitiveFileNames());
|
|
101285
101404
|
const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(getTsBuildInfoEmitOutputFilePath(state.compilerOptions), currentDirectory));
|
|
101286
101405
|
const latestChangedDtsFile = state.latestChangedDtsFile ? relativeToBuildInfoEnsuringAbsolutePath(state.latestChangedDtsFile) : void 0;
|
|
101287
101406
|
const fileNames = [];
|
|
@@ -101399,7 +101518,7 @@ function getBuildInfo2(state, bundle) {
|
|
|
101399
101518
|
return relativeToBuildInfo(getNormalizedAbsolutePath(path, currentDirectory));
|
|
101400
101519
|
}
|
|
101401
101520
|
function relativeToBuildInfo(path) {
|
|
101402
|
-
return ensurePathIsNonModuleName(getRelativePathFromDirectory(buildInfoDirectory, path, getCanonicalFileName));
|
|
101521
|
+
return ensurePathIsNonModuleName(getRelativePathFromDirectory(buildInfoDirectory, path, state.program.getCanonicalFileName));
|
|
101403
101522
|
}
|
|
101404
101523
|
function toFileId(path) {
|
|
101405
101524
|
let fileId = fileNameToFileId.get(path);
|
|
@@ -101437,6 +101556,7 @@ function getBuildInfo2(state, bundle) {
|
|
|
101437
101556
|
}
|
|
101438
101557
|
function convertToReusableCompilerOptionValue(option, value, relativeToBuildInfo) {
|
|
101439
101558
|
if (option) {
|
|
101559
|
+
Debug.assert(option.type !== "listOrElement");
|
|
101440
101560
|
if (option.type === "list") {
|
|
101441
101561
|
const values = value;
|
|
101442
101562
|
if (option.element.isFilePath && values.length) {
|
|
@@ -101502,7 +101622,6 @@ function getTextHandlingSourceMapForSignature(text, data) {
|
|
|
101502
101622
|
}
|
|
101503
101623
|
function computeSignatureWithDiagnostics(program, sourceFile, text, host, data) {
|
|
101504
101624
|
var _a2, _b;
|
|
101505
|
-
let getCanonicalFileName;
|
|
101506
101625
|
text = getTextHandlingSourceMapForSignature(text, data);
|
|
101507
101626
|
let sourceFileDirectory;
|
|
101508
101627
|
if ((_a2 = data == null ? void 0 : data.diagnostics) == null ? void 0 : _a2.length) {
|
|
@@ -101522,7 +101641,7 @@ function computeSignatureWithDiagnostics(program, sourceFile, text, host, data)
|
|
|
101522
101641
|
return `${ensurePathIsNonModuleName(getRelativePathFromDirectory(
|
|
101523
101642
|
sourceFileDirectory,
|
|
101524
101643
|
diagnostic.file.resolvedPath,
|
|
101525
|
-
|
|
101644
|
+
program.getCanonicalFileName
|
|
101526
101645
|
))}(${diagnostic.start},${diagnostic.length})`;
|
|
101527
101646
|
}
|
|
101528
101647
|
}
|
|
@@ -101537,7 +101656,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
101537
101656
|
oldState = void 0;
|
|
101538
101657
|
return oldProgram;
|
|
101539
101658
|
}
|
|
101540
|
-
const state = createBuilderProgramState(newProgram, oldState
|
|
101659
|
+
const state = createBuilderProgramState(newProgram, oldState);
|
|
101541
101660
|
newProgram.getBuildInfo = (bundle) => getBuildInfo2(state, bundle);
|
|
101542
101661
|
newProgram = void 0;
|
|
101543
101662
|
oldProgram = void 0;
|
|
@@ -101996,9 +102115,9 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
101996
102115
|
let filesWithInvalidatedResolutions;
|
|
101997
102116
|
let filesWithInvalidatedNonRelativeUnresolvedImports;
|
|
101998
102117
|
const nonRelativeExternalModuleResolutions = createMultiMap();
|
|
101999
|
-
const resolutionsWithFailedLookups =
|
|
102000
|
-
const resolutionsWithOnlyAffectingLocations =
|
|
102001
|
-
const resolvedFileToResolution =
|
|
102118
|
+
const resolutionsWithFailedLookups = /* @__PURE__ */ new Set();
|
|
102119
|
+
const resolutionsWithOnlyAffectingLocations = /* @__PURE__ */ new Set();
|
|
102120
|
+
const resolvedFileToResolution = /* @__PURE__ */ new Map();
|
|
102002
102121
|
const impliedFormatPackageJsons = /* @__PURE__ */ new Map();
|
|
102003
102122
|
let hasChangedAutomaticTypeDirectiveNames = false;
|
|
102004
102123
|
let affectingPathChecksForFile;
|
|
@@ -102071,8 +102190,8 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
102071
102190
|
resolvedModuleNames.clear();
|
|
102072
102191
|
resolvedTypeReferenceDirectives.clear();
|
|
102073
102192
|
resolvedFileToResolution.clear();
|
|
102074
|
-
resolutionsWithFailedLookups.
|
|
102075
|
-
resolutionsWithOnlyAffectingLocations.
|
|
102193
|
+
resolutionsWithFailedLookups.clear();
|
|
102194
|
+
resolutionsWithOnlyAffectingLocations.clear();
|
|
102076
102195
|
failedLookupChecks = void 0;
|
|
102077
102196
|
startsWithPathChecks = void 0;
|
|
102078
102197
|
isInDirectoryChecks = void 0;
|
|
@@ -102389,12 +102508,13 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
102389
102508
|
return fileExtensionIsOneOf(path, failedLookupDefaultExtensions);
|
|
102390
102509
|
}
|
|
102391
102510
|
function watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, filePath, getResolutionWithResolvedFileName) {
|
|
102511
|
+
var _a2, _b;
|
|
102392
102512
|
if (resolution.refCount) {
|
|
102393
102513
|
resolution.refCount++;
|
|
102394
102514
|
Debug.assertIsDefined(resolution.files);
|
|
102395
102515
|
} else {
|
|
102396
102516
|
resolution.refCount = 1;
|
|
102397
|
-
Debug.assert(
|
|
102517
|
+
Debug.assert(!((_a2 = resolution.files) == null ? void 0 : _a2.size));
|
|
102398
102518
|
if (isExternalModuleNameRelative(name)) {
|
|
102399
102519
|
watchFailedLookupLocationOfResolution(resolution);
|
|
102400
102520
|
} else {
|
|
@@ -102402,10 +102522,14 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
102402
102522
|
}
|
|
102403
102523
|
const resolved = getResolutionWithResolvedFileName(resolution);
|
|
102404
102524
|
if (resolved && resolved.resolvedFileName) {
|
|
102405
|
-
|
|
102525
|
+
const key = resolutionHost.toPath(resolved.resolvedFileName);
|
|
102526
|
+
let resolutions = resolvedFileToResolution.get(key);
|
|
102527
|
+
if (!resolutions)
|
|
102528
|
+
resolvedFileToResolution.set(key, resolutions = /* @__PURE__ */ new Set());
|
|
102529
|
+
resolutions.add(resolution);
|
|
102406
102530
|
}
|
|
102407
102531
|
}
|
|
102408
|
-
(resolution.files
|
|
102532
|
+
((_b = resolution.files) != null ? _b : resolution.files = /* @__PURE__ */ new Set()).add(filePath);
|
|
102409
102533
|
}
|
|
102410
102534
|
function watchFailedLookupLocationOfResolution(resolution) {
|
|
102411
102535
|
Debug.assert(!!resolution.refCount);
|
|
@@ -102413,7 +102537,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
102413
102537
|
if (!(failedLookupLocations == null ? void 0 : failedLookupLocations.length) && !(affectingLocations == null ? void 0 : affectingLocations.length))
|
|
102414
102538
|
return;
|
|
102415
102539
|
if (failedLookupLocations == null ? void 0 : failedLookupLocations.length)
|
|
102416
|
-
resolutionsWithFailedLookups.
|
|
102540
|
+
resolutionsWithFailedLookups.add(resolution);
|
|
102417
102541
|
let setAtRoot = false;
|
|
102418
102542
|
if (failedLookupLocations) {
|
|
102419
102543
|
for (const failedLookupLocation of failedLookupLocations) {
|
|
@@ -102445,7 +102569,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
102445
102569
|
if (!(affectingLocations == null ? void 0 : affectingLocations.length))
|
|
102446
102570
|
return;
|
|
102447
102571
|
if (addToResolutionsWithOnlyAffectingLocations)
|
|
102448
|
-
resolutionsWithOnlyAffectingLocations.
|
|
102572
|
+
resolutionsWithOnlyAffectingLocations.add(resolution);
|
|
102449
102573
|
for (const affectingLocation of affectingLocations) {
|
|
102450
102574
|
createFileWatcherOfAffectingLocation(affectingLocation, true);
|
|
102451
102575
|
}
|
|
@@ -102524,17 +102648,20 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
102524
102648
|
}
|
|
102525
102649
|
}
|
|
102526
102650
|
function stopWatchFailedLookupLocationOfResolution(resolution, filePath, getResolutionWithResolvedFileName) {
|
|
102527
|
-
|
|
102651
|
+
Debug.checkDefined(resolution.files).delete(filePath);
|
|
102528
102652
|
resolution.refCount--;
|
|
102529
102653
|
if (resolution.refCount) {
|
|
102530
102654
|
return;
|
|
102531
102655
|
}
|
|
102532
102656
|
const resolved = getResolutionWithResolvedFileName(resolution);
|
|
102533
102657
|
if (resolved && resolved.resolvedFileName) {
|
|
102534
|
-
|
|
102658
|
+
const key = resolutionHost.toPath(resolved.resolvedFileName);
|
|
102659
|
+
const resolutions = resolvedFileToResolution.get(key);
|
|
102660
|
+
if ((resolutions == null ? void 0 : resolutions.delete(resolution)) && !resolutions.size)
|
|
102661
|
+
resolvedFileToResolution.delete(key);
|
|
102535
102662
|
}
|
|
102536
102663
|
const { failedLookupLocations, affectingLocations } = resolution;
|
|
102537
|
-
if (
|
|
102664
|
+
if (resolutionsWithFailedLookups.delete(resolution)) {
|
|
102538
102665
|
let removeAtRoot = false;
|
|
102539
102666
|
for (const failedLookupLocation of failedLookupLocations) {
|
|
102540
102667
|
const failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation);
|
|
@@ -102561,7 +102688,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
102561
102688
|
removeDirectoryWatcher(rootPath);
|
|
102562
102689
|
}
|
|
102563
102690
|
} else if (affectingLocations == null ? void 0 : affectingLocations.length) {
|
|
102564
|
-
|
|
102691
|
+
resolutionsWithOnlyAffectingLocations.delete(resolution);
|
|
102565
102692
|
}
|
|
102566
102693
|
if (affectingLocations) {
|
|
102567
102694
|
for (const affectingLocation of affectingLocations) {
|
|
@@ -102609,15 +102736,15 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
102609
102736
|
if (!resolutions)
|
|
102610
102737
|
return false;
|
|
102611
102738
|
let invalidated = false;
|
|
102612
|
-
|
|
102739
|
+
resolutions.forEach((resolution) => {
|
|
102613
102740
|
if (resolution.isInvalidated || !canInvalidate(resolution))
|
|
102614
|
-
|
|
102741
|
+
return;
|
|
102615
102742
|
resolution.isInvalidated = invalidated = true;
|
|
102616
102743
|
for (const containingFilePath of Debug.checkDefined(resolution.files)) {
|
|
102617
102744
|
(filesWithInvalidatedResolutions != null ? filesWithInvalidatedResolutions : filesWithInvalidatedResolutions = /* @__PURE__ */ new Set()).add(containingFilePath);
|
|
102618
102745
|
hasChangedAutomaticTypeDirectiveNames = hasChangedAutomaticTypeDirectiveNames || endsWith(containingFilePath, inferredTypesContainingFile);
|
|
102619
102746
|
}
|
|
102620
|
-
}
|
|
102747
|
+
});
|
|
102621
102748
|
return invalidated;
|
|
102622
102749
|
}
|
|
102623
102750
|
function invalidateResolutionOfFile(filePath) {
|
|
@@ -102912,8 +103039,7 @@ function listFiles(program, write) {
|
|
|
102912
103039
|
function explainFiles(program, write) {
|
|
102913
103040
|
var _a2, _b;
|
|
102914
103041
|
const reasons = program.getFileIncludeReasons();
|
|
102915
|
-
const
|
|
102916
|
-
const relativeFileName = (fileName) => convertToRelativePath(fileName, program.getCurrentDirectory(), getCanonicalFileName);
|
|
103042
|
+
const relativeFileName = (fileName) => convertToRelativePath(fileName, program.getCurrentDirectory(), program.getCanonicalFileName);
|
|
102917
103043
|
for (const file of program.getSourceFiles()) {
|
|
102918
103044
|
write(`${toFileName(file, relativeFileName)}`);
|
|
102919
103045
|
(_a2 = reasons.get(file.path)) == null ? void 0 : _a2.forEach((reason) => write(` ${fileIncludeReasonToDiagnostics(program, reason, relativeFileName).messageText}`));
|
|
@@ -102971,10 +103097,9 @@ function getMatchedFileSpec(program, fileName) {
|
|
|
102971
103097
|
const configFile = program.getCompilerOptions().configFile;
|
|
102972
103098
|
if (!((_a2 = configFile == null ? void 0 : configFile.configFileSpecs) == null ? void 0 : _a2.validatedFilesSpec))
|
|
102973
103099
|
return void 0;
|
|
102974
|
-
const
|
|
102975
|
-
const filePath = getCanonicalFileName(fileName);
|
|
103100
|
+
const filePath = program.getCanonicalFileName(fileName);
|
|
102976
103101
|
const basePath = getDirectoryPath(getNormalizedAbsolutePath(configFile.fileName, program.getCurrentDirectory()));
|
|
102977
|
-
return find(configFile.configFileSpecs.validatedFilesSpec, (fileSpec) => getCanonicalFileName(getNormalizedAbsolutePath(fileSpec, basePath)) === filePath);
|
|
103102
|
+
return find(configFile.configFileSpecs.validatedFilesSpec, (fileSpec) => program.getCanonicalFileName(getNormalizedAbsolutePath(fileSpec, basePath)) === filePath);
|
|
102978
103103
|
}
|
|
102979
103104
|
function getMatchedIncludeSpec(program, fileName) {
|
|
102980
103105
|
var _a2, _b;
|
|
@@ -103207,7 +103332,6 @@ function createCompilerHostFromProgramHost(host, getCompilerOptions, directorySt
|
|
|
103207
103332
|
getEnvironmentVariable: maybeBind(host, host.getEnvironmentVariable) || (() => ""),
|
|
103208
103333
|
createHash: maybeBind(host, host.createHash),
|
|
103209
103334
|
readDirectory: maybeBind(host, host.readDirectory),
|
|
103210
|
-
disableUseFileVersionAsSignature: host.disableUseFileVersionAsSignature,
|
|
103211
103335
|
storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit
|
|
103212
103336
|
};
|
|
103213
103337
|
return compilerHost;
|
|
@@ -103274,7 +103398,6 @@ function createProgramHost(system, createProgram2) {
|
|
|
103274
103398
|
writeFile: (path, data, writeByteOrderMark) => system.writeFile(path, data, writeByteOrderMark),
|
|
103275
103399
|
createHash: maybeBind(system, system.createHash),
|
|
103276
103400
|
createProgram: createProgram2 || createEmitAndSemanticDiagnosticsBuilderProgram,
|
|
103277
|
-
disableUseFileVersionAsSignature: system.disableUseFileVersionAsSignature,
|
|
103278
103401
|
storeFilesChangingSignatureDuringEmit: system.storeFilesChangingSignatureDuringEmit,
|
|
103279
103402
|
now: maybeBind(system, system.now)
|
|
103280
103403
|
};
|
|
@@ -103376,7 +103499,6 @@ function readBuilderProgram(compilerOptions, host) {
|
|
|
103376
103499
|
function createIncrementalCompilerHost(options, system = sys) {
|
|
103377
103500
|
const host = createCompilerHostWorker(options, void 0, system);
|
|
103378
103501
|
host.createHash = maybeBind(system, system.createHash);
|
|
103379
|
-
host.disableUseFileVersionAsSignature = system.disableUseFileVersionAsSignature;
|
|
103380
103502
|
host.storeFilesChangingSignatureDuringEmit = system.storeFilesChangingSignatureDuringEmit;
|
|
103381
103503
|
setGetSourceFileAsHashVersioned(host);
|
|
103382
103504
|
changeCompilerHostLikeToUseCache(host, (fileName) => toPath(fileName, host.getCurrentDirectory(), host.getCanonicalFileName));
|
|
@@ -104111,8 +104233,6 @@ function createSolutionBuilderWithWatch(host, rootNames, defaultOptions, baseWat
|
|
|
104111
104233
|
function createSolutionBuilderState(watch, hostOrHostWithWatch, rootNames, options, baseWatchOptions) {
|
|
104112
104234
|
const host = hostOrHostWithWatch;
|
|
104113
104235
|
const hostWithWatch = hostOrHostWithWatch;
|
|
104114
|
-
const currentDirectory = host.getCurrentDirectory();
|
|
104115
|
-
const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames());
|
|
104116
104236
|
const baseCompilerOptions = getCompilerOptionsOfBuildOptions(options);
|
|
104117
104237
|
const compilerHost = createCompilerHostFromProgramHost(host, () => state.projectCompilerOptions);
|
|
104118
104238
|
setGetSourceFileAsHashVersioned(compilerHost);
|
|
@@ -104124,7 +104244,7 @@ function createSolutionBuilderState(watch, hostOrHostWithWatch, rootNames, optio
|
|
|
104124
104244
|
compilerHost.getModuleResolutionCache = maybeBind(host, host.getModuleResolutionCache);
|
|
104125
104245
|
let moduleResolutionCache, typeReferenceDirectiveResolutionCache;
|
|
104126
104246
|
if (!compilerHost.resolveModuleNameLiterals && !compilerHost.resolveModuleNames) {
|
|
104127
|
-
moduleResolutionCache = createModuleResolutionCache(
|
|
104247
|
+
moduleResolutionCache = createModuleResolutionCache(compilerHost.getCurrentDirectory(), compilerHost.getCanonicalFileName);
|
|
104128
104248
|
compilerHost.resolveModuleNameLiterals = (moduleNames, containingFile, redirectedReference, options2, containingSourceFile) => loadWithModeAwareCache(
|
|
104129
104249
|
moduleNames,
|
|
104130
104250
|
containingFile,
|
|
@@ -104138,7 +104258,7 @@ function createSolutionBuilderState(watch, hostOrHostWithWatch, rootNames, optio
|
|
|
104138
104258
|
compilerHost.getModuleResolutionCache = () => moduleResolutionCache;
|
|
104139
104259
|
}
|
|
104140
104260
|
if (!compilerHost.resolveTypeReferenceDirectiveReferences && !compilerHost.resolveTypeReferenceDirectives) {
|
|
104141
|
-
typeReferenceDirectiveResolutionCache = createTypeReferenceDirectiveResolutionCache(
|
|
104261
|
+
typeReferenceDirectiveResolutionCache = createTypeReferenceDirectiveResolutionCache(compilerHost.getCurrentDirectory(), compilerHost.getCanonicalFileName, void 0, moduleResolutionCache == null ? void 0 : moduleResolutionCache.getPackageJsonInfoCache());
|
|
104142
104262
|
compilerHost.resolveTypeReferenceDirectiveReferences = (typeDirectiveNames, containingFile, redirectedReference, options2, containingSourceFile) => loadWithModeAwareCache(
|
|
104143
104263
|
typeDirectiveNames,
|
|
104144
104264
|
containingFile,
|
|
@@ -104155,8 +104275,6 @@ function createSolutionBuilderState(watch, hostOrHostWithWatch, rootNames, optio
|
|
|
104155
104275
|
const state = {
|
|
104156
104276
|
host,
|
|
104157
104277
|
hostWithWatch,
|
|
104158
|
-
currentDirectory,
|
|
104159
|
-
getCanonicalFileName,
|
|
104160
104278
|
parseConfigFileHost: parseConfigHostFromCompilerHostLike(host),
|
|
104161
104279
|
write: maybeBind(host, host.trace),
|
|
104162
104280
|
options,
|
|
@@ -104200,7 +104318,7 @@ function createSolutionBuilderState(watch, hostOrHostWithWatch, rootNames, optio
|
|
|
104200
104318
|
return state;
|
|
104201
104319
|
}
|
|
104202
104320
|
function toPath2(state, fileName) {
|
|
104203
|
-
return toPath(fileName, state.
|
|
104321
|
+
return toPath(fileName, state.compilerHost.getCurrentDirectory(), state.compilerHost.getCanonicalFileName);
|
|
104204
104322
|
}
|
|
104205
104323
|
function toResolvedConfigFilePath(state, fileName) {
|
|
104206
104324
|
const { resolvedConfigFilePaths } = state;
|
|
@@ -104243,7 +104361,7 @@ function parseConfigFile(state, configFileName, configFilePath) {
|
|
|
104243
104361
|
return parsed;
|
|
104244
104362
|
}
|
|
104245
104363
|
function resolveProjectName(state, name) {
|
|
104246
|
-
return resolveConfigFileProjectName(resolvePath(state.
|
|
104364
|
+
return resolveConfigFileProjectName(resolvePath(state.compilerHost.getCurrentDirectory(), name));
|
|
104247
104365
|
}
|
|
104248
104366
|
function createBuildOrder(state, roots) {
|
|
104249
104367
|
const temporaryMarks = /* @__PURE__ */ new Map();
|
|
@@ -104446,7 +104564,7 @@ function createUpdateOutputFileStampsProject(state, project, projectPath, config
|
|
|
104446
104564
|
projectPath,
|
|
104447
104565
|
buildOrder,
|
|
104448
104566
|
getCompilerOptions: () => config.options,
|
|
104449
|
-
getCurrentDirectory: () => state.
|
|
104567
|
+
getCurrentDirectory: () => state.compilerHost.getCurrentDirectory(),
|
|
104450
104568
|
updateOutputFileStatmps: () => {
|
|
104451
104569
|
updateOutputTimestamps(state, config, projectPath);
|
|
104452
104570
|
updateOutputFileStampsPending = false;
|
|
@@ -104471,7 +104589,7 @@ function createBuildOrUpdateInvalidedProject(kind, state, project, projectPath,
|
|
|
104471
104589
|
projectPath,
|
|
104472
104590
|
buildOrder,
|
|
104473
104591
|
getCompilerOptions: () => config.options,
|
|
104474
|
-
getCurrentDirectory: () => state.
|
|
104592
|
+
getCurrentDirectory: () => state.compilerHost.getCurrentDirectory(),
|
|
104475
104593
|
getBuilderProgram: () => withProgramOrUndefined(identity),
|
|
104476
104594
|
getProgram: () => withProgramOrUndefined(
|
|
104477
104595
|
(program2) => program2.getProgramOrUndefined()
|
|
@@ -104527,7 +104645,7 @@ function createBuildOrUpdateInvalidedProject(kind, state, project, projectPath,
|
|
|
104527
104645
|
projectPath,
|
|
104528
104646
|
buildOrder,
|
|
104529
104647
|
getCompilerOptions: () => config.options,
|
|
104530
|
-
getCurrentDirectory: () => state.
|
|
104648
|
+
getCurrentDirectory: () => state.compilerHost.getCurrentDirectory(),
|
|
104531
104649
|
emit: (writeFile2, customTransformers) => {
|
|
104532
104650
|
if (step !== 4 /* EmitBundle */)
|
|
104533
104651
|
return invalidatedProjectOfBundle;
|
|
@@ -105634,7 +105752,7 @@ function watchWildCardDirectories(state, resolved, resolvedPath, parsed) {
|
|
|
105634
105752
|
fileOrDirectory,
|
|
105635
105753
|
fileOrDirectoryPath: toPath2(state, fileOrDirectory),
|
|
105636
105754
|
configFileName: resolved,
|
|
105637
|
-
currentDirectory: state.
|
|
105755
|
+
currentDirectory: state.compilerHost.getCurrentDirectory(),
|
|
105638
105756
|
options: parsed.options,
|
|
105639
105757
|
program: state.builderPrograms.get(resolvedPath) || ((_a2 = getCachedParsedConfigFile(state, resolvedPath)) == null ? void 0 : _a2.fileNames),
|
|
105640
105758
|
useCaseSensitiveFileNames: state.parseConfigFileHost.useCaseSensitiveFileNames,
|
|
@@ -105739,7 +105857,7 @@ function createSolutionBuilderWorker(watch, hostOrHostWithWatch, rootNames, opti
|
|
|
105739
105857
|
};
|
|
105740
105858
|
}
|
|
105741
105859
|
function relName(state, path) {
|
|
105742
|
-
return convertToRelativePath(path, state.
|
|
105860
|
+
return convertToRelativePath(path, state.compilerHost.getCurrentDirectory(), state.compilerHost.getCanonicalFileName);
|
|
105743
105861
|
}
|
|
105744
105862
|
function reportStatus(state, message, ...args) {
|
|
105745
105863
|
state.host.reportSolutionBuilderStatus(createCompilerDiagnostic(message, ...args));
|
|
@@ -106029,7 +106147,7 @@ function generateOptionOutput(sys2, option, rightAlignOfLeft, leftAlignOfRight)
|
|
|
106029
106147
|
const valueCandidates = getValueCandidate(option);
|
|
106030
106148
|
const defaultValueDescription = typeof option.defaultValueDescription === "object" ? getDiagnosticText(option.defaultValueDescription) : formatDefaultValue(
|
|
106031
106149
|
option.defaultValueDescription,
|
|
106032
|
-
option.type === "list" ? option.element.type : option.type
|
|
106150
|
+
option.type === "list" || option.type === "listOrElement" ? option.element.type : option.type
|
|
106033
106151
|
);
|
|
106034
106152
|
const terminalWidth = (_b = (_a2 = sys2.getWidthOfTerminal) == null ? void 0 : _a2.call(sys2)) != null ? _b : 0;
|
|
106035
106153
|
if (terminalWidth >= 80) {
|
|
@@ -106113,6 +106231,7 @@ function generateOptionOutput(sys2, option, rightAlignOfLeft, leftAlignOfRight)
|
|
|
106113
106231
|
possibleValues: getPossibleValues(option2)
|
|
106114
106232
|
};
|
|
106115
106233
|
function getValueType(option3) {
|
|
106234
|
+
Debug.assert(option3.type !== "listOrElement");
|
|
106116
106235
|
switch (option3.type) {
|
|
106117
106236
|
case "string":
|
|
106118
106237
|
case "number":
|
|
@@ -106133,6 +106252,7 @@ function generateOptionOutput(sys2, option, rightAlignOfLeft, leftAlignOfRight)
|
|
|
106133
106252
|
possibleValues = option3.type;
|
|
106134
106253
|
break;
|
|
106135
106254
|
case "list":
|
|
106255
|
+
case "listOrElement":
|
|
106136
106256
|
possibleValues = getPossibleValues(option3.element);
|
|
106137
106257
|
break;
|
|
106138
106258
|
case "object":
|