@typescript-deploys/pr-build 5.7.0-pr-59759-2 → 5.7.0-pr-59767-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 +58 -102
- package/lib/typescript.d.ts +1 -0
- package/lib/typescript.js +68 -108
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -1203,73 +1203,6 @@ function skipWhile(array, predicate) {
|
|
|
1203
1203
|
function isNodeLikeSystem() {
|
|
1204
1204
|
return typeof process !== "undefined" && !!process.nextTick && !process.browser && typeof require !== "undefined";
|
|
1205
1205
|
}
|
|
1206
|
-
function createPrefixSuffixTrie() {
|
|
1207
|
-
function createTrie() {
|
|
1208
|
-
return {
|
|
1209
|
-
children: void 0,
|
|
1210
|
-
value: void 0
|
|
1211
|
-
};
|
|
1212
|
-
}
|
|
1213
|
-
const root = createTrie();
|
|
1214
|
-
function* iterateAllMatches(input) {
|
|
1215
|
-
var _a;
|
|
1216
|
-
let node = root;
|
|
1217
|
-
if (node.value) {
|
|
1218
|
-
yield* iterateSuffix(node.value, 0);
|
|
1219
|
-
}
|
|
1220
|
-
for (let i = 0; i < input.length; i++) {
|
|
1221
|
-
const child = (_a = node.children) == null ? void 0 : _a[input[i]];
|
|
1222
|
-
if (!child) break;
|
|
1223
|
-
if (child.value) {
|
|
1224
|
-
yield* iterateSuffix(child.value, i + 1);
|
|
1225
|
-
}
|
|
1226
|
-
node = child;
|
|
1227
|
-
}
|
|
1228
|
-
return;
|
|
1229
|
-
function* iterateSuffix(node2, start) {
|
|
1230
|
-
var _a2;
|
|
1231
|
-
if (node2.value) {
|
|
1232
|
-
yield node2.value;
|
|
1233
|
-
}
|
|
1234
|
-
for (let i = input.length - 1; i >= start; i--) {
|
|
1235
|
-
const child = (_a2 = node2.children) == null ? void 0 : _a2[input[i]];
|
|
1236
|
-
if (!child) break;
|
|
1237
|
-
if (child.value) {
|
|
1238
|
-
yield child.value;
|
|
1239
|
-
}
|
|
1240
|
-
node2 = child;
|
|
1241
|
-
}
|
|
1242
|
-
}
|
|
1243
|
-
}
|
|
1244
|
-
function set(prefix, suffix, fn) {
|
|
1245
|
-
let prefixNode = root;
|
|
1246
|
-
for (let i = 0; i < prefix.length; i++) {
|
|
1247
|
-
const char = prefix[i];
|
|
1248
|
-
const children = prefixNode.children ?? (prefixNode.children = {});
|
|
1249
|
-
const child = children[char] ?? (children[char] = createTrie());
|
|
1250
|
-
prefixNode = child;
|
|
1251
|
-
}
|
|
1252
|
-
let suffixNode = prefixNode.value ?? (prefixNode.value = createTrie());
|
|
1253
|
-
for (let i = suffix.length - 1; i >= 0; i--) {
|
|
1254
|
-
const char = suffix[i];
|
|
1255
|
-
const children = suffixNode.children ?? (suffixNode.children = {});
|
|
1256
|
-
const child = children[char] ?? (children[char] = createTrie());
|
|
1257
|
-
suffixNode = child;
|
|
1258
|
-
}
|
|
1259
|
-
suffixNode.value = fn(suffixNode.value);
|
|
1260
|
-
}
|
|
1261
|
-
function hasAnyMatch(input) {
|
|
1262
|
-
for (const _ of iterateAllMatches(input)) {
|
|
1263
|
-
return true;
|
|
1264
|
-
}
|
|
1265
|
-
return false;
|
|
1266
|
-
}
|
|
1267
|
-
return {
|
|
1268
|
-
iterateAllMatches,
|
|
1269
|
-
set,
|
|
1270
|
-
hasAnyMatch
|
|
1271
|
-
};
|
|
1272
|
-
}
|
|
1273
1206
|
|
|
1274
1207
|
// src/compiler/debug.ts
|
|
1275
1208
|
var Debug;
|
|
@@ -7336,6 +7269,7 @@ var Diagnostics = {
|
|
|
7336
7269
|
Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0: diag(6418, 3 /* Message */, "Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0_6418", "Searching all ancestor node_modules directories for fallback extensions: {0}."),
|
|
7337
7270
|
Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_program_needs_to_report_errors: diag(6419, 3 /* Message */, "Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_program_needs_to_report_errors_6419", "Project '{0}' is out of date because buildinfo file '{1}' indicates that program needs to report errors."),
|
|
7338
7271
|
Project_0_is_out_of_date_because_1: diag(6420, 3 /* Message */, "Project_0_is_out_of_date_because_1_6420", "Project '{0}' is out of date because {1}."),
|
|
7272
|
+
Rewrite_ts_tsx_mts_and_cts_file_extensions_in_relative_import_paths_to_their_JavaScript_equivalent_in_output_files: diag(6421, 3 /* Message */, "Rewrite_ts_tsx_mts_and_cts_file_extensions_in_relative_import_paths_to_their_JavaScript_equivalent_i_6421", "Rewrite '.ts', '.tsx', '.mts', and '.cts' file extensions in relative import paths to their JavaScript equivalent in output files."),
|
|
7339
7273
|
The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1: diag(6500, 3 /* Message */, "The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1_6500", "The expected type comes from property '{0}' which is declared here on type '{1}'"),
|
|
7340
7274
|
The_expected_type_comes_from_this_index_signature: diag(6501, 3 /* Message */, "The_expected_type_comes_from_this_index_signature_6501", "The expected type comes from this index signature."),
|
|
7341
7275
|
The_expected_type_comes_from_the_return_type_of_this_signature: diag(6502, 3 /* Message */, "The_expected_type_comes_from_the_return_type_of_this_signature_6502", "The expected type comes from the return type of this signature."),
|
|
@@ -17712,6 +17646,12 @@ function createComputedCompilerOptions(options) {
|
|
|
17712
17646
|
return options;
|
|
17713
17647
|
}
|
|
17714
17648
|
var computedOptions = createComputedCompilerOptions({
|
|
17649
|
+
allowImportingTsExtensions: {
|
|
17650
|
+
dependencies: ["rewriteRelativeImportExtensions"],
|
|
17651
|
+
computeValue: (compilerOptions) => {
|
|
17652
|
+
return !!(compilerOptions.allowImportingTsExtensions || compilerOptions.rewriteRelativeImportExtensions);
|
|
17653
|
+
}
|
|
17654
|
+
},
|
|
17715
17655
|
target: {
|
|
17716
17656
|
dependencies: ["module"],
|
|
17717
17657
|
computeValue: (compilerOptions) => {
|
|
@@ -17925,6 +17865,7 @@ var computedOptions = createComputedCompilerOptions({
|
|
|
17925
17865
|
}
|
|
17926
17866
|
}
|
|
17927
17867
|
});
|
|
17868
|
+
var getAllowImportingTsExtensions = computedOptions.allowImportingTsExtensions.computeValue;
|
|
17928
17869
|
var getEmitScriptTarget = computedOptions.target.computeValue;
|
|
17929
17870
|
var getEmitModuleKind = computedOptions.module.computeValue;
|
|
17930
17871
|
var getEmitModuleResolutionKind = computedOptions.moduleResolution.computeValue;
|
|
@@ -36718,6 +36659,15 @@ var commandOptionsWithoutBuild = [
|
|
|
36718
36659
|
defaultValueDescription: false,
|
|
36719
36660
|
transpileOptionValue: void 0
|
|
36720
36661
|
},
|
|
36662
|
+
{
|
|
36663
|
+
name: "rewriteRelativeImportExtensions",
|
|
36664
|
+
type: "boolean",
|
|
36665
|
+
affectsSemanticDiagnostics: true,
|
|
36666
|
+
affectsBuildInfo: true,
|
|
36667
|
+
category: Diagnostics.Modules,
|
|
36668
|
+
description: Diagnostics.Rewrite_ts_tsx_mts_and_cts_file_extensions_in_relative_import_paths_to_their_JavaScript_equivalent_in_output_files,
|
|
36669
|
+
defaultValueDescription: false
|
|
36670
|
+
},
|
|
36721
36671
|
{
|
|
36722
36672
|
name: "resolvePackageJsonExports",
|
|
36723
36673
|
type: "boolean",
|
|
@@ -41351,7 +41301,7 @@ function resolveFromTypeRoot(moduleName, state) {
|
|
|
41351
41301
|
}
|
|
41352
41302
|
}
|
|
41353
41303
|
function shouldAllowImportingTsExtension(compilerOptions, fromFileName) {
|
|
41354
|
-
return
|
|
41304
|
+
return getAllowImportingTsExtensions(compilerOptions) || fromFileName && isDeclarationFileName(fromFileName);
|
|
41355
41305
|
}
|
|
41356
41306
|
function loadModuleFromGlobalCache(moduleName, projectName, compilerOptions, host, globalCache, packageJsonInfoCache) {
|
|
41357
41307
|
const traceEnabled = isTraceEnabled(compilerOptions, host);
|
|
@@ -59988,38 +59938,13 @@ function createTypeChecker(host) {
|
|
|
59988
59938
|
}
|
|
59989
59939
|
}
|
|
59990
59940
|
function removeStringLiteralsMatchedByTemplateLiterals(types) {
|
|
59991
|
-
|
|
59992
|
-
|
|
59993
|
-
const estimatedCount = templateLiterals.length * countWhere(types, (t) => !!(t.flags & 128 /* StringLiteral */));
|
|
59994
|
-
if (estimatedCount > 0) {
|
|
59995
|
-
const trie = createPrefixSuffixTrie();
|
|
59996
|
-
forEach(templateLiterals, (t) => {
|
|
59997
|
-
const prefix = t.texts[0];
|
|
59998
|
-
const suffix = t.texts[t.texts.length - 1];
|
|
59999
|
-
trie.set(prefix, suffix, (templates) => append(templates, t));
|
|
60000
|
-
});
|
|
60001
|
-
let i = types.length;
|
|
60002
|
-
outer: while (i > 0) {
|
|
60003
|
-
i--;
|
|
60004
|
-
const t = types[i];
|
|
60005
|
-
if (!(t.flags & 128 /* StringLiteral */)) continue;
|
|
60006
|
-
const text = t.value;
|
|
60007
|
-
for (const templates of trie.iterateAllMatches(text)) {
|
|
60008
|
-
if (some(templates, (template) => isTypeMatchedByTemplateLiteralOrStringMapping(t, template))) {
|
|
60009
|
-
orderedRemoveItemAt(types, i);
|
|
60010
|
-
continue outer;
|
|
60011
|
-
}
|
|
60012
|
-
}
|
|
60013
|
-
}
|
|
60014
|
-
patterns = filter(patterns, (t) => !!(t.flags & 268435456 /* StringMapping */));
|
|
60015
|
-
}
|
|
60016
|
-
if (patterns.length) {
|
|
59941
|
+
const templates = filter(types, isPatternLiteralType);
|
|
59942
|
+
if (templates.length) {
|
|
60017
59943
|
let i = types.length;
|
|
60018
59944
|
while (i > 0) {
|
|
60019
59945
|
i--;
|
|
60020
59946
|
const t = types[i];
|
|
60021
|
-
if (
|
|
60022
|
-
if (some(patterns, (template) => isTypeMatchedByTemplateLiteralOrStringMapping(t, template))) {
|
|
59947
|
+
if (t.flags & 128 /* StringLiteral */ && some(templates, (template) => isTypeMatchedByTemplateLiteralOrStringMapping(t, template))) {
|
|
60023
59948
|
orderedRemoveItemAt(types, i);
|
|
60024
59949
|
}
|
|
60025
59950
|
}
|
|
@@ -78290,6 +78215,7 @@ function createTypeChecker(host) {
|
|
|
78290
78215
|
case 214 /* NewExpression */:
|
|
78291
78216
|
case 211 /* PropertyAccessExpression */:
|
|
78292
78217
|
case 229 /* YieldExpression */:
|
|
78218
|
+
case 110 /* ThisKeyword */:
|
|
78293
78219
|
return 3 /* Sometimes */;
|
|
78294
78220
|
case 226 /* BinaryExpression */:
|
|
78295
78221
|
switch (node.operatorToken.kind) {
|
|
@@ -93115,10 +93041,17 @@ function transformTypeScript(context) {
|
|
|
93115
93041
|
/*modifiers*/
|
|
93116
93042
|
void 0,
|
|
93117
93043
|
importClause,
|
|
93118
|
-
node.moduleSpecifier,
|
|
93044
|
+
rewriteModuleSpecifier(node.moduleSpecifier),
|
|
93119
93045
|
node.attributes
|
|
93120
93046
|
) : void 0;
|
|
93121
93047
|
}
|
|
93048
|
+
function rewriteModuleSpecifier(node) {
|
|
93049
|
+
if (!node || !compilerOptions.rewriteRelativeImportExtensions || !isStringLiteral(node) || !pathIsRelative(node.text) || isDeclarationFileName(node.text)) {
|
|
93050
|
+
return node;
|
|
93051
|
+
}
|
|
93052
|
+
const updatedText = changeExtension(node.text, getOutputExtension(node.text, compilerOptions));
|
|
93053
|
+
return updatedText !== node.text ? setOriginalNode(setTextRange(factory2.createStringLiteral(updatedText, node.singleQuote), node), node) : node;
|
|
93054
|
+
}
|
|
93122
93055
|
function visitImportClause(node) {
|
|
93123
93056
|
Debug.assert(!node.isTypeOnly);
|
|
93124
93057
|
const name = shouldEmitAliasDeclaration(node) ? node.name : void 0;
|
|
@@ -93151,7 +93084,14 @@ function transformTypeScript(context) {
|
|
|
93151
93084
|
return void 0;
|
|
93152
93085
|
}
|
|
93153
93086
|
if (!node.exportClause || isNamespaceExport(node.exportClause)) {
|
|
93154
|
-
return
|
|
93087
|
+
return factory2.updateExportDeclaration(
|
|
93088
|
+
node,
|
|
93089
|
+
node.modifiers,
|
|
93090
|
+
node.isTypeOnly,
|
|
93091
|
+
node.exportClause,
|
|
93092
|
+
rewriteModuleSpecifier(node.moduleSpecifier),
|
|
93093
|
+
node.attributes
|
|
93094
|
+
);
|
|
93155
93095
|
}
|
|
93156
93096
|
const allowEmpty = !!compilerOptions.verbatimModuleSyntax;
|
|
93157
93097
|
const exportClause = visitNode(
|
|
@@ -93165,7 +93105,7 @@ function transformTypeScript(context) {
|
|
|
93165
93105
|
void 0,
|
|
93166
93106
|
node.isTypeOnly,
|
|
93167
93107
|
exportClause,
|
|
93168
|
-
node.moduleSpecifier,
|
|
93108
|
+
rewriteModuleSpecifier(node.moduleSpecifier),
|
|
93169
93109
|
node.attributes
|
|
93170
93110
|
) : void 0;
|
|
93171
93111
|
}
|
|
@@ -93190,8 +93130,24 @@ function transformTypeScript(context) {
|
|
|
93190
93130
|
return void 0;
|
|
93191
93131
|
}
|
|
93192
93132
|
if (isExternalModuleImportEqualsDeclaration(node)) {
|
|
93193
|
-
|
|
93194
|
-
|
|
93133
|
+
if (!shouldEmitAliasDeclaration(node)) {
|
|
93134
|
+
return void 0;
|
|
93135
|
+
}
|
|
93136
|
+
const updatedModuleSpecifier = rewriteModuleSpecifier(node.moduleReference.expression);
|
|
93137
|
+
if (updatedModuleSpecifier !== node.moduleReference.expression) {
|
|
93138
|
+
return visitEachChild(
|
|
93139
|
+
factory2.updateImportEqualsDeclaration(
|
|
93140
|
+
node,
|
|
93141
|
+
node.modifiers,
|
|
93142
|
+
node.isTypeOnly,
|
|
93143
|
+
node.name,
|
|
93144
|
+
factory2.updateExternalModuleReference(node.moduleReference, updatedModuleSpecifier)
|
|
93145
|
+
),
|
|
93146
|
+
visitor,
|
|
93147
|
+
context
|
|
93148
|
+
);
|
|
93149
|
+
}
|
|
93150
|
+
return visitEachChild(node, visitor, context);
|
|
93195
93151
|
}
|
|
93196
93152
|
if (!shouldEmitImportEqualsDeclaration(node)) {
|
|
93197
93153
|
return void 0;
|
|
@@ -122560,7 +122516,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
122560
122516
|
createDiagnosticForOptionName(Diagnostics.Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System, "verbatimModuleSyntax");
|
|
122561
122517
|
}
|
|
122562
122518
|
}
|
|
122563
|
-
if (options.allowImportingTsExtensions && !(options.noEmit || options.emitDeclarationOnly)) {
|
|
122519
|
+
if (options.allowImportingTsExtensions && !(options.noEmit || options.emitDeclarationOnly || options.rewriteRelativeImportExtensions)) {
|
|
122564
122520
|
createOptionValueDiagnostic("allowImportingTsExtensions", Diagnostics.Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set);
|
|
122565
122521
|
}
|
|
122566
122522
|
const moduleResolution = getEmitModuleResolutionKind(options);
|
package/lib/typescript.d.ts
CHANGED
|
@@ -7021,6 +7021,7 @@ declare namespace ts {
|
|
|
7021
7021
|
removeComments?: boolean;
|
|
7022
7022
|
resolvePackageJsonExports?: boolean;
|
|
7023
7023
|
resolvePackageJsonImports?: boolean;
|
|
7024
|
+
rewriteRelativeImportExtensions?: boolean;
|
|
7024
7025
|
rootDir?: string;
|
|
7025
7026
|
rootDirs?: string[];
|
|
7026
7027
|
skipLibCheck?: boolean;
|
package/lib/typescript.js
CHANGED
|
@@ -429,7 +429,6 @@ __export(typescript_exports, {
|
|
|
429
429
|
createPackageJsonInfo: () => createPackageJsonInfo,
|
|
430
430
|
createParenthesizerRules: () => createParenthesizerRules,
|
|
431
431
|
createPatternMatcher: () => createPatternMatcher,
|
|
432
|
-
createPrefixSuffixTrie: () => createPrefixSuffixTrie,
|
|
433
432
|
createPrinter: () => createPrinter,
|
|
434
433
|
createPrinterWithDefaults: () => createPrinterWithDefaults,
|
|
435
434
|
createPrinterWithRemoveComments: () => createPrinterWithRemoveComments,
|
|
@@ -634,6 +633,7 @@ __export(typescript_exports, {
|
|
|
634
633
|
getAllKeys: () => getAllKeys,
|
|
635
634
|
getAllProjectOutputs: () => getAllProjectOutputs,
|
|
636
635
|
getAllSuperTypeNodes: () => getAllSuperTypeNodes,
|
|
636
|
+
getAllowImportingTsExtensions: () => getAllowImportingTsExtensions,
|
|
637
637
|
getAllowJSCompilerOption: () => getAllowJSCompilerOption,
|
|
638
638
|
getAllowSyntheticDefaultImports: () => getAllowSyntheticDefaultImports,
|
|
639
639
|
getAncestor: () => getAncestor,
|
|
@@ -3746,73 +3746,6 @@ function skipWhile(array, predicate) {
|
|
|
3746
3746
|
function isNodeLikeSystem() {
|
|
3747
3747
|
return typeof process !== "undefined" && !!process.nextTick && !process.browser && typeof require !== "undefined";
|
|
3748
3748
|
}
|
|
3749
|
-
function createPrefixSuffixTrie() {
|
|
3750
|
-
function createTrie() {
|
|
3751
|
-
return {
|
|
3752
|
-
children: void 0,
|
|
3753
|
-
value: void 0
|
|
3754
|
-
};
|
|
3755
|
-
}
|
|
3756
|
-
const root = createTrie();
|
|
3757
|
-
function* iterateAllMatches(input) {
|
|
3758
|
-
var _a;
|
|
3759
|
-
let node = root;
|
|
3760
|
-
if (node.value) {
|
|
3761
|
-
yield* iterateSuffix(node.value, 0);
|
|
3762
|
-
}
|
|
3763
|
-
for (let i = 0; i < input.length; i++) {
|
|
3764
|
-
const child = (_a = node.children) == null ? void 0 : _a[input[i]];
|
|
3765
|
-
if (!child) break;
|
|
3766
|
-
if (child.value) {
|
|
3767
|
-
yield* iterateSuffix(child.value, i + 1);
|
|
3768
|
-
}
|
|
3769
|
-
node = child;
|
|
3770
|
-
}
|
|
3771
|
-
return;
|
|
3772
|
-
function* iterateSuffix(node2, start) {
|
|
3773
|
-
var _a2;
|
|
3774
|
-
if (node2.value) {
|
|
3775
|
-
yield node2.value;
|
|
3776
|
-
}
|
|
3777
|
-
for (let i = input.length - 1; i >= start; i--) {
|
|
3778
|
-
const child = (_a2 = node2.children) == null ? void 0 : _a2[input[i]];
|
|
3779
|
-
if (!child) break;
|
|
3780
|
-
if (child.value) {
|
|
3781
|
-
yield child.value;
|
|
3782
|
-
}
|
|
3783
|
-
node2 = child;
|
|
3784
|
-
}
|
|
3785
|
-
}
|
|
3786
|
-
}
|
|
3787
|
-
function set(prefix, suffix, fn) {
|
|
3788
|
-
let prefixNode = root;
|
|
3789
|
-
for (let i = 0; i < prefix.length; i++) {
|
|
3790
|
-
const char = prefix[i];
|
|
3791
|
-
const children = prefixNode.children ?? (prefixNode.children = {});
|
|
3792
|
-
const child = children[char] ?? (children[char] = createTrie());
|
|
3793
|
-
prefixNode = child;
|
|
3794
|
-
}
|
|
3795
|
-
let suffixNode = prefixNode.value ?? (prefixNode.value = createTrie());
|
|
3796
|
-
for (let i = suffix.length - 1; i >= 0; i--) {
|
|
3797
|
-
const char = suffix[i];
|
|
3798
|
-
const children = suffixNode.children ?? (suffixNode.children = {});
|
|
3799
|
-
const child = children[char] ?? (children[char] = createTrie());
|
|
3800
|
-
suffixNode = child;
|
|
3801
|
-
}
|
|
3802
|
-
suffixNode.value = fn(suffixNode.value);
|
|
3803
|
-
}
|
|
3804
|
-
function hasAnyMatch(input) {
|
|
3805
|
-
for (const _ of iterateAllMatches(input)) {
|
|
3806
|
-
return true;
|
|
3807
|
-
}
|
|
3808
|
-
return false;
|
|
3809
|
-
}
|
|
3810
|
-
return {
|
|
3811
|
-
iterateAllMatches,
|
|
3812
|
-
set,
|
|
3813
|
-
hasAnyMatch
|
|
3814
|
-
};
|
|
3815
|
-
}
|
|
3816
3749
|
|
|
3817
3750
|
// src/compiler/debug.ts
|
|
3818
3751
|
var LogLevel = /* @__PURE__ */ ((LogLevel3) => {
|
|
@@ -10737,6 +10670,7 @@ var Diagnostics = {
|
|
|
10737
10670
|
Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0: diag(6418, 3 /* Message */, "Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0_6418", "Searching all ancestor node_modules directories for fallback extensions: {0}."),
|
|
10738
10671
|
Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_program_needs_to_report_errors: diag(6419, 3 /* Message */, "Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_program_needs_to_report_errors_6419", "Project '{0}' is out of date because buildinfo file '{1}' indicates that program needs to report errors."),
|
|
10739
10672
|
Project_0_is_out_of_date_because_1: diag(6420, 3 /* Message */, "Project_0_is_out_of_date_because_1_6420", "Project '{0}' is out of date because {1}."),
|
|
10673
|
+
Rewrite_ts_tsx_mts_and_cts_file_extensions_in_relative_import_paths_to_their_JavaScript_equivalent_in_output_files: diag(6421, 3 /* Message */, "Rewrite_ts_tsx_mts_and_cts_file_extensions_in_relative_import_paths_to_their_JavaScript_equivalent_i_6421", "Rewrite '.ts', '.tsx', '.mts', and '.cts' file extensions in relative import paths to their JavaScript equivalent in output files."),
|
|
10740
10674
|
The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1: diag(6500, 3 /* Message */, "The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1_6500", "The expected type comes from property '{0}' which is declared here on type '{1}'"),
|
|
10741
10675
|
The_expected_type_comes_from_this_index_signature: diag(6501, 3 /* Message */, "The_expected_type_comes_from_this_index_signature_6501", "The expected type comes from this index signature."),
|
|
10742
10676
|
The_expected_type_comes_from_the_return_type_of_this_signature: diag(6502, 3 /* Message */, "The_expected_type_comes_from_the_return_type_of_this_signature_6502", "The expected type comes from the return type of this signature."),
|
|
@@ -21680,6 +21614,12 @@ function createComputedCompilerOptions(options) {
|
|
|
21680
21614
|
return options;
|
|
21681
21615
|
}
|
|
21682
21616
|
var computedOptions = createComputedCompilerOptions({
|
|
21617
|
+
allowImportingTsExtensions: {
|
|
21618
|
+
dependencies: ["rewriteRelativeImportExtensions"],
|
|
21619
|
+
computeValue: (compilerOptions) => {
|
|
21620
|
+
return !!(compilerOptions.allowImportingTsExtensions || compilerOptions.rewriteRelativeImportExtensions);
|
|
21621
|
+
}
|
|
21622
|
+
},
|
|
21683
21623
|
target: {
|
|
21684
21624
|
dependencies: ["module"],
|
|
21685
21625
|
computeValue: (compilerOptions) => {
|
|
@@ -21893,6 +21833,7 @@ var computedOptions = createComputedCompilerOptions({
|
|
|
21893
21833
|
}
|
|
21894
21834
|
}
|
|
21895
21835
|
});
|
|
21836
|
+
var getAllowImportingTsExtensions = computedOptions.allowImportingTsExtensions.computeValue;
|
|
21896
21837
|
var getEmitScriptTarget = computedOptions.target.computeValue;
|
|
21897
21838
|
var getEmitModuleKind = computedOptions.module.computeValue;
|
|
21898
21839
|
var getEmitModuleResolutionKind = computedOptions.moduleResolution.computeValue;
|
|
@@ -40992,6 +40933,15 @@ var commandOptionsWithoutBuild = [
|
|
|
40992
40933
|
defaultValueDescription: false,
|
|
40993
40934
|
transpileOptionValue: void 0
|
|
40994
40935
|
},
|
|
40936
|
+
{
|
|
40937
|
+
name: "rewriteRelativeImportExtensions",
|
|
40938
|
+
type: "boolean",
|
|
40939
|
+
affectsSemanticDiagnostics: true,
|
|
40940
|
+
affectsBuildInfo: true,
|
|
40941
|
+
category: Diagnostics.Modules,
|
|
40942
|
+
description: Diagnostics.Rewrite_ts_tsx_mts_and_cts_file_extensions_in_relative_import_paths_to_their_JavaScript_equivalent_in_output_files,
|
|
40943
|
+
defaultValueDescription: false
|
|
40944
|
+
},
|
|
40995
40945
|
{
|
|
40996
40946
|
name: "resolvePackageJsonExports",
|
|
40997
40947
|
type: "boolean",
|
|
@@ -45856,7 +45806,7 @@ function resolveFromTypeRoot(moduleName, state) {
|
|
|
45856
45806
|
}
|
|
45857
45807
|
}
|
|
45858
45808
|
function shouldAllowImportingTsExtension(compilerOptions, fromFileName) {
|
|
45859
|
-
return
|
|
45809
|
+
return getAllowImportingTsExtensions(compilerOptions) || fromFileName && isDeclarationFileName(fromFileName);
|
|
45860
45810
|
}
|
|
45861
45811
|
function loadModuleFromGlobalCache(moduleName, projectName, compilerOptions, host, globalCache, packageJsonInfoCache) {
|
|
45862
45812
|
const traceEnabled = isTraceEnabled(compilerOptions, host);
|
|
@@ -64611,38 +64561,13 @@ function createTypeChecker(host) {
|
|
|
64611
64561
|
}
|
|
64612
64562
|
}
|
|
64613
64563
|
function removeStringLiteralsMatchedByTemplateLiterals(types) {
|
|
64614
|
-
|
|
64615
|
-
|
|
64616
|
-
const estimatedCount = templateLiterals.length * countWhere(types, (t) => !!(t.flags & 128 /* StringLiteral */));
|
|
64617
|
-
if (estimatedCount > 0) {
|
|
64618
|
-
const trie = createPrefixSuffixTrie();
|
|
64619
|
-
forEach(templateLiterals, (t) => {
|
|
64620
|
-
const prefix = t.texts[0];
|
|
64621
|
-
const suffix = t.texts[t.texts.length - 1];
|
|
64622
|
-
trie.set(prefix, suffix, (templates) => append(templates, t));
|
|
64623
|
-
});
|
|
64624
|
-
let i = types.length;
|
|
64625
|
-
outer: while (i > 0) {
|
|
64626
|
-
i--;
|
|
64627
|
-
const t = types[i];
|
|
64628
|
-
if (!(t.flags & 128 /* StringLiteral */)) continue;
|
|
64629
|
-
const text = t.value;
|
|
64630
|
-
for (const templates of trie.iterateAllMatches(text)) {
|
|
64631
|
-
if (some(templates, (template) => isTypeMatchedByTemplateLiteralOrStringMapping(t, template))) {
|
|
64632
|
-
orderedRemoveItemAt(types, i);
|
|
64633
|
-
continue outer;
|
|
64634
|
-
}
|
|
64635
|
-
}
|
|
64636
|
-
}
|
|
64637
|
-
patterns = filter(patterns, (t) => !!(t.flags & 268435456 /* StringMapping */));
|
|
64638
|
-
}
|
|
64639
|
-
if (patterns.length) {
|
|
64564
|
+
const templates = filter(types, isPatternLiteralType);
|
|
64565
|
+
if (templates.length) {
|
|
64640
64566
|
let i = types.length;
|
|
64641
64567
|
while (i > 0) {
|
|
64642
64568
|
i--;
|
|
64643
64569
|
const t = types[i];
|
|
64644
|
-
if (
|
|
64645
|
-
if (some(patterns, (template) => isTypeMatchedByTemplateLiteralOrStringMapping(t, template))) {
|
|
64570
|
+
if (t.flags & 128 /* StringLiteral */ && some(templates, (template) => isTypeMatchedByTemplateLiteralOrStringMapping(t, template))) {
|
|
64646
64571
|
orderedRemoveItemAt(types, i);
|
|
64647
64572
|
}
|
|
64648
64573
|
}
|
|
@@ -82913,6 +82838,7 @@ function createTypeChecker(host) {
|
|
|
82913
82838
|
case 214 /* NewExpression */:
|
|
82914
82839
|
case 211 /* PropertyAccessExpression */:
|
|
82915
82840
|
case 229 /* YieldExpression */:
|
|
82841
|
+
case 110 /* ThisKeyword */:
|
|
82916
82842
|
return 3 /* Sometimes */;
|
|
82917
82843
|
case 226 /* BinaryExpression */:
|
|
82918
82844
|
switch (node.operatorToken.kind) {
|
|
@@ -97920,10 +97846,17 @@ function transformTypeScript(context) {
|
|
|
97920
97846
|
/*modifiers*/
|
|
97921
97847
|
void 0,
|
|
97922
97848
|
importClause,
|
|
97923
|
-
node.moduleSpecifier,
|
|
97849
|
+
rewriteModuleSpecifier(node.moduleSpecifier),
|
|
97924
97850
|
node.attributes
|
|
97925
97851
|
) : void 0;
|
|
97926
97852
|
}
|
|
97853
|
+
function rewriteModuleSpecifier(node) {
|
|
97854
|
+
if (!node || !compilerOptions.rewriteRelativeImportExtensions || !isStringLiteral(node) || !pathIsRelative(node.text) || isDeclarationFileName(node.text)) {
|
|
97855
|
+
return node;
|
|
97856
|
+
}
|
|
97857
|
+
const updatedText = changeExtension(node.text, getOutputExtension(node.text, compilerOptions));
|
|
97858
|
+
return updatedText !== node.text ? setOriginalNode(setTextRange(factory2.createStringLiteral(updatedText, node.singleQuote), node), node) : node;
|
|
97859
|
+
}
|
|
97927
97860
|
function visitImportClause(node) {
|
|
97928
97861
|
Debug.assert(!node.isTypeOnly);
|
|
97929
97862
|
const name = shouldEmitAliasDeclaration(node) ? node.name : void 0;
|
|
@@ -97956,7 +97889,14 @@ function transformTypeScript(context) {
|
|
|
97956
97889
|
return void 0;
|
|
97957
97890
|
}
|
|
97958
97891
|
if (!node.exportClause || isNamespaceExport(node.exportClause)) {
|
|
97959
|
-
return
|
|
97892
|
+
return factory2.updateExportDeclaration(
|
|
97893
|
+
node,
|
|
97894
|
+
node.modifiers,
|
|
97895
|
+
node.isTypeOnly,
|
|
97896
|
+
node.exportClause,
|
|
97897
|
+
rewriteModuleSpecifier(node.moduleSpecifier),
|
|
97898
|
+
node.attributes
|
|
97899
|
+
);
|
|
97960
97900
|
}
|
|
97961
97901
|
const allowEmpty = !!compilerOptions.verbatimModuleSyntax;
|
|
97962
97902
|
const exportClause = visitNode(
|
|
@@ -97970,7 +97910,7 @@ function transformTypeScript(context) {
|
|
|
97970
97910
|
void 0,
|
|
97971
97911
|
node.isTypeOnly,
|
|
97972
97912
|
exportClause,
|
|
97973
|
-
node.moduleSpecifier,
|
|
97913
|
+
rewriteModuleSpecifier(node.moduleSpecifier),
|
|
97974
97914
|
node.attributes
|
|
97975
97915
|
) : void 0;
|
|
97976
97916
|
}
|
|
@@ -97995,8 +97935,24 @@ function transformTypeScript(context) {
|
|
|
97995
97935
|
return void 0;
|
|
97996
97936
|
}
|
|
97997
97937
|
if (isExternalModuleImportEqualsDeclaration(node)) {
|
|
97998
|
-
|
|
97999
|
-
|
|
97938
|
+
if (!shouldEmitAliasDeclaration(node)) {
|
|
97939
|
+
return void 0;
|
|
97940
|
+
}
|
|
97941
|
+
const updatedModuleSpecifier = rewriteModuleSpecifier(node.moduleReference.expression);
|
|
97942
|
+
if (updatedModuleSpecifier !== node.moduleReference.expression) {
|
|
97943
|
+
return visitEachChild(
|
|
97944
|
+
factory2.updateImportEqualsDeclaration(
|
|
97945
|
+
node,
|
|
97946
|
+
node.modifiers,
|
|
97947
|
+
node.isTypeOnly,
|
|
97948
|
+
node.name,
|
|
97949
|
+
factory2.updateExternalModuleReference(node.moduleReference, updatedModuleSpecifier)
|
|
97950
|
+
),
|
|
97951
|
+
visitor,
|
|
97952
|
+
context
|
|
97953
|
+
);
|
|
97954
|
+
}
|
|
97955
|
+
return visitEachChild(node, visitor, context);
|
|
98000
97956
|
}
|
|
98001
97957
|
if (!shouldEmitImportEqualsDeclaration(node)) {
|
|
98002
97958
|
return void 0;
|
|
@@ -127422,7 +127378,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
127422
127378
|
createDiagnosticForOptionName(Diagnostics.Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System, "verbatimModuleSyntax");
|
|
127423
127379
|
}
|
|
127424
127380
|
}
|
|
127425
|
-
if (options.allowImportingTsExtensions && !(options.noEmit || options.emitDeclarationOnly)) {
|
|
127381
|
+
if (options.allowImportingTsExtensions && !(options.noEmit || options.emitDeclarationOnly || options.rewriteRelativeImportExtensions)) {
|
|
127426
127382
|
createOptionValueDiagnostic("allowImportingTsExtensions", Diagnostics.Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set);
|
|
127427
127383
|
}
|
|
127428
127384
|
const moduleResolution = getEmitModuleResolutionKind(options);
|
|
@@ -164832,9 +164788,13 @@ function createCompletionEntry(symbol, sortText, replacementToken, contextToken,
|
|
|
164832
164788
|
if (parentNamedImportOrExport) {
|
|
164833
164789
|
const languageVersion = getEmitScriptTarget(host.getCompilationSettings());
|
|
164834
164790
|
if (!isIdentifierText(name, languageVersion)) {
|
|
164835
|
-
insertText =
|
|
164791
|
+
insertText = quotePropertyName(sourceFile, preferences, name);
|
|
164836
164792
|
if (parentNamedImportOrExport.kind === 275 /* NamedImports */) {
|
|
164837
|
-
|
|
164793
|
+
scanner.setText(sourceFile.text);
|
|
164794
|
+
scanner.resetTokenState(position);
|
|
164795
|
+
if (!(scanner.scan() === 130 /* AsKeyword */ && scanner.scan() === 80 /* Identifier */)) {
|
|
164796
|
+
insertText += " as " + generateIdentifierForArbitraryString(name, languageVersion);
|
|
164797
|
+
}
|
|
164838
164798
|
}
|
|
164839
164799
|
} else if (parentNamedImportOrExport.kind === 275 /* NamedImports */) {
|
|
164840
164800
|
const possibleToken = stringToToken(name);
|
|
@@ -167002,7 +166962,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
|
|
|
167002
166962
|
case 153 /* SetKeyword */:
|
|
167003
166963
|
return !isFromObjectTypeDeclaration(contextToken2);
|
|
167004
166964
|
case 80 /* Identifier */: {
|
|
167005
|
-
if (containingNodeKind === 276 /* ImportSpecifier */ && contextToken2 === parent2.name && contextToken2.text === "type") {
|
|
166965
|
+
if ((containingNodeKind === 276 /* ImportSpecifier */ || containingNodeKind === 281 /* ExportSpecifier */) && contextToken2 === parent2.name && contextToken2.text === "type") {
|
|
167006
166966
|
return false;
|
|
167007
166967
|
}
|
|
167008
166968
|
const ancestorVariableDeclaration = findAncestor(
|
|
@@ -180243,7 +180203,6 @@ __export(ts_exports2, {
|
|
|
180243
180203
|
createPackageJsonInfo: () => createPackageJsonInfo,
|
|
180244
180204
|
createParenthesizerRules: () => createParenthesizerRules,
|
|
180245
180205
|
createPatternMatcher: () => createPatternMatcher,
|
|
180246
|
-
createPrefixSuffixTrie: () => createPrefixSuffixTrie,
|
|
180247
180206
|
createPrinter: () => createPrinter,
|
|
180248
180207
|
createPrinterWithDefaults: () => createPrinterWithDefaults,
|
|
180249
180208
|
createPrinterWithRemoveComments: () => createPrinterWithRemoveComments,
|
|
@@ -180448,6 +180407,7 @@ __export(ts_exports2, {
|
|
|
180448
180407
|
getAllKeys: () => getAllKeys,
|
|
180449
180408
|
getAllProjectOutputs: () => getAllProjectOutputs,
|
|
180450
180409
|
getAllSuperTypeNodes: () => getAllSuperTypeNodes,
|
|
180410
|
+
getAllowImportingTsExtensions: () => getAllowImportingTsExtensions,
|
|
180451
180411
|
getAllowJSCompilerOption: () => getAllowJSCompilerOption,
|
|
180452
180412
|
getAllowSyntheticDefaultImports: () => getAllowSyntheticDefaultImports,
|
|
180453
180413
|
getAncestor: () => getAncestor,
|
|
@@ -194602,7 +194562,6 @@ if (typeof console !== "undefined") {
|
|
|
194602
194562
|
createPackageJsonInfo,
|
|
194603
194563
|
createParenthesizerRules,
|
|
194604
194564
|
createPatternMatcher,
|
|
194605
|
-
createPrefixSuffixTrie,
|
|
194606
194565
|
createPrinter,
|
|
194607
194566
|
createPrinterWithDefaults,
|
|
194608
194567
|
createPrinterWithRemoveComments,
|
|
@@ -194807,6 +194766,7 @@ if (typeof console !== "undefined") {
|
|
|
194807
194766
|
getAllKeys,
|
|
194808
194767
|
getAllProjectOutputs,
|
|
194809
194768
|
getAllSuperTypeNodes,
|
|
194769
|
+
getAllowImportingTsExtensions,
|
|
194810
194770
|
getAllowJSCompilerOption,
|
|
194811
194771
|
getAllowSyntheticDefaultImports,
|
|
194812
194772
|
getAncestor,
|
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": "5.7.0-pr-
|
|
5
|
+
"version": "5.7.0-pr-59767-2",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|