From 4c93bc9bd4ac67f3c6a6a8c76cbab3a80ef46259 Mon Sep 17 00:00:00 2001 From: Rodrigo Espinosa Curbelo Date: Thu, 6 Feb 2020 08:54:37 -0300 Subject: [PATCH] add nodejs12.x as a possible runtime --- serverless.js | 6 +++--- serverless.types.js | 35 +++++++++++++---------------------- 2 files changed, 16 insertions(+), 25 deletions(-) diff --git a/serverless.js b/serverless.js index 6328384..b0e822b 100644 --- a/serverless.js +++ b/serverless.js @@ -65,9 +65,9 @@ class Backend extends Component { } // Check if the runtime is allowed - if (inputs.runtime && !['nodejs8.10', 'nodejs10.x'].includes(inputs.runtime)) { + if (inputs.runtime && !['nodejs8.10', 'nodejs10.x', 'nodejs12.x'].includes(inputs.runtime)) { throw new Error( - `The runtime can only be 'nodejs8.10' or 'nodejs10.x'. Runtime specified: ${inputs.runtime}` + `The runtime can only be 'nodejs8.10', 'nodejs10.x' or 'nodejs12.x'. Runtime specified: ${inputs.runtime}` ) } @@ -100,7 +100,7 @@ class Backend extends Component { description: inputs.description || 'A function for the Backend Component', memory: inputs.memory || 896, timeout: inputs.timeout || 10, - runtime: inputs.runtime || 'nodejs10.x', + runtime: inputs.runtime || 'nodejs12.x', code: inputs.code.src || inputs.code.root, role: roleOutputs, handler: 'shim.handler', diff --git a/serverless.types.js b/serverless.types.js index 3a96c6b..1f21693 100644 --- a/serverless.types.js +++ b/serverless.types.js @@ -8,12 +8,10 @@ module.exports = { name: 'code', type: 'code', required: true, - description: 'The directory which contains your backend code, declared by an index.js file', - defaultRuntime: 'nodejs10.x', - runtimes: [ - 'nodejs10.x', - 'nodejs8.10', - ] + description: + 'The directory which contains your backend code, declared by an index.js file', + defaultRuntime: 'nodejs12.x', + runtimes: ['nodejs12.x', 'nodejs10.x', 'nodejs8.10'] }, { name: 'region', @@ -43,7 +41,7 @@ module.exports = { 'eu-north-1', 'sa-east-1', 'us-gov-east-1', - 'us-gov-west-1', + 'us-gov-west-1' ] }, { @@ -56,25 +54,18 @@ module.exports = { name: 'memory', type: 'value', valueType: 'number', - description: 'The memory size of the AWS Lambda function running the back-end code. Increased memory size will result in faster performance, reduced cold-start times, but also higher cost', + description: + 'The memory size of the AWS Lambda function running the back-end code. Increased memory size will result in faster performance, reduced cold-start times, but also higher cost', required: true, default: 896, - options: [ - 128, - 384, - 512, - 896, - 1280, - 2048, - 2560, - 3008, - ] + options: [128, 384, 512, 896, 1280, 2048, 2560, 3008] }, { name: 'timeout', type: 'value', valueType: 'number', - description: 'The number of seconds which the AWS Lambda function running the back-end code can run for', + description: + 'The number of seconds which the AWS Lambda function running the back-end code can run for', required: true, default: 9, options: [ @@ -116,10 +107,10 @@ module.exports = { 8000, 10000, 12000, - 15000, + 15000 ] - }, - ], + } + ] }, remove: { description: 'Removes this instance of this component',