@vercel/node 24.0.2 → 24.0.3

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 +33 -2
  2. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -71870,6 +71870,7 @@ __export(src_exports, {
71870
71870
  _resetBundlingRoutesEmitted: () => _resetBundlingRoutesEmitted,
71871
71871
  build: () => build,
71872
71872
  diagnostics: () => diagnostics,
71873
+ getDevWarnings: () => getDevWarnings,
71873
71874
  prepareCache: () => prepareCache,
71874
71875
  shouldServe: () => import_build_utils10.shouldServe,
71875
71876
  startDevServer: () => startDevServer,
@@ -72486,7 +72487,7 @@ function validateMiddlewareRuntime(runtime, entrypoint, requiredRuntime) {
72486
72487
  }
72487
72488
  var MIDDLEWARE_NODEJS_DEFAULT_ENV = "VERCEL_MIDDLEWARE_DEFAULT_RUNTIME_NODEJS";
72488
72489
  var MIDDLEWARE_NODEJS_DEFAULT_SINCE = /* @__PURE__ */ new Date("2026-09-01T00:00:00Z");
72489
- var edgeMiddlewareDeprecationWarning = (entrypoint) => `Warning: ${entrypoint} uses the deprecated "edge" runtime. Migrate to the Node.js runtime for better performance and reliability by exporting \`const config = { runtime: 'nodejs' }\`. Learn more: https://vercel.com/docs/routing-middleware#runtime-options`;
72490
+ var edgeMiddlewareDeprecationWarning = (entrypoint) => `${entrypoint} uses the deprecated "edge" runtime. Migrate to the Node.js runtime for better performance and reliability by exporting \`const config = { runtime: 'nodejs' }\`. Learn more: https://vercel.com/docs/routing-middleware#runtime-options`;
72490
72491
  function resolveMiddlewareRuntime({
72491
72492
  configuredRuntime,
72492
72493
  middlewareRuntime,
@@ -72902,7 +72903,9 @@ var build = async ({
72902
72903
  `Middleware runtime for "${entrypoint}": ${middleware.runtime} (${middleware.reason})`
72903
72904
  );
72904
72905
  if (isEdgeFunction) {
72905
- console.warn(edgeMiddlewareDeprecationWarning(entrypoint));
72906
+ console.warn(
72907
+ `\x1B[33m\x1B[1mWARNING! \x1B[22m${edgeMiddlewareDeprecationWarning(entrypoint)}\x1B[39m`
72908
+ );
72906
72909
  }
72907
72910
  } else if (runtime) {
72908
72911
  isEdgeFunction = isEdgeRuntime(runtime);
@@ -73419,6 +73422,33 @@ var startDevServer = async (opts) => {
73419
73422
  }
73420
73423
  };
73421
73424
 
73425
+ // src/get-dev-warnings.ts
73426
+ var import_static_config3 = require("@vercel/static-config");
73427
+ var import_path6 = require("path");
73428
+ var getDevWarnings = async ({
73429
+ entrypoint,
73430
+ workPath,
73431
+ config,
73432
+ meta = {}
73433
+ }) => {
73434
+ if (config.middleware !== true)
73435
+ return [];
73436
+ const staticConfig = (0, import_static_config3.getConfig)(null, (0, import_path6.join)(workPath, entrypoint));
73437
+ validateMiddlewareRuntime(
73438
+ staticConfig?.runtime,
73439
+ entrypoint,
73440
+ config.middlewareRuntime
73441
+ );
73442
+ const { runtime } = resolveMiddlewareRuntime({
73443
+ configuredRuntime: staticConfig?.runtime,
73444
+ middlewareRuntime: config.middlewareRuntime,
73445
+ projectCreatedAt: config.projectSettings?.createdAt,
73446
+ isDev: true,
73447
+ env: { ...process.env, ...meta.env, ...meta.buildEnv }
73448
+ });
73449
+ return runtime === "edge" ? [edgeMiddlewareDeprecationWarning(entrypoint)] : [];
73450
+ };
73451
+
73422
73452
  // src/index.ts
73423
73453
  var import_build_utils10 = require("@vercel/build-utils");
73424
73454
  var version = 3;
@@ -73427,6 +73457,7 @@ var version = 3;
73427
73457
  _resetBundlingRoutesEmitted,
73428
73458
  build,
73429
73459
  diagnostics,
73460
+ getDevWarnings,
73430
73461
  prepareCache,
73431
73462
  shouldServe,
73432
73463
  startDevServer,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/node",
3
- "version": "24.0.2",
3
+ "version": "24.0.3",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index",
6
6
  "homepage": "https://vercel.com/docs/runtimes#official-runtimes/node-js",
@@ -32,11 +32,11 @@
32
32
  "tsx": "4.21.0",
33
33
  "typescript": "npm:typescript@5.9.3",
34
34
  "undici": "5.28.4",
35
- "@vercel/static-config": "3.4.4",
36
- "@vercel/error-utils": "2.2.1"
35
+ "@vercel/error-utils": "2.2.1",
36
+ "@vercel/static-config": "3.4.4"
37
37
  },
38
38
  "peerDependencies": {
39
- "@vercel/build-utils": "14.21.2"
39
+ "@vercel/build-utils": "14.21.3"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@babel/core": "7.24.4",
@@ -59,8 +59,8 @@
59
59
  "tree-kill": "1.2.2",
60
60
  "vite": "^6.4.3",
61
61
  "vitest": "^4.1.10",
62
- "@vercel/build-utils": "14.21.2",
63
- "@vercel/functions": "3.10.1"
62
+ "@vercel/functions": "3.10.1",
63
+ "@vercel/build-utils": "14.21.3"
64
64
  },
65
65
  "scripts": {
66
66
  "build": "node build.mjs",