@vercel/node 5.3.8 → 5.3.10

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 +18 -4
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -67324,7 +67324,7 @@ var require_import_meta_resolve = __commonJS({
67324
67324
  } = /^([^/]+\/[^;,]+)[^,]*?(;base64)?,/.exec(parsed.pathname) || [null, null, null];
67325
67325
  return mimeToFormat(mime);
67326
67326
  }
67327
- function extname3(url2) {
67327
+ function extname4(url2) {
67328
67328
  const pathname = url2.pathname;
67329
67329
  let index = pathname.length;
67330
67330
  while (index--) {
@@ -67339,7 +67339,7 @@ var require_import_meta_resolve = __commonJS({
67339
67339
  return "";
67340
67340
  }
67341
67341
  function getFileProtocolModuleFormat(url2, _context, ignoreErrors) {
67342
- const ext = extname3(url2);
67342
+ const ext = extname4(url2);
67343
67343
  if (ext === ".js") {
67344
67344
  const packageType = getPackageType(url2);
67345
67345
  if (packageType !== "none") {
@@ -70069,10 +70069,24 @@ var build = async ({
70069
70069
  ];
70070
70070
  }
70071
70071
  if (shim) {
70072
+ const handlerFilename = (0, import_path3.basename)(handler);
70072
70073
  const handlerDir = (0, import_path3.dirname)(handler);
70073
- const shimHandler = handlerDir === "." ? "shim.js" : (0, import_path3.join)(handlerDir, "shim.js");
70074
+ const extension = (0, import_path3.extname)(handlerFilename);
70075
+ const extMap = {
70076
+ ".ts": ".js",
70077
+ ".mts": ".mjs",
70078
+ ".mjs": ".mjs",
70079
+ ".cjs": ".cjs",
70080
+ ".js": ".js"
70081
+ };
70082
+ const ext = extMap[extension];
70083
+ if (!ext) {
70084
+ throw new Error(`Unsupported extension for ${entrypoint}`);
70085
+ }
70086
+ const filename = `shim${ext}`;
70087
+ const shimHandler = handlerDir === "." ? filename : (0, import_path3.join)(handlerDir, filename);
70074
70088
  preparedFiles[shimHandler] = new import_build_utils3.FileBlob({
70075
- data: shim(handler)
70089
+ data: shim(handlerFilename)
70076
70090
  });
70077
70091
  handler = shimHandler;
70078
70092
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/node",
3
- "version": "5.3.8",
3
+ "version": "5.3.10",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index",
6
6
  "homepage": "https://vercel.com/docs/runtimes#official-runtimes/node-js",
@@ -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.6"
60
+ "@vercel/functions": "2.2.7"
61
61
  },
62
62
  "scripts": {
63
63
  "build": "node build.mjs",