@sveltejs/adapter-vercel 6.1.2 → 6.2.0

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/index.d.ts CHANGED
@@ -6,7 +6,7 @@ export default function plugin(config?: Config): Adapter;
6
6
 
7
7
  export interface ServerlessConfig {
8
8
  /**
9
- * Whether to use [Edge Functions](https://vercel.com/docs/concepts/functions/edge-functions) (`'edge'`) or [Serverless Functions](https://vercel.com/docs/concepts/functions/serverless-functions) (`'nodejs18.x'`, `'nodejs20.x'` etc).
9
+ * Whether to use [Edge Functions](https://vercel.com/docs/concepts/functions/edge-functions) (`'edge'`) or [Serverless Functions](https://vercel.com/docs/concepts/functions/serverless-functions) (`'nodejs22.x'`, `'nodejs24.x'` etc).
10
10
  * @default Same as the build environment
11
11
  */
12
12
  runtime?: Exclude<RuntimeConfigKey, 'edge'>;
@@ -78,7 +78,7 @@ type ImagesConfig = {
78
78
  /** @deprecated */
79
79
  export interface EdgeConfig {
80
80
  /**
81
- * Whether to use [Edge Functions](https://vercel.com/docs/concepts/functions/edge-functions) (`'edge'`) or [Serverless Functions](https://vercel.com/docs/concepts/functions/serverless-functions) (`'nodejs18.x'`, `'nodejs20.x'` etc).
81
+ * Whether to use [Edge Functions](https://vercel.com/docs/concepts/functions/edge-functions) (`'edge'`) or [Serverless Functions](https://vercel.com/docs/concepts/functions/serverless-functions) (`'nodejs22.x'`, `'nodejs24.x'` etc).
82
82
  */
83
83
  runtime?: 'edge';
84
84
  /**
package/index.js CHANGED
@@ -285,7 +285,7 @@ const plugin = function (defaults = {}) {
285
285
 
286
286
  if (runtime === 'edge') {
287
287
  throw new Error(
288
- `${directory}: Routes using \`isr\` must use a Node.js or Bun runtime (for example 'nodejs22.x' or 'experimental_bun1.x')`
288
+ `${directory}: Routes using \`isr\` must use a Node.js or Bun runtime (for example 'nodejs24.x' or 'experimental_bun1.x')`
289
289
  );
290
290
  }
291
291
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sveltejs/adapter-vercel",
3
- "version": "6.1.2",
3
+ "version": "6.2.0",
4
4
  "description": "A SvelteKit adapter that creates a Vercel app",
5
5
  "keywords": [
6
6
  "adapter",
@@ -42,7 +42,7 @@
42
42
  "@types/node": "^18.19.119",
43
43
  "typescript": "^5.3.3",
44
44
  "vitest": "^3.2.4",
45
- "@sveltejs/kit": "^2.48.7"
45
+ "@sveltejs/kit": "^2.49.0"
46
46
  },
47
47
  "peerDependencies": {
48
48
  "@sveltejs/kit": "^2.4.0"
package/utils.js CHANGED
@@ -120,6 +120,8 @@ export function resolve_runtime(default_key, override_key) {
120
120
  return key;
121
121
  }
122
122
 
123
+ const valid_node_versions = [20, 22, 24];
124
+
123
125
  /** @returns {RuntimeKey} */
124
126
  function get_default_runtime() {
125
127
  // TODO may someday need to auto-detect Bun, but this will be complicated because you may want to run your build
@@ -127,16 +129,22 @@ function get_default_runtime() {
127
129
  // to tell us what the bun configuration is.
128
130
  const major = Number(process.version.slice(1).split('.')[0]);
129
131
 
130
- if (major !== 20 && major !== 22) {
132
+ if (!valid_node_versions.includes(major)) {
131
133
  throw new Error(
132
- `Unsupported Node.js version: ${process.version}. Please use Node 20 or 22 to build your project, or explicitly specify a runtime in your adapter configuration.`
134
+ `Unsupported Node.js version: ${process.version}. Please use Node ${valid_node_versions.slice(0, -1).join(', ')} or ${valid_node_versions.at(-1)} to build your project, or explicitly specify a runtime in your adapter configuration.`
133
135
  );
134
136
  }
135
137
 
136
- return `nodejs${major}.x`;
138
+ return `nodejs${/** @type {20 | 22 | 24} */ (major)}.x`;
137
139
  }
138
140
 
139
- const valid_runtimes = /** @type {const} */ (['nodejs20.x', 'nodejs22.x', 'bun1.x', 'edge']);
141
+ const valid_runtimes = /** @type {const} */ ([
142
+ 'nodejs20.x',
143
+ 'nodejs22.x',
144
+ 'nodejs24.x',
145
+ 'bun1.x',
146
+ 'edge'
147
+ ]);
140
148
 
141
149
  /**
142
150
  * @param {string} key