nitro-nightly 3.1.0-20251027-232908-e0bb18f2 → 3.1.0-20251028-000737-b443005f

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/dist/presets.mjs CHANGED
@@ -1954,20 +1954,30 @@ async function generateFunctionFiles(nitro) {
1954
1954
  const buildConfigPath = resolve$1(nitro.options.output.dir, "config.json");
1955
1955
  const buildConfig = generateBuildConfig(nitro, o11Routes);
1956
1956
  await writeFile(buildConfigPath, JSON.stringify(buildConfig, null, 2));
1957
- const systemNodeVersion = getSystemNodeVersion();
1958
- const usedNodeVersion = SUPPORTED_NODE_VERSIONS.find((version) => version >= systemNodeVersion) ?? SUPPORTED_NODE_VERSIONS.at(-1);
1959
- const runtimeVersion = `nodejs${usedNodeVersion}.x`;
1957
+ let runtime = nitro.options.vercel?.functions?.runtime;
1958
+ if (!runtime) {
1959
+ const vercelConfig = await readVercelConfig(nitro.options.rootDir);
1960
+ if (vercelConfig.bunVersion || "Bun" in globalThis) {
1961
+ runtime = `bun${vercelConfig.bunVersion || "1.x"}`;
1962
+ } else {
1963
+ const systemNodeVersion = getSystemNodeVersion();
1964
+ const usedNodeVersion = SUPPORTED_NODE_VERSIONS.find(
1965
+ (version) => version >= systemNodeVersion
1966
+ ) ?? SUPPORTED_NODE_VERSIONS.at(-1);
1967
+ runtime = `nodejs${usedNodeVersion}.x`;
1968
+ }
1969
+ }
1960
1970
  const functionConfigPath = resolve$1(
1961
1971
  nitro.options.output.serverDir,
1962
1972
  ".vc-config.json"
1963
1973
  );
1964
1974
  const functionConfig = {
1965
- runtime: runtimeVersion,
1975
+ runtime,
1976
+ ...nitro.options.vercel?.functions,
1966
1977
  handler: "index.mjs",
1967
1978
  launcherType: "Nodejs",
1968
1979
  shouldAddHelpers: false,
1969
- supportsResponseStreaming: true,
1970
- ...nitro.options.vercel?.functions
1980
+ supportsResponseStreaming: true
1971
1981
  };
1972
1982
  await writeFile(functionConfigPath, JSON.stringify(functionConfig, null, 2));
1973
1983
  for (const [key, value] of Object.entries(nitro.options.routeRules)) {
@@ -2131,6 +2141,11 @@ function deprecateSWR(nitro) {
2131
2141
  );
2132
2142
  }
2133
2143
  }
2144
+ async function readVercelConfig(rootDir) {
2145
+ const vercelConfigPath = resolve$1(rootDir, "vercel.json");
2146
+ const vercelConfig = await fsp.readFile(vercelConfigPath).then((config) => JSON.parse(config.toString())).catch(() => ({}));
2147
+ return vercelConfig;
2148
+ }
2134
2149
  function _hasProp(obj, prop) {
2135
2150
  return obj && typeof obj === "object" && prop in obj;
2136
2151
  }
@@ -2320,6 +2320,10 @@ interface VercelServerlessFunctionConfig {
2320
2320
  * Enables source map generation.
2321
2321
  */
2322
2322
  shouldAddSourcemapSupport?: boolean;
2323
+ /**
2324
+ * The runtime to use. Defaults to the auto-detected Node.js version.
2325
+ */
2326
+ runtime?: "nodejs20.x" | "nodejs22.x" | "bun1.x" | (string & {});
2323
2327
  [key: string]: unknown;
2324
2328
  }
2325
2329
  interface VercelOptions {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nitro-nightly",
3
- "version": "3.1.0-20251027-232908-e0bb18f2",
3
+ "version": "3.1.0-20251028-000737-b443005f",
4
4
  "description": "Build and Deploy Universal JavaScript Servers",
5
5
  "homepage": "https://nitro.build",
6
6
  "repository": "nitrojs/nitro",