@sveltejs/adapter-vercel 5.4.7 → 5.5.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.js +20 -6
- package/package.json +5 -5
package/index.js
CHANGED
|
@@ -11,13 +11,27 @@ const name = '@sveltejs/adapter-vercel';
|
|
|
11
11
|
const DEFAULT_FUNCTION_NAME = 'fn';
|
|
12
12
|
|
|
13
13
|
const get_default_runtime = () => {
|
|
14
|
-
const major = process.version.slice(1).split('.')[0];
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
const major = Number(process.version.slice(1).split('.')[0]);
|
|
15
|
+
|
|
16
|
+
// If we're building on Vercel, we know that the version will be fine because Vercel
|
|
17
|
+
// provides Node (and Vercel won't provide something it doesn't support).
|
|
18
|
+
// Also means we're not on the hook for updating the adapter every time a new Node
|
|
19
|
+
// version is added to Vercel.
|
|
20
|
+
if (!process.env.VERCEL) {
|
|
21
|
+
if (major < 18 || major > 22) {
|
|
22
|
+
throw new Error(
|
|
23
|
+
`Building locally with unsupported Node.js version: ${process.version}. Please use Node 18, 20 or 22 to build your project, or explicitly specify a runtime in your adapter configuration.`
|
|
24
|
+
);
|
|
25
|
+
}
|
|
17
26
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
27
|
+
if (major % 2 !== 0) {
|
|
28
|
+
throw new Error(
|
|
29
|
+
`Unsupported Node.js version: ${process.version}. Please use an even-numbered Node version to build your project, or explicitly specify a runtime in your adapter configuration.`
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return `nodejs${major}.x`;
|
|
21
35
|
};
|
|
22
36
|
|
|
23
37
|
// https://vercel.com/docs/functions/edge-functions/edge-runtime#compatible-node.js-modules
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sveltejs/adapter-vercel",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.5.0",
|
|
4
4
|
"description": "A SvelteKit adapter that creates a Vercel app",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"adapter",
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@vercel/nft": "^0.27.1",
|
|
37
|
-
"esbuild": "^0.
|
|
37
|
+
"esbuild": "^0.24.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@sveltejs/vite-plugin-svelte": "^
|
|
40
|
+
"@sveltejs/vite-plugin-svelte": "^5.0.1",
|
|
41
41
|
"@types/node": "^18.19.48",
|
|
42
42
|
"typescript": "^5.3.3",
|
|
43
|
-
"vitest": "^2.
|
|
44
|
-
"@sveltejs/kit": "^2.
|
|
43
|
+
"vitest": "^2.1.6",
|
|
44
|
+
"@sveltejs/kit": "^2.9.0"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"@sveltejs/kit": "^2.4.0"
|