@typescript-deploys/pr-build 4.9.0-pr-50306-2 → 4.9.0-pr-50309-2
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 +13 -11
- package/lib/tsserver.js +64 -51
- package/lib/tsserverlibrary.js +64 -51
- package/lib/typescript.js +64 -51
- package/lib/typescriptServices.js +64 -51
- package/lib/typingsInstaller.js +16 -11
- package/package.json +1 -1
|
@@ -1153,6 +1153,13 @@ var ts;
|
|
|
1153
1153
|
: undefined;
|
|
1154
1154
|
}
|
|
1155
1155
|
ts.singleOrUndefined = singleOrUndefined;
|
|
1156
|
+
/**
|
|
1157
|
+
* Returns the only element of an array if it contains only one element; throws otherwise.
|
|
1158
|
+
*/
|
|
1159
|
+
function single(array) {
|
|
1160
|
+
return ts.Debug.checkDefined(singleOrUndefined(array));
|
|
1161
|
+
}
|
|
1162
|
+
ts.single = single;
|
|
1156
1163
|
function singleOrMany(array) {
|
|
1157
1164
|
return array && array.length === 1
|
|
1158
1165
|
? array[0]
|
|
@@ -7020,6 +7027,7 @@ var ts;
|
|
|
7020
7027
|
// not actually work.
|
|
7021
7028
|
var byteOrderMarkIndicator = "\uFEFF";
|
|
7022
7029
|
function getNodeSystem() {
|
|
7030
|
+
var _a;
|
|
7023
7031
|
var nativePattern = /^native |^\([^)]+\)$|^(internal[\\/]|[a-zA-Z0-9_\s]+(\.js)?$)/;
|
|
7024
7032
|
var _fs = require("fs");
|
|
7025
7033
|
var _path = require("path");
|
|
@@ -7029,7 +7037,7 @@ var ts;
|
|
|
7029
7037
|
try {
|
|
7030
7038
|
_crypto = require("crypto");
|
|
7031
7039
|
}
|
|
7032
|
-
catch (
|
|
7040
|
+
catch (_b) {
|
|
7033
7041
|
_crypto = undefined;
|
|
7034
7042
|
}
|
|
7035
7043
|
var activeSession;
|
|
@@ -7040,10 +7048,10 @@ var ts;
|
|
|
7040
7048
|
var isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin";
|
|
7041
7049
|
var platform = _os.platform();
|
|
7042
7050
|
var useCaseSensitiveFileNames = isFileSystemCaseSensitive();
|
|
7043
|
-
var
|
|
7051
|
+
var realpathSync = (_a = _fs.realpathSync.native) !== null && _a !== void 0 ? _a : _fs.realpathSync;
|
|
7044
7052
|
var fsSupportsRecursiveFsWatch = isNode4OrLater && (process.platform === "win32" || process.platform === "darwin");
|
|
7045
7053
|
var getCurrentDirectory = ts.memoize(function () { return process.cwd(); });
|
|
7046
|
-
var
|
|
7054
|
+
var _c = createSystemWatchFunctions({
|
|
7047
7055
|
pollingWatchFile: createSingleFileWatcherPerName(fsWatchFileWorker, useCaseSensitiveFileNames),
|
|
7048
7056
|
getModifiedTime: getModifiedTime,
|
|
7049
7057
|
setTimeout: setTimeout,
|
|
@@ -7063,7 +7071,7 @@ var ts;
|
|
|
7063
7071
|
defaultWatchFileKind: function () { var _a, _b; return (_b = (_a = sys).defaultWatchFileKind) === null || _b === void 0 ? void 0 : _b.call(_a); },
|
|
7064
7072
|
inodeWatching: isLinuxOrMacOs,
|
|
7065
7073
|
sysLog: sysLog,
|
|
7066
|
-
}), watchFile =
|
|
7074
|
+
}), watchFile = _c.watchFile, watchDirectory = _c.watchDirectory;
|
|
7067
7075
|
var nodeSystem = {
|
|
7068
7076
|
args: process.argv.slice(2),
|
|
7069
7077
|
newLine: _os.EOL,
|
|
@@ -7456,12 +7464,9 @@ var ts;
|
|
|
7456
7464
|
function getDirectories(path) {
|
|
7457
7465
|
return getAccessibleFileSystemEntries(path).directories.slice();
|
|
7458
7466
|
}
|
|
7459
|
-
function fsRealPathHandlingLongPath(path) {
|
|
7460
|
-
return path.length < 260 ? _fs.realpathSync.native(path) : _fs.realpathSync(path);
|
|
7461
|
-
}
|
|
7462
7467
|
function realpath(path) {
|
|
7463
7468
|
try {
|
|
7464
|
-
return
|
|
7469
|
+
return realpathSync(path);
|
|
7465
7470
|
}
|
|
7466
7471
|
catch (_a) {
|
|
7467
7472
|
return path;
|
|
@@ -8891,7 +8896,7 @@ var ts;
|
|
|
8891
8896
|
Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig: diag(2591, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig."),
|
|
8892
8897
|
Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig: diag(2592, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig."),
|
|
8893
8898
|
Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig: diag(2593, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig."),
|
|
8894
|
-
|
|
8899
|
+
This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag: diag(2594, ts.DiagnosticCategory.Error, "This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag_2594", "This module is declared with 'export =', and can only be used with a default import when using the '{0}' flag."),
|
|
8895
8900
|
_0_can_only_be_imported_by_using_a_default_import: diag(2595, ts.DiagnosticCategory.Error, "_0_can_only_be_imported_by_using_a_default_import_2595", "'{0}' can only be imported by using a default import."),
|
|
8896
8901
|
_0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import: diag(2596, ts.DiagnosticCategory.Error, "_0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import_2596", "'{0}' can only be imported by turning on the 'esModuleInterop' flag and using a default import."),
|
|
8897
8902
|
_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import: diag(2597, ts.DiagnosticCategory.Error, "_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import_2597", "'{0}' can only be imported by using a 'require' call or by using a default import."),
|
|
@@ -18118,7 +18123,7 @@ var ts;
|
|
|
18118
18123
|
}
|
|
18119
18124
|
diagnostics = nonFileDiagnostics;
|
|
18120
18125
|
}
|
|
18121
|
-
ts.insertSorted(diagnostics, diagnostic,
|
|
18126
|
+
ts.insertSorted(diagnostics, diagnostic, compareDiagnosticsSkipRelatedInformation);
|
|
18122
18127
|
}
|
|
18123
18128
|
function getGlobalDiagnostics() {
|
|
18124
18129
|
hasReadNonFileDiagnostics = true;
|
|
@@ -51045,7 +51050,7 @@ var ts;
|
|
|
51045
51050
|
var exportAssignment = exportEqualsSymbol.valueDeclaration;
|
|
51046
51051
|
var err = error(node.name, ts.Diagnostics.Module_0_can_only_be_default_imported_using_the_1_flag, symbolToString(moduleSymbol), compilerOptionName);
|
|
51047
51052
|
if (exportAssignment) {
|
|
51048
|
-
ts.addRelatedInfo(err, ts.createDiagnosticForNode(exportAssignment, ts.Diagnostics.
|
|
51053
|
+
ts.addRelatedInfo(err, ts.createDiagnosticForNode(exportAssignment, ts.Diagnostics.This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag, compilerOptionName));
|
|
51049
51054
|
}
|
|
51050
51055
|
}
|
|
51051
51056
|
else {
|
|
@@ -138904,6 +138909,8 @@ var ts;
|
|
|
138904
138909
|
// Similarly, skip past the symbol for 'export ='
|
|
138905
138910
|
if (importedSymbol.escapedName === "export=") {
|
|
138906
138911
|
importedSymbol = getExportEqualsLocalSymbol(importedSymbol, checker);
|
|
138912
|
+
if (importedSymbol === undefined)
|
|
138913
|
+
return undefined;
|
|
138907
138914
|
}
|
|
138908
138915
|
// If the import has a different name than the export, do not continue searching.
|
|
138909
138916
|
// If `importedName` is undefined, do continue searching as the export is anonymous.
|
|
@@ -138925,19 +138932,19 @@ var ts;
|
|
|
138925
138932
|
FindAllReferences.getImportOrExportSymbol = getImportOrExportSymbol;
|
|
138926
138933
|
function getExportEqualsLocalSymbol(importedSymbol, checker) {
|
|
138927
138934
|
if (importedSymbol.flags & 2097152 /* Alias */) {
|
|
138928
|
-
return
|
|
138935
|
+
return checker.getImmediateAliasedSymbol(importedSymbol);
|
|
138929
138936
|
}
|
|
138930
138937
|
var decl = ts.Debug.checkDefined(importedSymbol.valueDeclaration);
|
|
138931
138938
|
if (ts.isExportAssignment(decl)) { // `export = class {}`
|
|
138932
|
-
return
|
|
138939
|
+
return decl.expression.symbol;
|
|
138933
138940
|
}
|
|
138934
138941
|
else if (ts.isBinaryExpression(decl)) { // `module.exports = class {}`
|
|
138935
|
-
return
|
|
138942
|
+
return decl.right.symbol;
|
|
138936
138943
|
}
|
|
138937
138944
|
else if (ts.isSourceFile(decl)) { // json module
|
|
138938
|
-
return
|
|
138945
|
+
return decl.symbol;
|
|
138939
138946
|
}
|
|
138940
|
-
return
|
|
138947
|
+
return undefined;
|
|
138941
138948
|
}
|
|
138942
138949
|
// If a reference is a class expression, the exported node would be its parent.
|
|
138943
138950
|
// If a reference is a variable declaration, the exported node would be the variable statement.
|
|
@@ -155214,13 +155221,15 @@ var ts;
|
|
|
155214
155221
|
errorCodes: errorCodes,
|
|
155215
155222
|
getCodeActions: function (context) {
|
|
155216
155223
|
var errorCode = context.errorCode, preferences = context.preferences, sourceFile = context.sourceFile, span = context.span, program = context.program;
|
|
155217
|
-
var info =
|
|
155224
|
+
var info = getFixInfos(context, errorCode, span.start, /*useAutoImportProvider*/ true);
|
|
155218
155225
|
if (!info)
|
|
155219
155226
|
return undefined;
|
|
155220
|
-
var fixes = info.fixes, symbolName = info.symbolName, errorIdentifierText = info.errorIdentifierText;
|
|
155221
155227
|
var quotePreference = ts.getQuotePreference(sourceFile, preferences);
|
|
155222
|
-
return
|
|
155223
|
-
|
|
155228
|
+
return info.map(function (_a) {
|
|
155229
|
+
var fix = _a.fix, symbolName = _a.symbolName, errorIdentifierText = _a.errorIdentifierText;
|
|
155230
|
+
return codeActionForFix(context, sourceFile, symbolName, fix,
|
|
155231
|
+
/*includeSymbolNameInDescription*/ symbolName !== errorIdentifierText, quotePreference, program.getCompilerOptions());
|
|
155232
|
+
});
|
|
155224
155233
|
},
|
|
155225
155234
|
fixIds: [importFixId],
|
|
155226
155235
|
getAllCodeActions: function (context) {
|
|
@@ -155245,10 +155254,10 @@ var ts;
|
|
|
155245
155254
|
var newImports = new ts.Map();
|
|
155246
155255
|
return { addImportFromDiagnostic: addImportFromDiagnostic, addImportFromExportedSymbol: addImportFromExportedSymbol, writeFixes: writeFixes, hasFixes: hasFixes };
|
|
155247
155256
|
function addImportFromDiagnostic(diagnostic, context) {
|
|
155248
|
-
var info =
|
|
155249
|
-
if (!info || !info.
|
|
155257
|
+
var info = getFixInfos(context, diagnostic.code, diagnostic.start, useAutoImportProvider);
|
|
155258
|
+
if (!info || !info.length)
|
|
155250
155259
|
return;
|
|
155251
|
-
addImport(info);
|
|
155260
|
+
addImport(ts.first(info));
|
|
155252
155261
|
}
|
|
155253
155262
|
function addImportFromExportedSymbol(exportedSymbol, isValidTypeOnlyUseSite) {
|
|
155254
155263
|
var moduleSymbol = ts.Debug.checkDefined(exportedSymbol.parent);
|
|
@@ -155259,13 +155268,12 @@ var ts;
|
|
|
155259
155268
|
var useRequire = shouldUseRequire(sourceFile, program);
|
|
155260
155269
|
var fix = getImportFixForSymbol(sourceFile, exportInfo, moduleSymbol, program, /*useNamespaceInfo*/ undefined, !!isValidTypeOnlyUseSite, useRequire, host, preferences);
|
|
155261
155270
|
if (fix) {
|
|
155262
|
-
addImport({
|
|
155271
|
+
addImport({ fix: fix, symbolName: symbolName, errorIdentifierText: undefined });
|
|
155263
155272
|
}
|
|
155264
155273
|
}
|
|
155265
155274
|
function addImport(info) {
|
|
155266
155275
|
var _a, _b;
|
|
155267
|
-
var
|
|
155268
|
-
var fix = ts.first(fixes);
|
|
155276
|
+
var fix = info.fix, symbolName = info.symbolName;
|
|
155269
155277
|
switch (fix.kind) {
|
|
155270
155278
|
case 0 /* UseNamespace */:
|
|
155271
155279
|
addToNamespace.push(fix);
|
|
@@ -155449,7 +155457,7 @@ var ts;
|
|
|
155449
155457
|
codefix.getImportCompletionAction = getImportCompletionAction;
|
|
155450
155458
|
function getPromoteTypeOnlyCompletionAction(sourceFile, symbolToken, program, host, formatContext, preferences) {
|
|
155451
155459
|
var compilerOptions = program.getCompilerOptions();
|
|
155452
|
-
var symbolName =
|
|
155460
|
+
var symbolName = ts.single(getSymbolNamesToImport(sourceFile, program.getTypeChecker(), symbolToken, compilerOptions));
|
|
155453
155461
|
var fix = getTypeOnlyPromotionFix(sourceFile, symbolToken, symbolName, program);
|
|
155454
155462
|
var includeSymbolNameInDescription = symbolName !== symbolToken.text;
|
|
155455
155463
|
return fix && codeFixActionToCodeAction(codeActionForFix({ host: host, formatContext: formatContext, preferences: preferences }, sourceFile, symbolName, fix, includeSymbolNameInDescription, 1 /* Double */, compilerOptions));
|
|
@@ -155754,7 +155762,7 @@ var ts;
|
|
|
155754
155762
|
return { kind: 3 /* AddNew */, moduleSpecifier: moduleSpecifier, importKind: importKind, addAsTypeOnly: addAsTypeOnly, useRequire: useRequire };
|
|
155755
155763
|
}
|
|
155756
155764
|
}
|
|
155757
|
-
function
|
|
155765
|
+
function getFixInfos(context, errorCode, pos, useAutoImportProvider) {
|
|
155758
155766
|
var symbolToken = ts.getTokenAtPosition(context.sourceFile, pos);
|
|
155759
155767
|
var info;
|
|
155760
155768
|
if (errorCode === ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code) {
|
|
@@ -155764,19 +155772,23 @@ var ts;
|
|
|
155764
155772
|
return undefined;
|
|
155765
155773
|
}
|
|
155766
155774
|
else if (errorCode === ts.Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type.code) {
|
|
155767
|
-
var symbolName_1 =
|
|
155775
|
+
var symbolName_1 = ts.single(getSymbolNamesToImport(context.sourceFile, context.program.getTypeChecker(), symbolToken, context.program.getCompilerOptions()));
|
|
155768
155776
|
var fix = getTypeOnlyPromotionFix(context.sourceFile, symbolToken, symbolName_1, context.program);
|
|
155769
|
-
return fix && {
|
|
155777
|
+
return fix && [{ fix: fix, symbolName: symbolName_1, errorIdentifierText: symbolToken.text }];
|
|
155770
155778
|
}
|
|
155771
155779
|
else {
|
|
155772
155780
|
info = getFixesInfoForNonUMDImport(context, symbolToken, useAutoImportProvider);
|
|
155773
155781
|
}
|
|
155774
155782
|
var packageJsonImportFilter = ts.createPackageJsonImportFilter(context.sourceFile, context.preferences, context.host);
|
|
155775
|
-
return info &&
|
|
155783
|
+
return info && sortFixInfo(info, context.sourceFile, context.program, packageJsonImportFilter, context.host);
|
|
155776
155784
|
}
|
|
155777
|
-
function
|
|
155785
|
+
function sortFixInfo(fixes, sourceFile, program, packageJsonImportFilter, host) {
|
|
155778
155786
|
var _toPath = function (fileName) { return ts.toPath(fileName, host.getCurrentDirectory(), ts.hostGetCanonicalFileName(host)); };
|
|
155779
|
-
return ts.sort(fixes, function (a, b) {
|
|
155787
|
+
return ts.sort(fixes, function (a, b) {
|
|
155788
|
+
return ts.compareBooleans(!!a.isJsxNamespaceFix, !!b.isJsxNamespaceFix) ||
|
|
155789
|
+
ts.compareValues(a.fix.kind, b.fix.kind) ||
|
|
155790
|
+
compareModuleSpecifiers(a.fix, b.fix, sourceFile, program, packageJsonImportFilter.allowsImportingSpecifier, _toPath);
|
|
155791
|
+
});
|
|
155780
155792
|
}
|
|
155781
155793
|
function getBestFix(fixes, sourceFile, program, packageJsonImportFilter, host) {
|
|
155782
155794
|
if (!ts.some(fixes))
|
|
@@ -155827,7 +155839,6 @@ var ts;
|
|
|
155827
155839
|
return 0 /* EqualTo */;
|
|
155828
155840
|
}
|
|
155829
155841
|
function getFixesInfoForUMDImport(_a, token) {
|
|
155830
|
-
var _b;
|
|
155831
155842
|
var sourceFile = _a.sourceFile, program = _a.program, host = _a.host, preferences = _a.preferences;
|
|
155832
155843
|
var checker = program.getTypeChecker();
|
|
155833
155844
|
var umdSymbol = getUmdSymbol(token, checker);
|
|
@@ -155839,7 +155850,7 @@ var ts;
|
|
|
155839
155850
|
var useRequire = shouldUseRequire(sourceFile, program);
|
|
155840
155851
|
var position = ts.isIdentifier(token) ? token.getStart(sourceFile) : undefined;
|
|
155841
155852
|
var fixes = getImportFixes(exportInfo, position ? { position: position, symbolName: symbolName } : undefined, /*isValidTypeOnlyUseSite*/ false, useRequire, program, sourceFile, host, preferences).fixes;
|
|
155842
|
-
return {
|
|
155853
|
+
return fixes.map(function (fix) { var _a; return ({ fix: fix, symbolName: symbolName, errorIdentifierText: (_a = ts.tryCast(token, ts.isIdentifier)) === null || _a === void 0 ? void 0 : _a.text }); });
|
|
155843
155854
|
}
|
|
155844
155855
|
function getUmdSymbol(token, checker) {
|
|
155845
155856
|
// try the identifier to see if it is the umd symbol
|
|
@@ -155900,19 +155911,20 @@ var ts;
|
|
|
155900
155911
|
var sourceFile = _a.sourceFile, program = _a.program, cancellationToken = _a.cancellationToken, host = _a.host, preferences = _a.preferences;
|
|
155901
155912
|
var checker = program.getTypeChecker();
|
|
155902
155913
|
var compilerOptions = program.getCompilerOptions();
|
|
155903
|
-
|
|
155904
|
-
|
|
155905
|
-
|
|
155906
|
-
|
|
155907
|
-
|
|
155908
|
-
|
|
155909
|
-
|
|
155910
|
-
|
|
155911
|
-
|
|
155912
|
-
|
|
155913
|
-
|
|
155914
|
-
|
|
155915
|
-
|
|
155914
|
+
return ts.flatMap(getSymbolNamesToImport(sourceFile, checker, symbolToken, compilerOptions), function (symbolName) {
|
|
155915
|
+
// "default" is a keyword and not a legal identifier for the import, but appears as an identifier.
|
|
155916
|
+
if (symbolName === "default" /* Default */) {
|
|
155917
|
+
return undefined;
|
|
155918
|
+
}
|
|
155919
|
+
var isValidTypeOnlyUseSite = ts.isValidTypeOnlyAliasUseSite(symbolToken);
|
|
155920
|
+
var useRequire = shouldUseRequire(sourceFile, program);
|
|
155921
|
+
var exportInfo = getExportInfos(symbolName, ts.isJSXTagName(symbolToken), ts.getMeaningFromLocation(symbolToken), cancellationToken, sourceFile, program, useAutoImportProvider, host, preferences);
|
|
155922
|
+
var fixes = ts.arrayFrom(ts.flatMapIterator(exportInfo.entries(), function (_a) {
|
|
155923
|
+
var _ = _a[0], exportInfos = _a[1];
|
|
155924
|
+
return getImportFixes(exportInfos, { symbolName: symbolName, position: symbolToken.getStart(sourceFile) }, isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences).fixes;
|
|
155925
|
+
}));
|
|
155926
|
+
return fixes.map(function (fix) { return ({ fix: fix, symbolName: symbolName, errorIdentifierText: symbolToken.text, isJsxNamespaceFix: symbolName !== symbolToken.text }); });
|
|
155927
|
+
});
|
|
155916
155928
|
}
|
|
155917
155929
|
function getTypeOnlyPromotionFix(sourceFile, symbolToken, symbolName, program) {
|
|
155918
155930
|
var checker = program.getTypeChecker();
|
|
@@ -155924,15 +155936,16 @@ var ts;
|
|
|
155924
155936
|
return undefined;
|
|
155925
155937
|
return { kind: 4 /* PromoteTypeOnly */, typeOnlyAliasDeclaration: typeOnlyAliasDeclaration };
|
|
155926
155938
|
}
|
|
155927
|
-
function
|
|
155939
|
+
function getSymbolNamesToImport(sourceFile, checker, symbolToken, compilerOptions) {
|
|
155928
155940
|
var parent = symbolToken.parent;
|
|
155929
155941
|
if ((ts.isJsxOpeningLikeElement(parent) || ts.isJsxClosingElement(parent)) && parent.tagName === symbolToken && ts.jsxModeNeedsExplicitImport(compilerOptions.jsx)) {
|
|
155930
155942
|
var jsxNamespace = checker.getJsxNamespace(sourceFile);
|
|
155931
155943
|
if (needsJsxNamespaceFix(jsxNamespace, symbolToken, checker)) {
|
|
155932
|
-
|
|
155944
|
+
var needsComponentNameFix = !ts.isIntrinsicJsxName(symbolToken.text) && !checker.resolveName(symbolToken.text, symbolToken, 111551 /* Value */, /*excludeGlobals*/ false);
|
|
155945
|
+
return needsComponentNameFix ? [symbolToken.text, jsxNamespace] : [jsxNamespace];
|
|
155933
155946
|
}
|
|
155934
155947
|
}
|
|
155935
|
-
return symbolToken.text;
|
|
155948
|
+
return [symbolToken.text];
|
|
155936
155949
|
}
|
|
155937
155950
|
function needsJsxNamespaceFix(jsxNamespace, symbolToken, checker) {
|
|
155938
155951
|
if (ts.isIntrinsicJsxName(symbolToken.text))
|
package/lib/typingsInstaller.js
CHANGED
|
@@ -1143,6 +1143,13 @@ var ts;
|
|
|
1143
1143
|
: undefined;
|
|
1144
1144
|
}
|
|
1145
1145
|
ts.singleOrUndefined = singleOrUndefined;
|
|
1146
|
+
/**
|
|
1147
|
+
* Returns the only element of an array if it contains only one element; throws otherwise.
|
|
1148
|
+
*/
|
|
1149
|
+
function single(array) {
|
|
1150
|
+
return ts.Debug.checkDefined(singleOrUndefined(array));
|
|
1151
|
+
}
|
|
1152
|
+
ts.single = single;
|
|
1146
1153
|
function singleOrMany(array) {
|
|
1147
1154
|
return array && array.length === 1
|
|
1148
1155
|
? array[0]
|
|
@@ -7010,6 +7017,7 @@ var ts;
|
|
|
7010
7017
|
// not actually work.
|
|
7011
7018
|
var byteOrderMarkIndicator = "\uFEFF";
|
|
7012
7019
|
function getNodeSystem() {
|
|
7020
|
+
var _a;
|
|
7013
7021
|
var nativePattern = /^native |^\([^)]+\)$|^(internal[\\/]|[a-zA-Z0-9_\s]+(\.js)?$)/;
|
|
7014
7022
|
var _fs = require("fs");
|
|
7015
7023
|
var _path = require("path");
|
|
@@ -7019,7 +7027,7 @@ var ts;
|
|
|
7019
7027
|
try {
|
|
7020
7028
|
_crypto = require("crypto");
|
|
7021
7029
|
}
|
|
7022
|
-
catch (
|
|
7030
|
+
catch (_b) {
|
|
7023
7031
|
_crypto = undefined;
|
|
7024
7032
|
}
|
|
7025
7033
|
var activeSession;
|
|
@@ -7030,10 +7038,10 @@ var ts;
|
|
|
7030
7038
|
var isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin";
|
|
7031
7039
|
var platform = _os.platform();
|
|
7032
7040
|
var useCaseSensitiveFileNames = isFileSystemCaseSensitive();
|
|
7033
|
-
var
|
|
7041
|
+
var realpathSync = (_a = _fs.realpathSync.native) !== null && _a !== void 0 ? _a : _fs.realpathSync;
|
|
7034
7042
|
var fsSupportsRecursiveFsWatch = isNode4OrLater && (process.platform === "win32" || process.platform === "darwin");
|
|
7035
7043
|
var getCurrentDirectory = ts.memoize(function () { return process.cwd(); });
|
|
7036
|
-
var
|
|
7044
|
+
var _c = createSystemWatchFunctions({
|
|
7037
7045
|
pollingWatchFile: createSingleFileWatcherPerName(fsWatchFileWorker, useCaseSensitiveFileNames),
|
|
7038
7046
|
getModifiedTime: getModifiedTime,
|
|
7039
7047
|
setTimeout: setTimeout,
|
|
@@ -7053,7 +7061,7 @@ var ts;
|
|
|
7053
7061
|
defaultWatchFileKind: function () { var _a, _b; return (_b = (_a = sys).defaultWatchFileKind) === null || _b === void 0 ? void 0 : _b.call(_a); },
|
|
7054
7062
|
inodeWatching: isLinuxOrMacOs,
|
|
7055
7063
|
sysLog: sysLog,
|
|
7056
|
-
}), watchFile =
|
|
7064
|
+
}), watchFile = _c.watchFile, watchDirectory = _c.watchDirectory;
|
|
7057
7065
|
var nodeSystem = {
|
|
7058
7066
|
args: process.argv.slice(2),
|
|
7059
7067
|
newLine: _os.EOL,
|
|
@@ -7446,12 +7454,9 @@ var ts;
|
|
|
7446
7454
|
function getDirectories(path) {
|
|
7447
7455
|
return getAccessibleFileSystemEntries(path).directories.slice();
|
|
7448
7456
|
}
|
|
7449
|
-
function fsRealPathHandlingLongPath(path) {
|
|
7450
|
-
return path.length < 260 ? _fs.realpathSync.native(path) : _fs.realpathSync(path);
|
|
7451
|
-
}
|
|
7452
7457
|
function realpath(path) {
|
|
7453
7458
|
try {
|
|
7454
|
-
return
|
|
7459
|
+
return realpathSync(path);
|
|
7455
7460
|
}
|
|
7456
7461
|
catch (_a) {
|
|
7457
7462
|
return path;
|
|
@@ -8881,7 +8886,7 @@ var ts;
|
|
|
8881
8886
|
Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig: diag(2591, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig."),
|
|
8882
8887
|
Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig: diag(2592, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig."),
|
|
8883
8888
|
Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig: diag(2593, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig."),
|
|
8884
|
-
|
|
8889
|
+
This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag: diag(2594, ts.DiagnosticCategory.Error, "This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag_2594", "This module is declared with 'export =', and can only be used with a default import when using the '{0}' flag."),
|
|
8885
8890
|
_0_can_only_be_imported_by_using_a_default_import: diag(2595, ts.DiagnosticCategory.Error, "_0_can_only_be_imported_by_using_a_default_import_2595", "'{0}' can only be imported by using a default import."),
|
|
8886
8891
|
_0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import: diag(2596, ts.DiagnosticCategory.Error, "_0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import_2596", "'{0}' can only be imported by turning on the 'esModuleInterop' flag and using a default import."),
|
|
8887
8892
|
_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import: diag(2597, ts.DiagnosticCategory.Error, "_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import_2597", "'{0}' can only be imported by using a 'require' call or by using a default import."),
|
|
@@ -18108,7 +18113,7 @@ var ts;
|
|
|
18108
18113
|
}
|
|
18109
18114
|
diagnostics = nonFileDiagnostics;
|
|
18110
18115
|
}
|
|
18111
|
-
ts.insertSorted(diagnostics, diagnostic,
|
|
18116
|
+
ts.insertSorted(diagnostics, diagnostic, compareDiagnosticsSkipRelatedInformation);
|
|
18112
18117
|
}
|
|
18113
18118
|
function getGlobalDiagnostics() {
|
|
18114
18119
|
hasReadNonFileDiagnostics = true;
|
|
@@ -51035,7 +51040,7 @@ var ts;
|
|
|
51035
51040
|
var exportAssignment = exportEqualsSymbol.valueDeclaration;
|
|
51036
51041
|
var err = error(node.name, ts.Diagnostics.Module_0_can_only_be_default_imported_using_the_1_flag, symbolToString(moduleSymbol), compilerOptionName);
|
|
51037
51042
|
if (exportAssignment) {
|
|
51038
|
-
ts.addRelatedInfo(err, ts.createDiagnosticForNode(exportAssignment, ts.Diagnostics.
|
|
51043
|
+
ts.addRelatedInfo(err, ts.createDiagnosticForNode(exportAssignment, ts.Diagnostics.This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag, compilerOptionName));
|
|
51039
51044
|
}
|
|
51040
51045
|
}
|
|
51041
51046
|
else {
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@typescript-deploys/pr-build",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "4.9.0-pr-
|
|
5
|
+
"version": "4.9.0-pr-50309-2",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|