diff --git a/README.md b/README.md index 5ccc206c..4b76f0cd 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ Second file `vercel.json` is pure gold here. Setup your project with configurati { "functions": { "api/*.php": { - "runtime": "vercel-php@0.6.1" + "runtime": "vercel-php@0.6.2" } } } @@ -90,7 +90,7 @@ Are you ready to deploy your first PHP project to Vercel? Click & Go! ## 💯 Versions -- `vercel-php@0.6.1` - Node 18.x / PHP 8.2.x (https://example-php-8-2.vercel.app) +- `vercel-php@0.6.2` - Node 18.x / PHP 8.2.x (https://example-php-8-2.vercel.app) - `vercel-php@0.5.4` - Node 18.x / PHP 8.1.x (https://example-php-8-1.vercel.app) - `vercel-php@0.4.3` - Node 18.x / PHP 8.0.x (https://example-php-8-0.vercel.app) - `vercel-php@0.3.5` - Node 18.x / PHP 7.4.x (https://example-php-7-4.vercel.app) @@ -106,7 +106,7 @@ If you need to route everything to index, use `routes` property. { "functions": { "api/*.php": { - "runtime": "vercel-php@0.6.1" + "runtime": "vercel-php@0.6.2" } }, "routes": [ @@ -181,19 +181,19 @@ project { "functions": { "api/*.php": { - "runtime": "vercel-php@0.6.1" + "runtime": "vercel-php@0.6.2" }, // Can be list also directly "api/index.php": { - "runtime": "vercel-php@0.6.1" + "runtime": "vercel-php@0.6.2" }, "api/users.php": { - "runtime": "vercel-php@0.6.1" + "runtime": "vercel-php@0.6.2" }, "api/books.php": { - "runtime": "vercel-php@0.6.1" + "runtime": "vercel-php@0.6.2" } } } @@ -208,7 +208,7 @@ project { "functions": { "api/index.php": { - "runtime": "vercel-php@0.6.1" + "runtime": "vercel-php@0.6.2" } }, "routes": [ @@ -228,7 +228,7 @@ Additional function properties are `memory`, `maxDuration`. Learn more about [fu { "functions": { "api/*.php": { - "runtime": "vercel-php@0.6.1", + "runtime": "vercel-php@0.6.2", "memory": 3008, "maxDuration": 60 } @@ -255,7 +255,7 @@ project { "functions": { "api/*.php": { - "runtime": "vercel-php@0.6.1" + "runtime": "vercel-php@0.6.2" } } } @@ -294,7 +294,7 @@ project { "functions": { "api/*.php": { - "runtime": "vercel-php@0.6.1" + "runtime": "vercel-php@0.6.2" } } } @@ -319,7 +319,7 @@ Runtimes support excluding some files or folders, [take a look at doc](https://v { "functions": { "api/**/*.php": { - "runtime": "vercel-php@0.6.1", + "runtime": "vercel-php@0.6.2", "excludeFiles": "{foo/**,bar/config/*.yaml}", } } diff --git a/package-lock.json b/package-lock.json index 145d573f..9e255f35 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "vercel-php", - "version": "0.6.1", + "version": "0.6.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "vercel-php", - "version": "0.6.1", + "version": "0.6.2", "license": "MIT", "dependencies": { "@libphp/amazon-linux-2-v82": "latest" diff --git a/package.json b/package.json index 6502b4b7..9b6ca49c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "vercel-php", "description": "Vercel PHP runtime", - "version": "0.6.1", + "version": "0.6.2", "license": "MIT", "main": "./dist/index.js", "homepage": "https://github.com/juicyfx/vercel-php", diff --git a/src/index.ts b/src/index.ts index bdbde502..652a16ec 100644 --- a/src/index.ts +++ b/src/index.ts @@ -6,7 +6,8 @@ import { download, Lambda, BuildV3, - PrepareCache + PrepareCache, + getNodeVersion } from '@vercel/build-utils'; import { getPhpFiles, @@ -113,6 +114,7 @@ export const build: BuildV3 = async ({ } console.log('🐘 Creating lambda'); + const nodeVersion = await getNodeVersion(workPath); const lambda = new Lambda({ files: { @@ -123,7 +125,7 @@ export const build: BuildV3 = async ({ ...runtimeFiles }, handler: 'launcher.launcher', - runtime: 'nodejs18.x', + runtime: nodeVersion.runtime, environment: { NOW_ENTRYPOINT: entrypoint, NOW_PHP_DEV: meta.isDev ? '1' : '0'