diff --git a/package-lock.json b/package-lock.json index 9efbe91..feef6f9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "serverless-plugin-thundra", - "version": "2.5.9", + "version": "2.6.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 5f57268..c30e4e6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "serverless-plugin-thundra", - "version": "2.5.9", + "version": "2.6.0", "description": "Thundra's serverless plugin for automatic wrapping", "repository": "thundra-io/serverless-plugin-thundra", "homepage": "https://thundra.io/apm", diff --git a/src/index.js b/src/index.js index 84340b1..3fc6951 100644 --- a/src/index.js +++ b/src/index.js @@ -366,7 +366,7 @@ class ServerlessThundraPlugin { thundraHandlerName, needHandlerDelegation, customRuntime, - } = layerInfo[lang]; + } = layerInfo[lang] let skipHandlerDelegation = false const delegatedHandler = func.environment[delegatedHandlerEnvVarName] @@ -414,11 +414,16 @@ class ServerlessThundraPlugin { if (!skipLayerAddition) { const userLayerVersion = getUserLayerVersion(func, service, lang) if (userLayerVersion) { - if (typeof userLayerVersion === 'string' - && userLayerVersion.toLowerCase() === 'latest') { + if ( + typeof userLayerVersion === 'string' && + userLayerVersion.toLowerCase() === 'latest' + ) { func.layers.push(this.latestLayerArnMap[func.runtime]) } else if (!this.isValidLayerVersion(userLayerVersion)) { - this.warnNoLayerInfoExistsForLangAndVersion(lang, userLayerVersion) + this.warnNoLayerInfoExistsForLangAndVersion( + lang, + userLayerVersion + ) } else { const layerRegion = service.provider.region const layerARN = getLayerARN( @@ -427,7 +432,7 @@ class ServerlessThundraPlugin { layerName, userLayerVersion ) - + func.layers.push(layerARN) } } else { @@ -445,7 +450,7 @@ class ServerlessThundraPlugin { this.warnHandlerDelegationSkipped(funcName) } } - + if (customRuntime) { func.runtime = 'provided' } @@ -597,7 +602,9 @@ class ServerlessThundraPlugin { } warnNoLayerInfoExistsForLangAndVersion(lang, version) { - this.log(`No layer information exist for given lang: ${lang} given version: ${version}`) + this.log( + `No layer information exist for given lang: ${lang} given version: ${version}` + ) } warnHandlerDelegationSkipped(funcName) { diff --git a/src/layers.js b/src/layers.js index 4acbb84..c9026b9 100644 --- a/src/layers.js +++ b/src/layers.js @@ -20,8 +20,7 @@ exports.layerInfo = { node: { layerName: 'thundra-lambda-node-layer', needHandlerDelegation: true, - thundraHandlerName: - 'thundra_handler.wrapper', + thundraHandlerName: 'thundra_handler.wrapper', }, layerAwsAccountNo: 269863060030, delegatedHandlerEnvVarName: 'THUNDRA_AGENT_LAMBDA_HANDLER',