@vercel/node 5.3.10 → 5.3.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.
@@ -1116,7 +1116,7 @@ async function compileUserCode2(entrypointPath, awaiter, options) {
1116
1116
  if (listener.default)
1117
1117
  listener = listener.default;
1118
1118
  }
1119
- const shouldUseWebHandlers = options.isMiddleware || HTTP_METHODS.some((method) => typeof listener[method] === "function");
1119
+ const shouldUseWebHandlers = options.isMiddleware || HTTP_METHODS.some((method) => typeof listener[method] === "function") || typeof listener.fetch === "function";
1120
1120
  if (shouldUseWebHandlers) {
1121
1121
  const { createWebExportsHandler: createWebExportsHandler2 } = await Promise.resolve().then(() => (init_helpers_web(), helpers_web_exports));
1122
1122
  const getWebExportsHandler = createWebExportsHandler2(awaiter);
@@ -1130,6 +1130,15 @@ async function compileUserCode2(entrypointPath, awaiter, options) {
1130
1130
  {}
1131
1131
  );
1132
1132
  }
1133
+ if (typeof listener.fetch === "function") {
1134
+ handler = HTTP_METHODS.reduce(
1135
+ (acc, method) => {
1136
+ acc[method] = listener.fetch;
1137
+ return acc;
1138
+ },
1139
+ {}
1140
+ );
1141
+ }
1133
1142
  return getWebExportsHandler(handler, HTTP_METHODS);
1134
1143
  }
1135
1144
  return async (req, res) => {
package/dist/index.js CHANGED
@@ -69526,7 +69526,11 @@ function register(opts = {}) {
69526
69526
  const output = service.getEmitOutput(fileName);
69527
69527
  const diagnostics = service.getSemanticDiagnostics(fileName).concat(service.getSyntacticDiagnostics(fileName));
69528
69528
  const diagnosticList = filterDiagnostics(diagnostics, ignoreDiagnostics);
69529
- reportTSError(diagnosticList, config.options.noEmitOnError);
69529
+ if (process.env.EXPERIMENTAL_NODE_TYPESCRIPT_ERRORS) {
69530
+ reportTSError(diagnosticList, true);
69531
+ } else {
69532
+ reportTSError(diagnosticList, config.options.noEmitOnError);
69533
+ }
69530
69534
  if (output.emitSkipped) {
69531
69535
  throw new TypeError(`${(0, import_path.relative)(cwd, fileName)}: Emit skipped`);
69532
69536
  }
@@ -69793,6 +69797,9 @@ function renameTStoJS(path) {
69793
69797
  if (path.endsWith(".tsx")) {
69794
69798
  return path.slice(0, -4) + ".js";
69795
69799
  }
69800
+ if (path.endsWith(".mts")) {
69801
+ return path.slice(0, -4) + ".mjs";
69802
+ }
69796
69803
  return path;
69797
69804
  }
69798
69805
  async function compile2(workPath, baseDir, entrypointPath, config, meta, nodeVersion, isEdgeFunction) {
@@ -69886,7 +69893,7 @@ async function compile2(workPath, baseDir, entrypointPath, config, meta, nodeVer
69886
69893
  }
69887
69894
  }
69888
69895
  }
69889
- if (fsPath.endsWith(".ts") && !fsPath.endsWith(".d.ts") || fsPath.endsWith(".tsx")) {
69896
+ if (fsPath.endsWith(".ts") && !fsPath.endsWith(".d.ts") || fsPath.endsWith(".tsx") || fsPath.endsWith(".mts")) {
69890
69897
  source = compileTypeScript(fsPath, source.toString());
69891
69898
  }
69892
69899
  if (!entry) {
@@ -69939,7 +69946,7 @@ async function compile2(workPath, baseDir, entrypointPath, config, meta, nodeVer
69939
69946
  }
69940
69947
  }
69941
69948
  const esmPaths = [...esmFileList].filter(
69942
- (file) => !file.endsWith(".ts") && !file.endsWith(".tsx") && !file.endsWith(".mjs") && !file.match(libPathRegEx)
69949
+ (file) => !file.endsWith(".ts") && !file.endsWith(".tsx") && !file.endsWith(".mts") && !file.endsWith(".mjs") && !file.match(libPathRegEx)
69943
69950
  );
69944
69951
  const babelCompileEnabled = !isEdgeFunction || process.env.VERCEL_EDGE_NO_BABEL !== "1";
69945
69952
  if (babelCompileEnabled && esmPaths.length) {
@@ -70005,7 +70012,8 @@ var build = async ({
70005
70012
  workPath,
70006
70013
  repoRootPath,
70007
70014
  config = {},
70008
- meta = {}
70015
+ meta = {},
70016
+ considerBuildCommand = false
70009
70017
  }) => {
70010
70018
  const baseDir = repoRootPath || workPath;
70011
70019
  const awsLambdaHandler = getAWSLambdaHandler(entrypoint, config);
@@ -70016,10 +70024,10 @@ var build = async ({
70016
70024
  config,
70017
70025
  meta
70018
70026
  });
70027
+ const possibleScripts = considerBuildCommand ? ["vercel-build", "now-build", "build"] : ["vercel-build", "now-build"];
70019
70028
  await (0, import_build_utils3.runPackageJsonScript)(
70020
70029
  entrypointFsDirname,
70021
- // Don't consider "build" script since its intended for frontend code
70022
- ["vercel-build", "now-build"],
70030
+ possibleScripts,
70023
70031
  spawnOpts,
70024
70032
  config.projectSettings?.createdAt
70025
70033
  );
@@ -70361,7 +70369,8 @@ async function doTypeCheck({ entrypoint, workPath, meta = {} }, projectTsConfig)
70361
70369
  tsconfigPath,
70362
70370
  "--noEmit",
70363
70371
  "--allowJs",
70364
- "--esModuleInterop"
70372
+ "--esModuleInterop",
70373
+ "--skipLibCheck"
70365
70374
  ],
70366
70375
  {
70367
70376
  cwd: workPath,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/node",
3
- "version": "5.3.10",
3
+ "version": "5.3.12",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index",
6
6
  "homepage": "https://vercel.com/docs/runtimes#official-runtimes/node-js",
@@ -17,7 +17,7 @@
17
17
  "@edge-runtime/primitives": "4.1.0",
18
18
  "@edge-runtime/vm": "3.2.0",
19
19
  "@types/node": "16.18.11",
20
- "@vercel/build-utils": "11.0.0",
20
+ "@vercel/build-utils": "11.0.1",
21
21
  "@vercel/error-utils": "2.0.3",
22
22
  "@vercel/nft": "0.29.2",
23
23
  "@vercel/static-config": "3.1.1",
@@ -57,7 +57,7 @@
57
57
  "tree-kill": "1.2.2",
58
58
  "vite": "^5.1.6",
59
59
  "vitest": "^2.0.1",
60
- "@vercel/functions": "2.2.7"
60
+ "@vercel/functions": "2.2.11"
61
61
  },
62
62
  "scripts": {
63
63
  "build": "node build.mjs",