@vercel/node 5.3.11 → 5.3.13

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.
Files changed (2) hide show
  1. package/dist/index.js +30 -11
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -69797,6 +69797,9 @@ function renameTStoJS(path) {
69797
69797
  if (path.endsWith(".tsx")) {
69798
69798
  return path.slice(0, -4) + ".js";
69799
69799
  }
69800
+ if (path.endsWith(".mts")) {
69801
+ return path.slice(0, -4) + ".mjs";
69802
+ }
69800
69803
  return path;
69801
69804
  }
69802
69805
  async function compile2(workPath, baseDir, entrypointPath, config, meta, nodeVersion, isEdgeFunction) {
@@ -69890,7 +69893,7 @@ async function compile2(workPath, baseDir, entrypointPath, config, meta, nodeVer
69890
69893
  }
69891
69894
  }
69892
69895
  }
69893
- 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")) {
69894
69897
  source = compileTypeScript(fsPath, source.toString());
69895
69898
  }
69896
69899
  if (!entry) {
@@ -69943,7 +69946,7 @@ async function compile2(workPath, baseDir, entrypointPath, config, meta, nodeVer
69943
69946
  }
69944
69947
  }
69945
69948
  const esmPaths = [...esmFileList].filter(
69946
- (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)
69947
69950
  );
69948
69951
  const babelCompileEnabled = !isEdgeFunction || process.env.VERCEL_EDGE_NO_BABEL !== "1";
69949
69952
  if (babelCompileEnabled && esmPaths.length) {
@@ -70009,7 +70012,8 @@ var build = async ({
70009
70012
  workPath,
70010
70013
  repoRootPath,
70011
70014
  config = {},
70012
- meta = {}
70015
+ meta = {},
70016
+ considerBuildCommand = false
70013
70017
  }) => {
70014
70018
  const baseDir = repoRootPath || workPath;
70015
70019
  const awsLambdaHandler = getAWSLambdaHandler(entrypoint, config);
@@ -70020,13 +70024,27 @@ var build = async ({
70020
70024
  config,
70021
70025
  meta
70022
70026
  });
70023
- await (0, import_build_utils3.runPackageJsonScript)(
70024
- entrypointFsDirname,
70025
- // Don't consider "build" script since its intended for frontend code
70026
- ["vercel-build", "now-build"],
70027
- spawnOpts,
70028
- config.projectSettings?.createdAt
70029
- );
70027
+ const projectBuildCommand = config.projectSettings?.buildCommand;
70028
+ if (projectBuildCommand && considerBuildCommand) {
70029
+ await (0, import_build_utils3.execCommand)(projectBuildCommand, {
70030
+ ...spawnOpts,
70031
+ // Yarn v2 PnP mode may be activated, so force
70032
+ // "node-modules" linker style
70033
+ env: {
70034
+ YARN_NODE_LINKER: "node-modules",
70035
+ ...spawnOpts.env
70036
+ },
70037
+ cwd: workPath
70038
+ });
70039
+ } else {
70040
+ const possibleScripts = considerBuildCommand ? ["vercel-build", "now-build", "build"] : ["vercel-build", "now-build"];
70041
+ await (0, import_build_utils3.runPackageJsonScript)(
70042
+ entrypointFsDirname,
70043
+ possibleScripts,
70044
+ spawnOpts,
70045
+ config.projectSettings?.createdAt
70046
+ );
70047
+ }
70030
70048
  const isMiddleware = config.middleware === true;
70031
70049
  let isEdgeFunction = isMiddleware;
70032
70050
  const project = new import_ts_morph.Project();
@@ -70365,7 +70383,8 @@ async function doTypeCheck({ entrypoint, workPath, meta = {} }, projectTsConfig)
70365
70383
  tsconfigPath,
70366
70384
  "--noEmit",
70367
70385
  "--allowJs",
70368
- "--esModuleInterop"
70386
+ "--esModuleInterop",
70387
+ "--skipLibCheck"
70369
70388
  ],
70370
70389
  {
70371
70390
  cwd: workPath,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/node",
3
- "version": "5.3.11",
3
+ "version": "5.3.13",
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.12"
61
61
  },
62
62
  "scripts": {
63
63
  "build": "node build.mjs",