@typescript-deploys/pr-build 5.8.0-pr-60039-24 → 5.8.0-pr-60576-12

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.8";
21
- var version = `${versionMajorMinor}.0-insiders.20241203`;
21
+ var version = `${versionMajorMinor}.0-insiders.20241204`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -11144,6 +11144,7 @@ function sortAndDeduplicateDiagnostics(diagnostics) {
11144
11144
  }
11145
11145
  var targetToLibMap = /* @__PURE__ */ new Map([
11146
11146
  [99 /* ESNext */, "lib.esnext.full.d.ts"],
11147
+ [11 /* ES2024 */, "lib.es2024.full.d.ts"],
11147
11148
  [10 /* ES2023 */, "lib.es2023.full.d.ts"],
11148
11149
  [9 /* ES2022 */, "lib.es2022.full.d.ts"],
11149
11150
  [8 /* ES2021 */, "lib.es2021.full.d.ts"],
@@ -11159,6 +11160,7 @@ function getDefaultLibFileName(options) {
11159
11160
  const target = getEmitScriptTarget(options);
11160
11161
  switch (target) {
11161
11162
  case 99 /* ESNext */:
11163
+ case 11 /* ES2024 */:
11162
11164
  case 10 /* ES2023 */:
11163
11165
  case 9 /* ES2022 */:
11164
11166
  case 8 /* ES2021 */:
@@ -36875,6 +36877,7 @@ var commandOptionsWithoutBuild = [
36875
36877
  bundler: 100 /* Bundler */
36876
36878
  })),
36877
36879
  deprecatedKeys: /* @__PURE__ */ new Set(["node"]),
36880
+ affectsSourceFile: true,
36878
36881
  affectsModuleResolution: true,
36879
36882
  paramType: Diagnostics.STRATEGY,
36880
36883
  category: Diagnostics.Modules,
@@ -42323,6 +42326,9 @@ function createBinder() {
42323
42326
  const saveInAssignmentPattern = inAssignmentPattern;
42324
42327
  inAssignmentPattern = false;
42325
42328
  if (checkUnreachable(node)) {
42329
+ if (canHaveFlowNode(node) && node.flowNode) {
42330
+ node.flowNode = void 0;
42331
+ }
42326
42332
  bindEachChild(node);
42327
42333
  bindJSDoc(node);
42328
42334
  inAssignmentPattern = saveInAssignmentPattern;
@@ -85143,7 +85149,7 @@ function createTypeChecker(host) {
85143
85149
  }
85144
85150
  }
85145
85151
  }
85146
- if (isOnlyImportableAsDefault(node.moduleSpecifier, resolvedModule) && !hasTypeJsonImportAttribute(node)) {
85152
+ if (moduleKind === 199 /* NodeNext */ && isOnlyImportableAsDefault(node.moduleSpecifier, resolvedModule) && !hasTypeJsonImportAttribute(node)) {
85147
85153
  error(node.moduleSpecifier, Diagnostics.Importing_a_JSON_file_into_an_ECMAScript_module_requires_a_type_Colon_json_import_attribute_when_module_is_set_to_0, ModuleKind[moduleKind]);
85148
85154
  }
85149
85155
  } else if (noUncheckedSideEffectImports && !importClause) {
@@ -120987,7 +120993,9 @@ function getConfigFileParsingDiagnostics(configFileParseResult) {
120987
120993
  return configFileParseResult.options.configFile ? [...configFileParseResult.options.configFile.parseDiagnostics, ...configFileParseResult.errors] : configFileParseResult.errors;
120988
120994
  }
120989
120995
  function getImpliedNodeFormatForFileWorker(fileName, packageJsonInfoCache, host, options) {
120990
- return fileExtensionIsOneOf(fileName, [".d.mts" /* Dmts */, ".mts" /* Mts */, ".mjs" /* Mjs */]) ? 99 /* ESNext */ : fileExtensionIsOneOf(fileName, [".d.cts" /* Dcts */, ".cts" /* Cts */, ".cjs" /* Cjs */]) ? 1 /* CommonJS */ : fileExtensionIsOneOf(fileName, [".d.ts" /* Dts */, ".ts" /* Ts */, ".tsx" /* Tsx */, ".js" /* Js */, ".jsx" /* Jsx */]) ? lookupFromPackageJson() : void 0;
120996
+ const moduleResolution = getEmitModuleResolutionKind(options);
120997
+ const shouldLookupFromPackageJson = 3 /* Node16 */ <= moduleResolution && moduleResolution <= 99 /* NodeNext */ || pathContainsNodeModules(fileName);
120998
+ return fileExtensionIsOneOf(fileName, [".d.mts" /* Dmts */, ".mts" /* Mts */, ".mjs" /* Mjs */]) ? 99 /* ESNext */ : fileExtensionIsOneOf(fileName, [".d.cts" /* Dcts */, ".cts" /* Cts */, ".cjs" /* Cjs */]) ? 1 /* CommonJS */ : shouldLookupFromPackageJson && fileExtensionIsOneOf(fileName, [".d.ts" /* Dts */, ".ts" /* Ts */, ".tsx" /* Tsx */, ".js" /* Js */, ".jsx" /* Jsx */]) ? lookupFromPackageJson() : void 0;
120991
120999
  function lookupFromPackageJson() {
120992
121000
  const state = getTemporaryModuleResolutionState(packageJsonInfoCache, host, options);
120993
121001
  const packageJsonLocations = [];
@@ -122904,14 +122912,16 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
122904
122912
  return file2 || void 0;
122905
122913
  }
122906
122914
  let redirectedPath;
122907
- const redirectProject = getProjectReferenceRedirectProject(fileName);
122908
- if (!useSourceOfProjectReferenceRedirect && redirectProject) {
122909
- if (redirectProject.commandLine.options.outFile) {
122910
- return void 0;
122915
+ if (!useSourceOfProjectReferenceRedirect) {
122916
+ const redirectProject = getProjectReferenceRedirectProject(fileName);
122917
+ if (redirectProject) {
122918
+ if (redirectProject.commandLine.options.outFile) {
122919
+ return void 0;
122920
+ }
122921
+ const redirect = getProjectReferenceOutputName(redirectProject, fileName);
122922
+ fileName = redirect;
122923
+ redirectedPath = toPath3(redirect);
122911
122924
  }
122912
- const redirect = getProjectReferenceOutputName(redirectProject, fileName);
122913
- fileName = redirect;
122914
- redirectedPath = toPath3(redirect);
122915
122925
  }
122916
122926
  const sourceFileOptions = getCreateSourceFileOptions(fileName, moduleResolutionCache, host, options);
122917
122927
  const file = host.getSourceFile(
@@ -124152,10 +124162,18 @@ function getEmitModuleFormatOfFileWorker(sourceFile, options) {
124152
124162
  return getImpliedNodeFormatForEmitWorker(sourceFile, options) ?? getEmitModuleKind(options);
124153
124163
  }
124154
124164
  function getImpliedNodeFormatForEmitWorker(sourceFile, options) {
124165
+ var _a, _b;
124155
124166
  const moduleKind = getEmitModuleKind(options);
124156
- if (100 /* Node16 */ <= moduleKind && moduleKind <= 199 /* NodeNext */ || fileExtensionIsOneOf(sourceFile.fileName, [".cts" /* Cts */, ".d.cts" /* Dcts */, ".cjs" /* Cjs */, ".mts" /* Mts */, ".d.mts" /* Dmts */, ".mjs" /* Mjs */]) || pathContainsNodeModules(sourceFile.fileName)) {
124167
+ if (100 /* Node16 */ <= moduleKind && moduleKind <= 199 /* NodeNext */) {
124157
124168
  return sourceFile.impliedNodeFormat;
124158
124169
  }
124170
+ if (sourceFile.impliedNodeFormat === 1 /* CommonJS */ && (((_a = sourceFile.packageJsonScope) == null ? void 0 : _a.contents.packageJsonContent.type) === "commonjs" || fileExtensionIsOneOf(sourceFile.fileName, [".cjs" /* Cjs */, ".cts" /* Cts */]))) {
124171
+ return 1 /* CommonJS */;
124172
+ }
124173
+ if (sourceFile.impliedNodeFormat === 99 /* ESNext */ && (((_b = sourceFile.packageJsonScope) == null ? void 0 : _b.contents.packageJsonContent.type) === "module" || fileExtensionIsOneOf(sourceFile.fileName, [".mjs" /* Mjs */, ".mts" /* Mts */]))) {
124174
+ return 99 /* ESNext */;
124175
+ }
124176
+ return void 0;
124159
124177
  }
124160
124178
  function getDefaultResolutionModeForFileWorker(sourceFile, options) {
124161
124179
  return importSyntaxAffectsModuleResolution(options) ? getImpliedNodeFormatForEmitWorker(sourceFile, options) : void 0;
@@ -132132,9 +132150,9 @@ function createSyntacticTypeNodeBuilder(options, resolver) {
132132
132150
  }
132133
132151
  if (!result && node.kind === 303 /* PropertyAssignment */) {
132134
132152
  const initializer = node.initializer;
132135
- const type = isJSDocTypeAssertion(initializer) ? getJSDocTypeAssertionType(initializer) : initializer.kind === 234 /* AsExpression */ || initializer.kind === 216 /* TypeAssertionExpression */ ? initializer.type : void 0;
132136
- if (type && !isConstTypeReference(type)) {
132137
- result = serializeExistingTypeNode(type, context);
132153
+ const assertionNode = isJSDocTypeAssertion(initializer) ? getJSDocTypeAssertionType(initializer) : initializer.kind === 234 /* AsExpression */ || initializer.kind === 216 /* TypeAssertionExpression */ ? initializer.type : void 0;
132154
+ if (assertionNode && !isConstTypeReference(assertionNode) && resolver.canReuseTypeNodeAnnotation(context, node, assertionNode, symbol)) {
132155
+ result = serializeExistingTypeNode(assertionNode, context);
132138
132156
  }
132139
132157
  }
132140
132158
  return result ?? inferTypeOfDeclaration(
@@ -5920,14 +5920,21 @@ declare namespace ts {
5920
5920
  hasNoDefaultLib: boolean;
5921
5921
  languageVersion: ScriptTarget;
5922
5922
  /**
5923
- * This field controls whether the source file in question is an ESNext-output-format file,
5924
- * or a CommonJS-output-format module. This is derived by the module resolver as it looks
5925
- * up the file, since it is derived from either the file extension of the module, or the
5926
- * containing `package.json` context, and may affect both checking and emit, depending on
5927
- * `module` and `moduleResolution` compiler options.
5923
+ * When `module` is `Node16` or `NodeNext`, this field controls whether the
5924
+ * source file in question is an ESNext-output-format file, or a CommonJS-output-format
5925
+ * module. This is derived by the module resolver as it looks up the file, since
5926
+ * it is derived from either the file extension of the module, or the containing
5927
+ * `package.json` context, and affects both checking and emit.
5928
5928
  *
5929
5929
  * It is _public_ so that (pre)transformers can set this field,
5930
- * since it switches the builtin `node` module transform.
5930
+ * since it switches the builtin `node` module transform. Generally speaking, if unset,
5931
+ * the field is treated as though it is `ModuleKind.CommonJS`.
5932
+ *
5933
+ * Note that this field is only set by the module resolution process when
5934
+ * `moduleResolution` is `Node16` or `NodeNext`, which is implied by the `module` setting
5935
+ * of `Node16` or `NodeNext`, respectively, but may be overriden (eg, by a `moduleResolution`
5936
+ * of `node`). If so, this field will be unset and source files will be considered to be
5937
+ * CommonJS-output-format by the node module transformer and type checker, regardless of extension or context.
5931
5938
  */
5932
5939
  impliedNodeFormat?: ResolutionMode;
5933
5940
  }
package/lib/typescript.js CHANGED
@@ -2278,7 +2278,7 @@ module.exports = __toCommonJS(typescript_exports);
2278
2278
 
2279
2279
  // src/compiler/corePublic.ts
2280
2280
  var versionMajorMinor = "5.8";
2281
- var version = `${versionMajorMinor}.0-insiders.20241203`;
2281
+ var version = `${versionMajorMinor}.0-insiders.20241204`;
2282
2282
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2283
2283
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2284
2284
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -14549,6 +14549,7 @@ function sortAndDeduplicateDiagnostics(diagnostics) {
14549
14549
  }
14550
14550
  var targetToLibMap = /* @__PURE__ */ new Map([
14551
14551
  [99 /* ESNext */, "lib.esnext.full.d.ts"],
14552
+ [11 /* ES2024 */, "lib.es2024.full.d.ts"],
14552
14553
  [10 /* ES2023 */, "lib.es2023.full.d.ts"],
14553
14554
  [9 /* ES2022 */, "lib.es2022.full.d.ts"],
14554
14555
  [8 /* ES2021 */, "lib.es2021.full.d.ts"],
@@ -14564,6 +14565,7 @@ function getDefaultLibFileName(options) {
14564
14565
  const target = getEmitScriptTarget(options);
14565
14566
  switch (target) {
14566
14567
  case 99 /* ESNext */:
14568
+ case 11 /* ES2024 */:
14567
14569
  case 10 /* ES2023 */:
14568
14570
  case 9 /* ES2022 */:
14569
14571
  case 8 /* ES2021 */:
@@ -41128,6 +41130,7 @@ var commandOptionsWithoutBuild = [
41128
41130
  bundler: 100 /* Bundler */
41129
41131
  })),
41130
41132
  deprecatedKeys: /* @__PURE__ */ new Set(["node"]),
41133
+ affectsSourceFile: true,
41131
41134
  affectsModuleResolution: true,
41132
41135
  paramType: Diagnostics.STRATEGY,
41133
41136
  category: Diagnostics.Modules,
@@ -46827,6 +46830,9 @@ function createBinder() {
46827
46830
  const saveInAssignmentPattern = inAssignmentPattern;
46828
46831
  inAssignmentPattern = false;
46829
46832
  if (checkUnreachable(node)) {
46833
+ if (canHaveFlowNode(node) && node.flowNode) {
46834
+ node.flowNode = void 0;
46835
+ }
46830
46836
  bindEachChild(node);
46831
46837
  bindJSDoc(node);
46832
46838
  inAssignmentPattern = saveInAssignmentPattern;
@@ -89747,7 +89753,7 @@ function createTypeChecker(host) {
89747
89753
  }
89748
89754
  }
89749
89755
  }
89750
- if (isOnlyImportableAsDefault(node.moduleSpecifier, resolvedModule) && !hasTypeJsonImportAttribute(node)) {
89756
+ if (moduleKind === 199 /* NodeNext */ && isOnlyImportableAsDefault(node.moduleSpecifier, resolvedModule) && !hasTypeJsonImportAttribute(node)) {
89751
89757
  error2(node.moduleSpecifier, Diagnostics.Importing_a_JSON_file_into_an_ECMAScript_module_requires_a_type_Colon_json_import_attribute_when_module_is_set_to_0, ModuleKind[moduleKind]);
89752
89758
  }
89753
89759
  } else if (noUncheckedSideEffectImports && !importClause) {
@@ -125830,7 +125836,9 @@ function getImpliedNodeFormatForFile(fileName, packageJsonInfoCache, host, optio
125830
125836
  return typeof result === "object" ? result.impliedNodeFormat : result;
125831
125837
  }
125832
125838
  function getImpliedNodeFormatForFileWorker(fileName, packageJsonInfoCache, host, options) {
125833
- return fileExtensionIsOneOf(fileName, [".d.mts" /* Dmts */, ".mts" /* Mts */, ".mjs" /* Mjs */]) ? 99 /* ESNext */ : fileExtensionIsOneOf(fileName, [".d.cts" /* Dcts */, ".cts" /* Cts */, ".cjs" /* Cjs */]) ? 1 /* CommonJS */ : fileExtensionIsOneOf(fileName, [".d.ts" /* Dts */, ".ts" /* Ts */, ".tsx" /* Tsx */, ".js" /* Js */, ".jsx" /* Jsx */]) ? lookupFromPackageJson() : void 0;
125839
+ const moduleResolution = getEmitModuleResolutionKind(options);
125840
+ const shouldLookupFromPackageJson = 3 /* Node16 */ <= moduleResolution && moduleResolution <= 99 /* NodeNext */ || pathContainsNodeModules(fileName);
125841
+ return fileExtensionIsOneOf(fileName, [".d.mts" /* Dmts */, ".mts" /* Mts */, ".mjs" /* Mjs */]) ? 99 /* ESNext */ : fileExtensionIsOneOf(fileName, [".d.cts" /* Dcts */, ".cts" /* Cts */, ".cjs" /* Cjs */]) ? 1 /* CommonJS */ : shouldLookupFromPackageJson && fileExtensionIsOneOf(fileName, [".d.ts" /* Dts */, ".ts" /* Ts */, ".tsx" /* Tsx */, ".js" /* Js */, ".jsx" /* Jsx */]) ? lookupFromPackageJson() : void 0;
125834
125842
  function lookupFromPackageJson() {
125835
125843
  const state = getTemporaryModuleResolutionState(packageJsonInfoCache, host, options);
125836
125844
  const packageJsonLocations = [];
@@ -127747,14 +127755,16 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
127747
127755
  return file2 || void 0;
127748
127756
  }
127749
127757
  let redirectedPath;
127750
- const redirectProject = getProjectReferenceRedirectProject(fileName);
127751
- if (!useSourceOfProjectReferenceRedirect && redirectProject) {
127752
- if (redirectProject.commandLine.options.outFile) {
127753
- return void 0;
127758
+ if (!useSourceOfProjectReferenceRedirect) {
127759
+ const redirectProject = getProjectReferenceRedirectProject(fileName);
127760
+ if (redirectProject) {
127761
+ if (redirectProject.commandLine.options.outFile) {
127762
+ return void 0;
127763
+ }
127764
+ const redirect = getProjectReferenceOutputName(redirectProject, fileName);
127765
+ fileName = redirect;
127766
+ redirectedPath = toPath3(redirect);
127754
127767
  }
127755
- const redirect = getProjectReferenceOutputName(redirectProject, fileName);
127756
- fileName = redirect;
127757
- redirectedPath = toPath3(redirect);
127758
127768
  }
127759
127769
  const sourceFileOptions = getCreateSourceFileOptions(fileName, moduleResolutionCache, host, options);
127760
127770
  const file = host.getSourceFile(
@@ -128995,10 +129005,18 @@ function getEmitModuleFormatOfFileWorker(sourceFile, options) {
128995
129005
  return getImpliedNodeFormatForEmitWorker(sourceFile, options) ?? getEmitModuleKind(options);
128996
129006
  }
128997
129007
  function getImpliedNodeFormatForEmitWorker(sourceFile, options) {
129008
+ var _a, _b;
128998
129009
  const moduleKind = getEmitModuleKind(options);
128999
- if (100 /* Node16 */ <= moduleKind && moduleKind <= 199 /* NodeNext */ || fileExtensionIsOneOf(sourceFile.fileName, [".cts" /* Cts */, ".d.cts" /* Dcts */, ".cjs" /* Cjs */, ".mts" /* Mts */, ".d.mts" /* Dmts */, ".mjs" /* Mjs */]) || pathContainsNodeModules(sourceFile.fileName)) {
129010
+ if (100 /* Node16 */ <= moduleKind && moduleKind <= 199 /* NodeNext */) {
129000
129011
  return sourceFile.impliedNodeFormat;
129001
129012
  }
129013
+ if (sourceFile.impliedNodeFormat === 1 /* CommonJS */ && (((_a = sourceFile.packageJsonScope) == null ? void 0 : _a.contents.packageJsonContent.type) === "commonjs" || fileExtensionIsOneOf(sourceFile.fileName, [".cjs" /* Cjs */, ".cts" /* Cts */]))) {
129014
+ return 1 /* CommonJS */;
129015
+ }
129016
+ if (sourceFile.impliedNodeFormat === 99 /* ESNext */ && (((_b = sourceFile.packageJsonScope) == null ? void 0 : _b.contents.packageJsonContent.type) === "module" || fileExtensionIsOneOf(sourceFile.fileName, [".mjs" /* Mjs */, ".mts" /* Mts */]))) {
129017
+ return 99 /* ESNext */;
129018
+ }
129019
+ return void 0;
129002
129020
  }
129003
129021
  function getDefaultResolutionModeForFileWorker(sourceFile, options) {
129004
129022
  return importSyntaxAffectsModuleResolution(options) ? getImpliedNodeFormatForEmitWorker(sourceFile, options) : void 0;
@@ -137093,9 +137111,9 @@ function createSyntacticTypeNodeBuilder(options, resolver) {
137093
137111
  }
137094
137112
  if (!result && node.kind === 303 /* PropertyAssignment */) {
137095
137113
  const initializer = node.initializer;
137096
- const type = isJSDocTypeAssertion(initializer) ? getJSDocTypeAssertionType(initializer) : initializer.kind === 234 /* AsExpression */ || initializer.kind === 216 /* TypeAssertionExpression */ ? initializer.type : void 0;
137097
- if (type && !isConstTypeReference(type)) {
137098
- result = serializeExistingTypeNode(type, context);
137114
+ const assertionNode = isJSDocTypeAssertion(initializer) ? getJSDocTypeAssertionType(initializer) : initializer.kind === 234 /* AsExpression */ || initializer.kind === 216 /* TypeAssertionExpression */ ? initializer.type : void 0;
137115
+ if (assertionNode && !isConstTypeReference(assertionNode) && resolver.canReuseTypeNodeAnnotation(context, node, assertionNode, symbol)) {
137116
+ result = serializeExistingTypeNode(assertionNode, context);
137099
137117
  }
137100
137118
  }
137101
137119
  return result ?? inferTypeOfDeclaration(
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.8.0-pr-60039-24",
5
+ "version": "5.8.0-pr-60576-12",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [