typescript 5.3.0-dev.20231020 → 5.3.0-dev.20231022
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 +1 -1
- package/lib/tsserver.js +16 -11
- package/lib/typescript.d.ts +1 -0
- package/lib/typescript.js +16 -11
- package/lib/typingsInstaller.js +1 -1
- package/package.json +2 -2
package/lib/tsc.js
CHANGED
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
20
|
var versionMajorMinor = "5.3";
|
|
21
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
21
|
+
var version = `${versionMajorMinor}.0-dev.20231022`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
package/lib/tsserver.js
CHANGED
|
@@ -2328,7 +2328,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2328
2328
|
|
|
2329
2329
|
// src/compiler/corePublic.ts
|
|
2330
2330
|
var versionMajorMinor = "5.3";
|
|
2331
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
2331
|
+
var version = `${versionMajorMinor}.0-dev.20231022`;
|
|
2332
2332
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2333
2333
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2334
2334
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -149961,7 +149961,8 @@ function createImportAdderWorker(sourceFile, program, useAutoImportProvider, pre
|
|
|
149961
149961
|
defaultImport,
|
|
149962
149962
|
namedImports && arrayFrom(namedImports.entries(), ([name, addAsTypeOnly]) => ({ addAsTypeOnly, name })),
|
|
149963
149963
|
namespaceLikeImport,
|
|
149964
|
-
compilerOptions
|
|
149964
|
+
compilerOptions,
|
|
149965
|
+
preferences
|
|
149965
149966
|
);
|
|
149966
149967
|
newDeclarations = combine(newDeclarations, declarations);
|
|
149967
149968
|
});
|
|
@@ -150666,7 +150667,8 @@ function codeActionForFixWorker(changes, sourceFile, symbolName2, fix, includeSy
|
|
|
150666
150667
|
defaultImport,
|
|
150667
150668
|
namedImports,
|
|
150668
150669
|
namespaceLikeImport,
|
|
150669
|
-
program.getCompilerOptions()
|
|
150670
|
+
program.getCompilerOptions(),
|
|
150671
|
+
preferences
|
|
150670
150672
|
),
|
|
150671
150673
|
/*blankLineBetween*/
|
|
150672
150674
|
true,
|
|
@@ -150798,7 +150800,7 @@ function doAddExistingFix(changes, sourceFile, clause, defaultImport, namedImpor
|
|
|
150798
150800
|
const newSpecifiers = stableSort(
|
|
150799
150801
|
namedImports.map(
|
|
150800
150802
|
(namedImport) => factory.createImportSpecifier(
|
|
150801
|
-
(!clause.isTypeOnly || promoteFromTypeOnly2) &&
|
|
150803
|
+
(!clause.isTypeOnly || promoteFromTypeOnly2) && shouldUseTypeOnly(namedImport, preferences),
|
|
150802
150804
|
/*propertyName*/
|
|
150803
150805
|
void 0,
|
|
150804
150806
|
factory.createIdentifier(namedImport.name)
|
|
@@ -150862,21 +150864,24 @@ function getImportTypePrefix(moduleSpecifier, quotePreference) {
|
|
|
150862
150864
|
function needsTypeOnly({ addAsTypeOnly }) {
|
|
150863
150865
|
return addAsTypeOnly === 2 /* Required */;
|
|
150864
150866
|
}
|
|
150865
|
-
function
|
|
150867
|
+
function shouldUseTypeOnly(info, preferences) {
|
|
150868
|
+
return needsTypeOnly(info) || !!preferences.preferTypeOnlyAutoImports && info.addAsTypeOnly !== 4 /* NotAllowed */;
|
|
150869
|
+
}
|
|
150870
|
+
function getNewImports(moduleSpecifier, quotePreference, defaultImport, namedImports, namespaceLikeImport, compilerOptions, preferences) {
|
|
150866
150871
|
const quotedModuleSpecifier = makeStringLiteral(moduleSpecifier, quotePreference);
|
|
150867
150872
|
let statements;
|
|
150868
150873
|
if (defaultImport !== void 0 || (namedImports == null ? void 0 : namedImports.length)) {
|
|
150869
|
-
const topLevelTypeOnly = (!defaultImport || needsTypeOnly(defaultImport)) && every(namedImports, needsTypeOnly) || compilerOptions.verbatimModuleSyntax && (defaultImport == null ? void 0 : defaultImport.addAsTypeOnly) !== 4 /* NotAllowed */ && !some(namedImports, (i) => i.addAsTypeOnly === 4 /* NotAllowed */);
|
|
150874
|
+
const topLevelTypeOnly = (!defaultImport || needsTypeOnly(defaultImport)) && every(namedImports, needsTypeOnly) || (compilerOptions.verbatimModuleSyntax || preferences.preferTypeOnlyAutoImports) && (defaultImport == null ? void 0 : defaultImport.addAsTypeOnly) !== 4 /* NotAllowed */ && !some(namedImports, (i) => i.addAsTypeOnly === 4 /* NotAllowed */);
|
|
150870
150875
|
statements = combine(
|
|
150871
150876
|
statements,
|
|
150872
150877
|
makeImport(
|
|
150873
150878
|
defaultImport && factory.createIdentifier(defaultImport.name),
|
|
150874
150879
|
namedImports == null ? void 0 : namedImports.map(
|
|
150875
|
-
(
|
|
150876
|
-
!topLevelTypeOnly &&
|
|
150880
|
+
(namedImport) => factory.createImportSpecifier(
|
|
150881
|
+
!topLevelTypeOnly && shouldUseTypeOnly(namedImport, preferences),
|
|
150877
150882
|
/*propertyName*/
|
|
150878
150883
|
void 0,
|
|
150879
|
-
factory.createIdentifier(name)
|
|
150884
|
+
factory.createIdentifier(namedImport.name)
|
|
150880
150885
|
)
|
|
150881
150886
|
),
|
|
150882
150887
|
moduleSpecifier,
|
|
@@ -150889,14 +150894,14 @@ function getNewImports(moduleSpecifier, quotePreference, defaultImport, namedImp
|
|
|
150889
150894
|
const declaration = namespaceLikeImport.importKind === 3 /* CommonJS */ ? factory.createImportEqualsDeclaration(
|
|
150890
150895
|
/*modifiers*/
|
|
150891
150896
|
void 0,
|
|
150892
|
-
|
|
150897
|
+
shouldUseTypeOnly(namespaceLikeImport, preferences),
|
|
150893
150898
|
factory.createIdentifier(namespaceLikeImport.name),
|
|
150894
150899
|
factory.createExternalModuleReference(quotedModuleSpecifier)
|
|
150895
150900
|
) : factory.createImportDeclaration(
|
|
150896
150901
|
/*modifiers*/
|
|
150897
150902
|
void 0,
|
|
150898
150903
|
factory.createImportClause(
|
|
150899
|
-
|
|
150904
|
+
shouldUseTypeOnly(namespaceLikeImport, preferences),
|
|
150900
150905
|
/*name*/
|
|
150901
150906
|
void 0,
|
|
150902
150907
|
factory.createNamespaceImport(factory.createIdentifier(namespaceLikeImport.name))
|
package/lib/typescript.d.ts
CHANGED
|
@@ -8742,6 +8742,7 @@ declare namespace ts {
|
|
|
8742
8742
|
readonly interactiveInlayHints?: boolean;
|
|
8743
8743
|
readonly allowRenameOfImportPath?: boolean;
|
|
8744
8744
|
readonly autoImportFileExcludePatterns?: string[];
|
|
8745
|
+
readonly preferTypeOnlyAutoImports?: boolean;
|
|
8745
8746
|
readonly organizeImportsIgnoreCase?: "auto" | boolean;
|
|
8746
8747
|
readonly organizeImportsCollation?: "ordinal" | "unicode";
|
|
8747
8748
|
readonly organizeImportsLocale?: string;
|
package/lib/typescript.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.3";
|
|
38
|
-
version = `${versionMajorMinor}.0-dev.
|
|
38
|
+
version = `${versionMajorMinor}.0-dev.20231022`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -148682,7 +148682,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
148682
148682
|
defaultImport,
|
|
148683
148683
|
namedImports && arrayFrom(namedImports.entries(), ([name, addAsTypeOnly]) => ({ addAsTypeOnly, name })),
|
|
148684
148684
|
namespaceLikeImport,
|
|
148685
|
-
compilerOptions
|
|
148685
|
+
compilerOptions,
|
|
148686
|
+
preferences
|
|
148686
148687
|
);
|
|
148687
148688
|
newDeclarations = combine(newDeclarations, declarations);
|
|
148688
148689
|
});
|
|
@@ -149387,7 +149388,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
149387
149388
|
defaultImport,
|
|
149388
149389
|
namedImports,
|
|
149389
149390
|
namespaceLikeImport,
|
|
149390
|
-
program.getCompilerOptions()
|
|
149391
|
+
program.getCompilerOptions(),
|
|
149392
|
+
preferences
|
|
149391
149393
|
),
|
|
149392
149394
|
/*blankLineBetween*/
|
|
149393
149395
|
true,
|
|
@@ -149519,7 +149521,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
149519
149521
|
const newSpecifiers = stableSort(
|
|
149520
149522
|
namedImports.map(
|
|
149521
149523
|
(namedImport) => factory.createImportSpecifier(
|
|
149522
|
-
(!clause.isTypeOnly || promoteFromTypeOnly2) &&
|
|
149524
|
+
(!clause.isTypeOnly || promoteFromTypeOnly2) && shouldUseTypeOnly(namedImport, preferences),
|
|
149523
149525
|
/*propertyName*/
|
|
149524
149526
|
void 0,
|
|
149525
149527
|
factory.createIdentifier(namedImport.name)
|
|
@@ -149583,21 +149585,24 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
149583
149585
|
function needsTypeOnly({ addAsTypeOnly }) {
|
|
149584
149586
|
return addAsTypeOnly === 2 /* Required */;
|
|
149585
149587
|
}
|
|
149586
|
-
function
|
|
149588
|
+
function shouldUseTypeOnly(info, preferences) {
|
|
149589
|
+
return needsTypeOnly(info) || !!preferences.preferTypeOnlyAutoImports && info.addAsTypeOnly !== 4 /* NotAllowed */;
|
|
149590
|
+
}
|
|
149591
|
+
function getNewImports(moduleSpecifier, quotePreference, defaultImport, namedImports, namespaceLikeImport, compilerOptions, preferences) {
|
|
149587
149592
|
const quotedModuleSpecifier = makeStringLiteral(moduleSpecifier, quotePreference);
|
|
149588
149593
|
let statements;
|
|
149589
149594
|
if (defaultImport !== void 0 || (namedImports == null ? void 0 : namedImports.length)) {
|
|
149590
|
-
const topLevelTypeOnly = (!defaultImport || needsTypeOnly(defaultImport)) && every(namedImports, needsTypeOnly) || compilerOptions.verbatimModuleSyntax && (defaultImport == null ? void 0 : defaultImport.addAsTypeOnly) !== 4 /* NotAllowed */ && !some(namedImports, (i) => i.addAsTypeOnly === 4 /* NotAllowed */);
|
|
149595
|
+
const topLevelTypeOnly = (!defaultImport || needsTypeOnly(defaultImport)) && every(namedImports, needsTypeOnly) || (compilerOptions.verbatimModuleSyntax || preferences.preferTypeOnlyAutoImports) && (defaultImport == null ? void 0 : defaultImport.addAsTypeOnly) !== 4 /* NotAllowed */ && !some(namedImports, (i) => i.addAsTypeOnly === 4 /* NotAllowed */);
|
|
149591
149596
|
statements = combine(
|
|
149592
149597
|
statements,
|
|
149593
149598
|
makeImport(
|
|
149594
149599
|
defaultImport && factory.createIdentifier(defaultImport.name),
|
|
149595
149600
|
namedImports == null ? void 0 : namedImports.map(
|
|
149596
|
-
(
|
|
149597
|
-
!topLevelTypeOnly &&
|
|
149601
|
+
(namedImport) => factory.createImportSpecifier(
|
|
149602
|
+
!topLevelTypeOnly && shouldUseTypeOnly(namedImport, preferences),
|
|
149598
149603
|
/*propertyName*/
|
|
149599
149604
|
void 0,
|
|
149600
|
-
factory.createIdentifier(name)
|
|
149605
|
+
factory.createIdentifier(namedImport.name)
|
|
149601
149606
|
)
|
|
149602
149607
|
),
|
|
149603
149608
|
moduleSpecifier,
|
|
@@ -149610,14 +149615,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
149610
149615
|
const declaration = namespaceLikeImport.importKind === 3 /* CommonJS */ ? factory.createImportEqualsDeclaration(
|
|
149611
149616
|
/*modifiers*/
|
|
149612
149617
|
void 0,
|
|
149613
|
-
|
|
149618
|
+
shouldUseTypeOnly(namespaceLikeImport, preferences),
|
|
149614
149619
|
factory.createIdentifier(namespaceLikeImport.name),
|
|
149615
149620
|
factory.createExternalModuleReference(quotedModuleSpecifier)
|
|
149616
149621
|
) : factory.createImportDeclaration(
|
|
149617
149622
|
/*modifiers*/
|
|
149618
149623
|
void 0,
|
|
149619
149624
|
factory.createImportClause(
|
|
149620
|
-
|
|
149625
|
+
shouldUseTypeOnly(namespaceLikeImport, preferences),
|
|
149621
149626
|
/*name*/
|
|
149622
149627
|
void 0,
|
|
149623
149628
|
factory.createNamespaceImport(factory.createIdentifier(namespaceLikeImport.name))
|
package/lib/typingsInstaller.js
CHANGED
|
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
|
|
|
54
54
|
|
|
55
55
|
// src/compiler/corePublic.ts
|
|
56
56
|
var versionMajorMinor = "5.3";
|
|
57
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
57
|
+
var version = `${versionMajorMinor}.0-dev.20231022`;
|
|
58
58
|
|
|
59
59
|
// src/compiler/core.ts
|
|
60
60
|
var emptyArray = [];
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "typescript",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "5.3.0-dev.
|
|
5
|
+
"version": "5.3.0-dev.20231022",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -114,5 +114,5 @@
|
|
|
114
114
|
"node": "20.1.0",
|
|
115
115
|
"npm": "8.19.4"
|
|
116
116
|
},
|
|
117
|
-
"gitHead": "
|
|
117
|
+
"gitHead": "8af8f3c4d1e5cc6654916de9f42e9ba370513157"
|
|
118
118
|
}
|