Skip to content

Commit b81c4a0

Browse files
Merge pull request #4 from jaystack/update-node-version
Set default node version to 'nodejs10.x'
2 parents 5e80eb5 + 219aeb2 commit b81c4a0

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ Define a base class for FunctionalService to set basic Lambda settings in the AW
151151
```js
152152
import { FunctionalService, aws } from 'functionly'
153153

154-
@aws({ type: 'nodejs8.10', memorySize: 512, timeout: 3 })
154+
@aws({ type: 'nodejs10.x', memorySize: 512, timeout: 3 })
155155
export class TodoService extends FunctionalService { }
156156
```
157157

src/annotations/classes/aws/aws.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { CLASS_AWSMEMORYSIZEKEY, CLASS_AWSTIMEOUTKEY, CLASS_AWSRUNTIMEKEY } from
22
import { defineMetadata } from '../../metadata'
33

44
export const aws = (config: {
5-
type?: 'nodejs6.10'|'nodejs8.10',
5+
type?: 'nodejs8.10'|'nodejs10.x',
66
memorySize?: number,
77
timeout?: number
88
}) => (target: Function) => {

src/cli/commands/serverless.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export default (api) => {
9393

9494
const def = serverless.functions[functionName] = {
9595
handler: `${nameKey}.${serviceDefinition.exportName}`,
96-
runtime: getMetadata(CLASS_AWSRUNTIMEKEY, serviceDefinition.service) || "nodejs8.10"
96+
runtime: getMetadata(CLASS_AWSRUNTIMEKEY, serviceDefinition.service) || "nodejs10.x"
9797
}
9898

9999
await executor({ context, name: 'funtionEnvironments', method: funtionEnvironments })

src/cli/providers/cloudFormation/context/resources.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ export const lambdaResource = async (context) => {
284284
Handler: serviceDefinition.handler,
285285
MemorySize: serviceDefinition[CLASS_AWSMEMORYSIZEKEY] || getMetadata(CLASS_AWSMEMORYSIZEKEY, serviceDefinition.service),
286286
Role: serviceDefinition[CLASS_ROLEKEY] || getMetadata(CLASS_ROLEKEY, serviceDefinition.service),
287-
Runtime: serviceDefinition[CLASS_AWSRUNTIMEKEY] || getMetadata(CLASS_AWSRUNTIMEKEY, serviceDefinition.service) || "nodejs8.10",
287+
Runtime: serviceDefinition[CLASS_AWSRUNTIMEKEY] || getMetadata(CLASS_AWSRUNTIMEKEY, serviceDefinition.service) || "nodejs10.x",
288288
Timeout: serviceDefinition[CLASS_AWSTIMEOUTKEY] || getMetadata(CLASS_AWSTIMEOUTKEY, serviceDefinition.service),
289289
Environment: {
290290
Variables: serviceDefinition[CLASS_ENVIRONMENTKEY] || getMetadata(CLASS_ENVIRONMENTKEY, serviceDefinition.service)

src/cli/utilities/aws/lambda.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const createLambdaFunction = ExecuteStep.register('CreateLambdaFunction',
3434
MemorySize: getMetadata(constants.CLASS_AWSMEMORYSIZEKEY, context.serviceDefinition.service),
3535
Publish: true,
3636
Role: getMetadata(constants.CLASS_ROLEKEY, context.serviceDefinition.service),
37-
Runtime: getMetadata(constants.CLASS_AWSRUNTIMEKEY, context.serviceDefinition.service) || "nodejs8.10",
37+
Runtime: getMetadata(constants.CLASS_AWSRUNTIMEKEY, context.serviceDefinition.service) || "nodejs10.x",
3838
Timeout: getMetadata(constants.CLASS_AWSTIMEOUTKEY, context.serviceDefinition.service),
3939
Environment: {
4040
Variables: getMetadata(constants.CLASS_ENVIRONMENTKEY, context.serviceDefinition.service)
@@ -118,7 +118,7 @@ export const updateLambdaFunctionConfiguration = ExecuteStep.register('UpdateLam
118118
Handler: context.serviceDefinition.handler,
119119
MemorySize: getMetadata(constants.CLASS_AWSMEMORYSIZEKEY, context.serviceDefinition.service),
120120
Role: getMetadata(constants.CLASS_ROLEKEY, context.serviceDefinition.service),
121-
Runtime: getMetadata(constants.CLASS_AWSRUNTIMEKEY, context.serviceDefinition.service) || "nodejs8.10",
121+
Runtime: getMetadata(constants.CLASS_AWSRUNTIMEKEY, context.serviceDefinition.service) || "nodejs10.x",
122122
Timeout: getMetadata(constants.CLASS_AWSTIMEOUTKEY, context.serviceDefinition.service),
123123
VpcConfig: {
124124
}

test/annotation.tests.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,14 +1269,14 @@ describe('annotations', () => {
12691269
})
12701270
describe("aws", () => {
12711271
it("type", () => {
1272-
@aws({ type: 'nodejs8.10' })
1272+
@aws({ type: 'nodejs10.x' })
12731273
class RuntimeTestClass { }
12741274

12751275
const runtimeValue = getMetadata(CLASS_AWSRUNTIMEKEY, RuntimeTestClass)
12761276
const memoryValue = getMetadata(CLASS_AWSMEMORYSIZEKEY, RuntimeTestClass)
12771277
const timeoutValue = getMetadata(CLASS_AWSTIMEOUTKEY, RuntimeTestClass)
12781278

1279-
expect(runtimeValue).to.equal('nodejs8.10')
1279+
expect(runtimeValue).to.equal('nodejs10.x')
12801280
expect(memoryValue).to.undefined
12811281
expect(timeoutValue).to.undefined
12821282
})
@@ -1305,14 +1305,14 @@ describe('annotations', () => {
13051305
expect(timeoutValue).to.equal(3)
13061306
})
13071307
it("all", () => {
1308-
@aws({ type: 'nodejs8.10', memorySize: 100, timeout: 3 })
1308+
@aws({ type: 'nodejs10.x', memorySize: 100, timeout: 3 })
13091309
class RuntimeTestClass { }
13101310

13111311
const runtimeValue = getMetadata(CLASS_AWSRUNTIMEKEY, RuntimeTestClass)
13121312
const memoryValue = getMetadata(CLASS_AWSMEMORYSIZEKEY, RuntimeTestClass)
13131313
const timeoutValue = getMetadata(CLASS_AWSTIMEOUTKEY, RuntimeTestClass)
13141314

1315-
expect(runtimeValue).to.equal('nodejs8.10')
1315+
expect(runtimeValue).to.equal('nodejs10.x')
13161316
expect(memoryValue).to.equal(100)
13171317
expect(timeoutValue).to.equal(3)
13181318
})

0 commit comments

Comments
 (0)