typescript 5.2.0-dev.20230703 → 5.2.0-dev.20230705

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 CHANGED
@@ -18,7 +18,7 @@ and limitations under the License.
18
18
 
19
19
  // src/compiler/corePublic.ts
20
20
  var versionMajorMinor = "5.2";
21
- var version = `${versionMajorMinor}.0-dev.20230703`;
21
+ var version = `${versionMajorMinor}.0-dev.20230705`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -34107,6 +34107,7 @@ var commandOptionsWithoutBuild = [
34107
34107
  {
34108
34108
  name: "checkJs",
34109
34109
  type: "boolean",
34110
+ affectsModuleResolution: true,
34110
34111
  showInSimplifiedHelpView: true,
34111
34112
  category: Diagnostics.JavaScript_Support,
34112
34113
  description: Diagnostics.Enable_error_reporting_in_type_checked_JavaScript_files,
@@ -38305,6 +38306,9 @@ function loadModuleFromSelfNameReference(extensions, moduleName, directory, stat
38305
38306
  }
38306
38307
  const trailingParts = parts.slice(nameParts.length);
38307
38308
  const subpath = !length(trailingParts) ? "." : `.${directorySeparator}${trailingParts.join(directorySeparator)}`;
38309
+ if (getAllowJSCompilerOption(state.compilerOptions) && !pathContainsNodeModules(directory)) {
38310
+ return loadModuleFromExports(scope, extensions, subpath, state, cache, redirectedReference);
38311
+ }
38308
38312
  const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
38309
38313
  const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
38310
38314
  return loadModuleFromExports(scope, priorityExtensions, subpath, state, cache, redirectedReference) || loadModuleFromExports(scope, secondaryExtensions, subpath, state, cache, redirectedReference);
@@ -42531,7 +42535,9 @@ function tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, hos
42531
42535
  for (const { ending, value } of candidates) {
42532
42536
  if (value.length >= prefix.length + suffix.length && startsWith(value, prefix) && endsWith(value, suffix) && validateEnding({ ending, value })) {
42533
42537
  const matchedStar = value.substring(prefix.length, value.length - suffix.length);
42534
- return pathIsRelative(matchedStar) ? void 0 : key.replace("*", matchedStar);
42538
+ if (!pathIsRelative(matchedStar)) {
42539
+ return key.replace("*", matchedStar);
42540
+ }
42535
42541
  }
42536
42542
  }
42537
42543
  } else if (some(candidates, (c) => c.ending !== 0 /* Minimal */ && pattern === c.value) || some(candidates, (c) => c.ending === 0 /* Minimal */ && pattern === c.value && validateEnding(c))) {
package/lib/tsserver.js CHANGED
@@ -2327,7 +2327,7 @@ module.exports = __toCommonJS(server_exports);
2327
2327
 
2328
2328
  // src/compiler/corePublic.ts
2329
2329
  var versionMajorMinor = "5.2";
2330
- var version = `${versionMajorMinor}.0-dev.20230703`;
2330
+ var version = `${versionMajorMinor}.0-dev.20230705`;
2331
2331
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2332
2332
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2333
2333
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -38505,6 +38505,7 @@ var commandOptionsWithoutBuild = [
38505
38505
  {
38506
38506
  name: "checkJs",
38507
38507
  type: "boolean",
38508
+ affectsModuleResolution: true,
38508
38509
  showInSimplifiedHelpView: true,
38509
38510
  category: Diagnostics.JavaScript_Support,
38510
38511
  description: Diagnostics.Enable_error_reporting_in_type_checked_JavaScript_files,
@@ -42915,6 +42916,9 @@ function loadModuleFromSelfNameReference(extensions, moduleName, directory, stat
42915
42916
  }
42916
42917
  const trailingParts = parts.slice(nameParts.length);
42917
42918
  const subpath = !length(trailingParts) ? "." : `.${directorySeparator}${trailingParts.join(directorySeparator)}`;
42919
+ if (getAllowJSCompilerOption(state.compilerOptions) && !pathContainsNodeModules(directory)) {
42920
+ return loadModuleFromExports(scope, extensions, subpath, state, cache, redirectedReference);
42921
+ }
42918
42922
  const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
42919
42923
  const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
42920
42924
  return loadModuleFromExports(scope, priorityExtensions, subpath, state, cache, redirectedReference) || loadModuleFromExports(scope, secondaryExtensions, subpath, state, cache, redirectedReference);
@@ -47207,7 +47211,9 @@ function tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, hos
47207
47211
  for (const { ending, value } of candidates) {
47208
47212
  if (value.length >= prefix.length + suffix.length && startsWith(value, prefix) && endsWith(value, suffix) && validateEnding({ ending, value })) {
47209
47213
  const matchedStar = value.substring(prefix.length, value.length - suffix.length);
47210
- return pathIsRelative(matchedStar) ? void 0 : key.replace("*", matchedStar);
47214
+ if (!pathIsRelative(matchedStar)) {
47215
+ return key.replace("*", matchedStar);
47216
+ }
47211
47217
  }
47212
47218
  }
47213
47219
  } else if (some(candidates, (c) => c.ending !== 0 /* Minimal */ && pattern === c.value) || some(candidates, (c) => c.ending === 0 /* Minimal */ && pattern === c.value && validateEnding(c))) {
@@ -161188,16 +161194,18 @@ function getModulesForPathsPattern(fragment, packageDirectory, pattern, extensio
161188
161194
  const fragmentDirectory = fragmentHasPath ? hasTrailingDirectorySeparator(fragment) ? fragment : getDirectoryPath(fragment) : void 0;
161189
161195
  const expandedPrefixDirectory = fragmentHasPath ? combinePaths(normalizedPrefixDirectory, normalizedPrefixBase + fragmentDirectory) : normalizedPrefixDirectory;
161190
161196
  const normalizedSuffix = normalizePath(parsed.suffix);
161197
+ const declarationExtension = normalizedSuffix && getDeclarationEmitExtensionForPath("_" + normalizedSuffix);
161198
+ const matchingSuffixes = declarationExtension ? [changeExtension(normalizedSuffix, declarationExtension), normalizedSuffix] : [normalizedSuffix];
161191
161199
  const baseDirectory = normalizePath(combinePaths(packageDirectory, expandedPrefixDirectory));
161192
161200
  const completePrefix = fragmentHasPath ? baseDirectory : ensureTrailingDirectorySeparator(baseDirectory) + normalizedPrefixBase;
161193
- const includeGlob = normalizedSuffix ? "**/*" + normalizedSuffix : "./*";
161201
+ const includeGlobs = normalizedSuffix ? matchingSuffixes.map((suffix) => "**/*" + suffix) : ["./*"];
161194
161202
  const matches = mapDefined(tryReadDirectory(
161195
161203
  host,
161196
161204
  baseDirectory,
161197
161205
  extensionOptions.extensionsToSearch,
161198
161206
  /*exclude*/
161199
161207
  void 0,
161200
- [includeGlob]
161208
+ includeGlobs
161201
161209
  ), (match) => {
161202
161210
  const trimmedWithPattern = trimPrefixAndSuffix(match);
161203
161211
  if (trimmedWithPattern) {
@@ -161211,8 +161219,10 @@ function getModulesForPathsPattern(fragment, packageDirectory, pattern, extensio
161211
161219
  const directories = normalizedSuffix ? emptyArray : mapDefined(tryGetDirectories(host, baseDirectory), (dir) => dir === "node_modules" ? void 0 : directoryResult(dir));
161212
161220
  return [...matches, ...directories];
161213
161221
  function trimPrefixAndSuffix(path) {
161214
- const inner = withoutStartAndEnd(normalizePath(path), completePrefix, normalizedSuffix);
161215
- return inner === void 0 ? void 0 : removeLeadingDirectorySeparator(inner);
161222
+ return firstDefined(matchingSuffixes, (suffix) => {
161223
+ const inner = withoutStartAndEnd(normalizePath(path), completePrefix, suffix);
161224
+ return inner === void 0 ? void 0 : removeLeadingDirectorySeparator(inner);
161225
+ });
161216
161226
  }
161217
161227
  }
161218
161228
  function withoutStartAndEnd(s, start2, end) {
@@ -35,7 +35,7 @@ var ts = (() => {
35
35
  "src/compiler/corePublic.ts"() {
36
36
  "use strict";
37
37
  versionMajorMinor = "5.2";
38
- version = `${versionMajorMinor}.0-dev.20230703`;
38
+ version = `${versionMajorMinor}.0-dev.20230705`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -37987,6 +37987,7 @@ ${lanes.join("\n")}
37987
37987
  {
37988
37988
  name: "checkJs",
37989
37989
  type: "boolean",
37990
+ affectsModuleResolution: true,
37990
37991
  showInSimplifiedHelpView: true,
37991
37992
  category: Diagnostics.JavaScript_Support,
37992
37993
  description: Diagnostics.Enable_error_reporting_in_type_checked_JavaScript_files,
@@ -40760,6 +40761,9 @@ ${lanes.join("\n")}
40760
40761
  }
40761
40762
  const trailingParts = parts.slice(nameParts.length);
40762
40763
  const subpath = !length(trailingParts) ? "." : `.${directorySeparator}${trailingParts.join(directorySeparator)}`;
40764
+ if (getAllowJSCompilerOption(state.compilerOptions) && !pathContainsNodeModules(directory)) {
40765
+ return loadModuleFromExports(scope, extensions, subpath, state, cache, redirectedReference);
40766
+ }
40763
40767
  const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
40764
40768
  const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
40765
40769
  return loadModuleFromExports(scope, priorityExtensions, subpath, state, cache, redirectedReference) || loadModuleFromExports(scope, secondaryExtensions, subpath, state, cache, redirectedReference);
@@ -45073,7 +45077,9 @@ ${lanes.join("\n")}
45073
45077
  for (const { ending, value } of candidates) {
45074
45078
  if (value.length >= prefix.length + suffix.length && startsWith(value, prefix) && endsWith(value, suffix) && validateEnding({ ending, value })) {
45075
45079
  const matchedStar = value.substring(prefix.length, value.length - suffix.length);
45076
- return pathIsRelative(matchedStar) ? void 0 : key.replace("*", matchedStar);
45080
+ if (!pathIsRelative(matchedStar)) {
45081
+ return key.replace("*", matchedStar);
45082
+ }
45077
45083
  }
45078
45084
  }
45079
45085
  } else if (some(candidates, (c) => c.ending !== 0 /* Minimal */ && pattern === c.value) || some(candidates, (c) => c.ending === 0 /* Minimal */ && pattern === c.value && validateEnding(c))) {
@@ -160464,16 +160470,18 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
160464
160470
  const fragmentDirectory = fragmentHasPath ? hasTrailingDirectorySeparator(fragment) ? fragment : getDirectoryPath(fragment) : void 0;
160465
160471
  const expandedPrefixDirectory = fragmentHasPath ? combinePaths(normalizedPrefixDirectory, normalizedPrefixBase + fragmentDirectory) : normalizedPrefixDirectory;
160466
160472
  const normalizedSuffix = normalizePath(parsed.suffix);
160473
+ const declarationExtension = normalizedSuffix && getDeclarationEmitExtensionForPath("_" + normalizedSuffix);
160474
+ const matchingSuffixes = declarationExtension ? [changeExtension(normalizedSuffix, declarationExtension), normalizedSuffix] : [normalizedSuffix];
160467
160475
  const baseDirectory = normalizePath(combinePaths(packageDirectory, expandedPrefixDirectory));
160468
160476
  const completePrefix = fragmentHasPath ? baseDirectory : ensureTrailingDirectorySeparator(baseDirectory) + normalizedPrefixBase;
160469
- const includeGlob = normalizedSuffix ? "**/*" + normalizedSuffix : "./*";
160477
+ const includeGlobs = normalizedSuffix ? matchingSuffixes.map((suffix) => "**/*" + suffix) : ["./*"];
160470
160478
  const matches = mapDefined(tryReadDirectory(
160471
160479
  host,
160472
160480
  baseDirectory,
160473
160481
  extensionOptions.extensionsToSearch,
160474
160482
  /*exclude*/
160475
160483
  void 0,
160476
- [includeGlob]
160484
+ includeGlobs
160477
160485
  ), (match) => {
160478
160486
  const trimmedWithPattern = trimPrefixAndSuffix(match);
160479
160487
  if (trimmedWithPattern) {
@@ -160487,8 +160495,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
160487
160495
  const directories = normalizedSuffix ? emptyArray : mapDefined(tryGetDirectories(host, baseDirectory), (dir) => dir === "node_modules" ? void 0 : directoryResult(dir));
160488
160496
  return [...matches, ...directories];
160489
160497
  function trimPrefixAndSuffix(path) {
160490
- const inner = withoutStartAndEnd(normalizePath(path), completePrefix, normalizedSuffix);
160491
- return inner === void 0 ? void 0 : removeLeadingDirectorySeparator(inner);
160498
+ return firstDefined(matchingSuffixes, (suffix) => {
160499
+ const inner = withoutStartAndEnd(normalizePath(path), completePrefix, suffix);
160500
+ return inner === void 0 ? void 0 : removeLeadingDirectorySeparator(inner);
160501
+ });
160492
160502
  }
160493
160503
  }
160494
160504
  function withoutStartAndEnd(s, start, end) {
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.2";
38
- version = `${versionMajorMinor}.0-dev.20230703`;
38
+ version = `${versionMajorMinor}.0-dev.20230705`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -37987,6 +37987,7 @@ ${lanes.join("\n")}
37987
37987
  {
37988
37988
  name: "checkJs",
37989
37989
  type: "boolean",
37990
+ affectsModuleResolution: true,
37990
37991
  showInSimplifiedHelpView: true,
37991
37992
  category: Diagnostics.JavaScript_Support,
37992
37993
  description: Diagnostics.Enable_error_reporting_in_type_checked_JavaScript_files,
@@ -40760,6 +40761,9 @@ ${lanes.join("\n")}
40760
40761
  }
40761
40762
  const trailingParts = parts.slice(nameParts.length);
40762
40763
  const subpath = !length(trailingParts) ? "." : `.${directorySeparator}${trailingParts.join(directorySeparator)}`;
40764
+ if (getAllowJSCompilerOption(state.compilerOptions) && !pathContainsNodeModules(directory)) {
40765
+ return loadModuleFromExports(scope, extensions, subpath, state, cache, redirectedReference);
40766
+ }
40763
40767
  const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
40764
40768
  const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
40765
40769
  return loadModuleFromExports(scope, priorityExtensions, subpath, state, cache, redirectedReference) || loadModuleFromExports(scope, secondaryExtensions, subpath, state, cache, redirectedReference);
@@ -45073,7 +45077,9 @@ ${lanes.join("\n")}
45073
45077
  for (const { ending, value } of candidates) {
45074
45078
  if (value.length >= prefix.length + suffix.length && startsWith(value, prefix) && endsWith(value, suffix) && validateEnding({ ending, value })) {
45075
45079
  const matchedStar = value.substring(prefix.length, value.length - suffix.length);
45076
- return pathIsRelative(matchedStar) ? void 0 : key.replace("*", matchedStar);
45080
+ if (!pathIsRelative(matchedStar)) {
45081
+ return key.replace("*", matchedStar);
45082
+ }
45077
45083
  }
45078
45084
  }
45079
45085
  } else if (some(candidates, (c) => c.ending !== 0 /* Minimal */ && pattern === c.value) || some(candidates, (c) => c.ending === 0 /* Minimal */ && pattern === c.value && validateEnding(c))) {
@@ -160479,16 +160485,18 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
160479
160485
  const fragmentDirectory = fragmentHasPath ? hasTrailingDirectorySeparator(fragment) ? fragment : getDirectoryPath(fragment) : void 0;
160480
160486
  const expandedPrefixDirectory = fragmentHasPath ? combinePaths(normalizedPrefixDirectory, normalizedPrefixBase + fragmentDirectory) : normalizedPrefixDirectory;
160481
160487
  const normalizedSuffix = normalizePath(parsed.suffix);
160488
+ const declarationExtension = normalizedSuffix && getDeclarationEmitExtensionForPath("_" + normalizedSuffix);
160489
+ const matchingSuffixes = declarationExtension ? [changeExtension(normalizedSuffix, declarationExtension), normalizedSuffix] : [normalizedSuffix];
160482
160490
  const baseDirectory = normalizePath(combinePaths(packageDirectory, expandedPrefixDirectory));
160483
160491
  const completePrefix = fragmentHasPath ? baseDirectory : ensureTrailingDirectorySeparator(baseDirectory) + normalizedPrefixBase;
160484
- const includeGlob = normalizedSuffix ? "**/*" + normalizedSuffix : "./*";
160492
+ const includeGlobs = normalizedSuffix ? matchingSuffixes.map((suffix) => "**/*" + suffix) : ["./*"];
160485
160493
  const matches = mapDefined(tryReadDirectory(
160486
160494
  host,
160487
160495
  baseDirectory,
160488
160496
  extensionOptions.extensionsToSearch,
160489
160497
  /*exclude*/
160490
160498
  void 0,
160491
- [includeGlob]
160499
+ includeGlobs
160492
160500
  ), (match) => {
160493
160501
  const trimmedWithPattern = trimPrefixAndSuffix(match);
160494
160502
  if (trimmedWithPattern) {
@@ -160502,8 +160510,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
160502
160510
  const directories = normalizedSuffix ? emptyArray : mapDefined(tryGetDirectories(host, baseDirectory), (dir) => dir === "node_modules" ? void 0 : directoryResult(dir));
160503
160511
  return [...matches, ...directories];
160504
160512
  function trimPrefixAndSuffix(path) {
160505
- const inner = withoutStartAndEnd(normalizePath(path), completePrefix, normalizedSuffix);
160506
- return inner === void 0 ? void 0 : removeLeadingDirectorySeparator(inner);
160513
+ return firstDefined(matchingSuffixes, (suffix) => {
160514
+ const inner = withoutStartAndEnd(normalizePath(path), completePrefix, suffix);
160515
+ return inner === void 0 ? void 0 : removeLeadingDirectorySeparator(inner);
160516
+ });
160507
160517
  }
160508
160518
  }
160509
160519
  function withoutStartAndEnd(s, start, end) {
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
54
54
 
55
55
  // src/compiler/corePublic.ts
56
56
  var versionMajorMinor = "5.2";
57
- var version = `${versionMajorMinor}.0-dev.20230703`;
57
+ var version = `${versionMajorMinor}.0-dev.20230705`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
@@ -11303,6 +11303,9 @@ function getResolveJsonModule(compilerOptions) {
11303
11303
  }
11304
11304
  return getEmitModuleResolutionKind(compilerOptions) === 100 /* Bundler */;
11305
11305
  }
11306
+ function getAllowJSCompilerOption(compilerOptions) {
11307
+ return compilerOptions.allowJs === void 0 ? !!compilerOptions.checkJs : compilerOptions.allowJs;
11308
+ }
11306
11309
  var reservedCharacterPattern = /[^\w\s\/]/g;
11307
11310
  var wildcardCharCodes = [42 /* asterisk */, 63 /* question */];
11308
11311
  var commonPackageFolders = ["node_modules", "bower_components", "jspm_packages"];
@@ -26006,6 +26009,7 @@ var commandOptionsWithoutBuild = [
26006
26009
  {
26007
26010
  name: "checkJs",
26008
26011
  type: "boolean",
26012
+ affectsModuleResolution: true,
26009
26013
  showInSimplifiedHelpView: true,
26010
26014
  category: Diagnostics.JavaScript_Support,
26011
26015
  description: Diagnostics.Enable_error_reporting_in_type_checked_JavaScript_files,
@@ -28251,6 +28255,9 @@ function loadModuleFromSelfNameReference(extensions, moduleName, directory, stat
28251
28255
  }
28252
28256
  const trailingParts = parts.slice(nameParts.length);
28253
28257
  const subpath = !length(trailingParts) ? "." : `.${directorySeparator}${trailingParts.join(directorySeparator)}`;
28258
+ if (getAllowJSCompilerOption(state.compilerOptions) && !pathContainsNodeModules(directory)) {
28259
+ return loadModuleFromExports(scope, extensions, subpath, state, cache, redirectedReference);
28260
+ }
28254
28261
  const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
28255
28262
  const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
28256
28263
  return loadModuleFromExports(scope, priorityExtensions, subpath, state, cache, redirectedReference) || loadModuleFromExports(scope, secondaryExtensions, subpath, state, cache, redirectedReference);
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.2.0-dev.20230703",
5
+ "version": "5.2.0-dev.20230705",
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": "88cb76d314a93937ce8d9543114ccbad993be6d1"
117
+ "gitHead": "e89d42d373a570f12510429e13ec45a9eccd9ed0"
118
118
  }