From 85921737033772eda7c123ecbf28dda1faf3dd77 Mon Sep 17 00:00:00 2001 From: Rich Buggy Date: Wed, 25 Dec 2024 21:05:07 +1100 Subject: [PATCH] fix: runtimes should be nodejs instead of nodejx --- .../__snapshots__/entryFor.test.ts.snap | 50 +++---- .../__snapshots__/integration.test.ts.snap | 18 +-- src/__tests__/entryFor.test.ts | 127 +++++++++--------- src/__tests__/integration.test.ts | 2 +- src/index.ts | 4 +- 5 files changed, 101 insertions(+), 100 deletions(-) diff --git a/src/__tests__/__snapshots__/entryFor.test.ts.snap b/src/__tests__/__snapshots__/entryFor.test.ts.snap index de704b2..d9fdaa2 100644 --- a/src/__tests__/__snapshots__/entryFor.test.ts.snap +++ b/src/__tests__/__snapshots__/entryFor.test.ts.snap @@ -39,7 +39,7 @@ exports[`Function CodeUri can be set at the function 1`] = ` "Properties": { "CodeUri": "MyLambda", "Handler": "app.handler", - "Runtime": "nodejx18.x", + "Runtime": "nodejs22.x", }, "Type": "AWS::Serverless::Function", }, @@ -96,7 +96,7 @@ exports[`Function CodeUri can be set global or at the function 1`] = ` "Properties": { "CodeUri": "MyLambda", "Handler": "app.handler", - "Runtime": "nodejx18.x", + "Runtime": "nodejs22.x", }, "Type": "AWS::Serverless::Function", }, @@ -153,7 +153,7 @@ exports[`Function CodeUri can be set globally 1`] = ` "Properties": { "CodeUri": "MyLambda", "Handler": "app.handler", - "Runtime": "nodejx18.x", + "Runtime": "nodejs22.x", }, "Type": "AWS::Serverless::Function", }, @@ -205,7 +205,7 @@ exports[`Function Handler can be set at the function 1`] = ` "Properties": { "CodeUri": "MyLambda", "Handler": "app.handler", - "Runtime": "nodejx18.x", + "Runtime": "nodejs22.x", }, "Type": "AWS::Serverless::Function", }, @@ -262,7 +262,7 @@ exports[`Function Handler can be set global and at function 1`] = ` "Properties": { "CodeUri": "MyLambda", "Handler": "app.handler", - "Runtime": "nodejx18.x", + "Runtime": "nodejs22.x", }, "Type": "AWS::Serverless::Function", }, @@ -319,7 +319,7 @@ exports[`Function Handler can be set globally 1`] = ` "Properties": { "CodeUri": "MyLambda", "Handler": "app.handler", - "Runtime": "nodejx18.x", + "Runtime": "nodejs22.x", }, "Type": "AWS::Serverless::Function", }, @@ -332,7 +332,7 @@ exports[`Function Handler can be set globally 1`] = ` } `; -exports[`Function Runtime can be set at the function to nodejx18.x 1`] = ` +exports[`Function Runtime can be set at the function to nodejs18.x 1`] = ` { "entryPoints": { "MyLambda": "./src/my-lambda/app", @@ -371,7 +371,7 @@ exports[`Function Runtime can be set at the function to nodejx18.x 1`] = ` "Properties": { "CodeUri": "MyLambda", "Handler": "app.handler", - "Runtime": "nodejx18.x", + "Runtime": "nodejs18.x", }, "Type": "AWS::Serverless::Function", }, @@ -384,7 +384,7 @@ exports[`Function Runtime can be set at the function to nodejx18.x 1`] = ` } `; -exports[`Function Runtime can be set at the function to nodejx18.x 2`] = ` +exports[`Function Runtime can be set at the function to nodejs20.x 1`] = ` { "entryPoints": { "MyLambda": "./src/my-lambda/app", @@ -423,7 +423,7 @@ exports[`Function Runtime can be set at the function to nodejx18.x 2`] = ` "Properties": { "CodeUri": "MyLambda", "Handler": "app.handler", - "Runtime": "nodejx18.x", + "Runtime": "nodejs20.x", }, "Type": "AWS::Serverless::Function", }, @@ -436,7 +436,7 @@ exports[`Function Runtime can be set at the function to nodejx18.x 2`] = ` } `; -exports[`Function Runtime can be set at the function to nodejx20.x 1`] = ` +exports[`Function Runtime can be set at the function to nodejs22.x 1`] = ` { "entryPoints": { "MyLambda": "./src/my-lambda/app", @@ -475,7 +475,7 @@ exports[`Function Runtime can be set at the function to nodejx20.x 1`] = ` "Properties": { "CodeUri": "MyLambda", "Handler": "app.handler", - "Runtime": "nodejx20.x", + "Runtime": "nodejs22.x", }, "Type": "AWS::Serverless::Function", }, @@ -524,7 +524,7 @@ exports[`Function Runtime can be set global and at function 1`] = ` "AWSTemplateFormatVersion": "2010-09-09", "Globals": { "Function": { - "Runtime": "nodejx20.x", + "Runtime": "nodejs20.x", }, }, "Resources": { @@ -532,7 +532,7 @@ exports[`Function Runtime can be set global and at function 1`] = ` "Properties": { "CodeUri": "MyLambda", "Handler": "app.handler", - "Runtime": "nodejx18.x", + "Runtime": "nodejs22.x", }, "Type": "AWS::Serverless::Function", }, @@ -545,7 +545,7 @@ exports[`Function Runtime can be set global and at function 1`] = ` } `; -exports[`Function Runtime can be set globally to nodejx18.x 1`] = ` +exports[`Function Runtime can be set globally to nodejs18.x 1`] = ` { "entryPoints": { "MyLambda": "./src/my-lambda/app", @@ -581,7 +581,7 @@ exports[`Function Runtime can be set globally to nodejx18.x 1`] = ` "AWSTemplateFormatVersion": "2010-09-09", "Globals": { "Function": { - "Runtime": "nodejx18.x", + "Runtime": "nodejs18.x", }, }, "Resources": { @@ -601,7 +601,7 @@ exports[`Function Runtime can be set globally to nodejx18.x 1`] = ` } `; -exports[`Function Runtime can be set globally to nodejx18.x 2`] = ` +exports[`Function Runtime can be set globally to nodejs20.x 1`] = ` { "entryPoints": { "MyLambda": "./src/my-lambda/app", @@ -637,7 +637,7 @@ exports[`Function Runtime can be set globally to nodejx18.x 2`] = ` "AWSTemplateFormatVersion": "2010-09-09", "Globals": { "Function": { - "Runtime": "nodejx18.x", + "Runtime": "nodejs20.x", }, }, "Resources": { @@ -657,7 +657,7 @@ exports[`Function Runtime can be set globally to nodejx18.x 2`] = ` } `; -exports[`Function Runtime can be set globally to nodejx20.x 1`] = ` +exports[`Function Runtime can be set globally to nodejs22.x 1`] = ` { "entryPoints": { "MyLambda": "./src/my-lambda/app", @@ -693,7 +693,7 @@ exports[`Function Runtime can be set globally to nodejx20.x 1`] = ` "AWSTemplateFormatVersion": "2010-09-09", "Globals": { "Function": { - "Runtime": "nodejx20.x", + "Runtime": "nodejs22.x", }, }, "Resources": { @@ -755,7 +755,7 @@ exports[`It ignores non AWS::Serverless::Function resosurces 1`] = ` "Properties": { "CodeUri": "MyLambda", "Handler": "app.handler", - "Runtime": "nodejx18.x", + "Runtime": "nodejs22.x", }, "Type": "AWS::Serverless::Function", }, @@ -804,7 +804,7 @@ exports[`JS output files uses outFile parameter 1`] = ` "AWSTemplateFormatVersion": "2010-09-09", "Globals": { "Function": { - "Runtime": "nodejx18.x", + "Runtime": "nodejs22.x", }, }, "Resources": { @@ -860,7 +860,7 @@ exports[`When the template is in a subfolder it should match the happy snapshot "AWSTemplateFormatVersion": "2010-09-09", "Globals": { "Function": { - "Runtime": "nodejx18.x", + "Runtime": "nodejs22.x", }, }, "Resources": { @@ -916,7 +916,7 @@ exports[`can be set global and at function 1`] = ` "AWSTemplateFormatVersion": "2010-09-09", "Globals": { "Function": { - "Runtime": "nodejx20.x", + "Runtime": "nodejs20.x", }, }, "Resources": { @@ -924,7 +924,7 @@ exports[`can be set global and at function 1`] = ` "Properties": { "CodeUri": "MyLambda", "Handler": "app.handler", - "Runtime": "nodejx18.x", + "Runtime": "nodejs22.x", }, "Type": "AWS::Serverless::Function", }, diff --git a/src/__tests__/__snapshots__/integration.test.ts.snap b/src/__tests__/__snapshots__/integration.test.ts.snap index 5aba314..85dff11 100644 --- a/src/__tests__/__snapshots__/integration.test.ts.snap +++ b/src/__tests__/__snapshots__/integration.test.ts.snap @@ -10,7 +10,7 @@ exports[`Happy path with VS Code debugging disabled 1`] = ` Transform: AWS::Serverless-2016-10-31 Globals: Function: - Runtime: nodejx18.x + Runtime: nodejs22.x Resources: MyLambda: Type: AWS::Serverless::Function @@ -32,7 +32,7 @@ exports[`Happy path with an output file specified 1`] = ` Transform: AWS::Serverless-2016-10-31 Globals: Function: - Runtime: nodejx18.x + Runtime: nodejs22.x Resources: MyLambda: Type: AWS::Serverless::Function @@ -78,7 +78,7 @@ exports[`Happy path with default constructor works 1`] = ` Transform: AWS::Serverless-2016-10-31 Globals: Function: - Runtime: nodejx18.x + Runtime: nodejs22.x Resources: MyLambda: Type: AWS::Serverless::Function @@ -124,7 +124,7 @@ exports[`Happy path with empty options in the constructor works 1`] = ` Transform: AWS::Serverless-2016-10-31 Globals: Function: - Runtime: nodejx18.x + Runtime: nodejs22.x Resources: MyLambda: Type: AWS::Serverless::Function @@ -170,7 +170,7 @@ exports[`Happy path with empty options in the constructor works and an existing Transform: AWS::Serverless-2016-10-31 Globals: Function: - Runtime: nodejx18.x + Runtime: nodejs22.x Resources: MyLambda: Type: AWS::Serverless::Function @@ -260,7 +260,7 @@ exports[`Happy path with multiple projects and different template names works 1` Transform: AWS::Serverless-2016-10-31 Globals: Function: - Runtime: nodejx18.x + Runtime: nodejs22.x Resources: MyLambda: Type: AWS::Serverless::Function @@ -272,7 +272,7 @@ Resources: Transform: AWS::Serverless-2016-10-31 Globals: Function: - Runtime: nodejx18.x + Runtime: nodejs22.x Resources: MyLambda: Type: AWS::Serverless::Function @@ -338,7 +338,7 @@ exports[`Happy path with multiple projects works 1`] = ` Transform: AWS::Serverless-2016-10-31 Globals: Function: - Runtime: nodejx18.x + Runtime: nodejs22.x Resources: MyLambda: Type: AWS::Serverless::Function @@ -350,7 +350,7 @@ Resources: Transform: AWS::Serverless-2016-10-31 Globals: Function: - Runtime: nodejx18.x + Runtime: nodejs22.x Resources: MyLambda: Type: AWS::Serverless::Function diff --git a/src/__tests__/entryFor.test.ts b/src/__tests__/entryFor.test.ts index 5cbc3e8..8c09368 100644 --- a/src/__tests__/entryFor.test.ts +++ b/src/__tests__/entryFor.test.ts @@ -1,7 +1,7 @@ import SamPlugin from "../index"; describe("Function Runtime", () => { - test("can be set globally to nodejx18.x", () => { + test("can be set globally to nodejs18.x", () => { const plugin = new SamPlugin(); const template = ` AWSTemplateFormatVersion: "2010-09-09" @@ -9,7 +9,7 @@ Transform: AWS::Serverless-2016-10-31 Globals: Function: - Runtime: nodejx18.x + Runtime: nodejs18.x Resources: MyLambda: @@ -22,7 +22,7 @@ Resources: expect(entries).toMatchSnapshot(); }); - test("can be set globally to nodejx20.x", () => { + test("can be set globally to nodejs20.x", () => { const plugin = new SamPlugin(); const template = ` AWSTemplateFormatVersion: "2010-09-09" @@ -30,7 +30,7 @@ Transform: AWS::Serverless-2016-10-31 Globals: Function: - Runtime: nodejx20.x + Runtime: nodejs20.x Resources: MyLambda: @@ -43,7 +43,7 @@ Resources: expect(entries).toMatchSnapshot(); }); - test("can be set globally to nodejx18.x", () => { + test("can be set globally to nodejs22.x", () => { const plugin = new SamPlugin(); const template = ` AWSTemplateFormatVersion: "2010-09-09" @@ -51,7 +51,7 @@ Transform: AWS::Serverless-2016-10-31 Globals: Function: - Runtime: nodejx18.x + Runtime: nodejs22.x Resources: MyLambda: @@ -64,7 +64,8 @@ Resources: expect(entries).toMatchSnapshot(); }); - test("can be set at the function to nodejx18.x", () => { + + test("can be set at the function to nodejs18.x", () => { const plugin = new SamPlugin(); const template = ` AWSTemplateFormatVersion: "2010-09-09" @@ -76,13 +77,13 @@ Resources: Properties: CodeUri: src/my-lambda Handler: app.handler - Runtime: nodejx18.x + Runtime: nodejs18.x `; const entries = plugin.entryFor("default", "", "template.yaml", template, "app"); expect(entries).toMatchSnapshot(); }); - test("can be set at the function to nodejx20.x", () => { + test("can be set at the function to nodejs20.x", () => { const plugin = new SamPlugin(); const template = ` AWSTemplateFormatVersion: "2010-09-09" @@ -94,13 +95,13 @@ Resources: Properties: CodeUri: src/my-lambda Handler: app.handler - Runtime: nodejx20.x + Runtime: nodejs20.x `; const entries = plugin.entryFor("default", "", "template.yaml", template, "app"); expect(entries).toMatchSnapshot(); }); - test("can be set at the function to nodejx18.x", () => { + test("can be set at the function to nodejs22.x", () => { const plugin = new SamPlugin(); const template = ` AWSTemplateFormatVersion: "2010-09-09" @@ -112,7 +113,7 @@ Resources: Properties: CodeUri: src/my-lambda Handler: app.handler - Runtime: nodejx18.x + Runtime: nodejs22.x `; const entries = plugin.entryFor("default", "", "template.yaml", template, "app"); expect(entries).toMatchSnapshot(); @@ -132,7 +133,7 @@ Resources: Handler: app.handler `; expect(() => plugin.entryFor("default", "", "template.yaml", template, "app")).toThrowError( - "MyLambda has an unsupport Runtime. Must be nodejx18.x, nodejx20.x or nodejx18.x" + "MyLambda has an unsupport Runtime. Must be nodejs18.x, nodejs20.x or nodejs22.x" ); }); @@ -154,7 +155,7 @@ Resources: Handler: app.handler `; expect(() => plugin.entryFor("default", "", "template.yaml", template, "app")).toThrowError( - "MyLambda has an unsupport Runtime. Must be nodejx18.x, nodejx20.x or nodejx18.x" + "MyLambda has an unsupport Runtime. Must be nodejs18.x, nodejs20.x or nodejs22.x" ); }); @@ -173,7 +174,7 @@ Resources: Runtime: nodejs12.x `; expect(() => plugin.entryFor("default", "", "template.yaml", template, "app")).toThrowError( - "MyLambda has an unsupport Runtime. Must be nodejx18.x, nodejx20.x or nodejx18.x" + "MyLambda has an unsupport Runtime. Must be nodejs18.x, nodejs20.x or nodejs22.x" ); }); @@ -185,7 +186,7 @@ Transform: AWS::Serverless-2016-10-31 Globals: Function: - Runtime: nodejx20.x + Runtime: nodejs20.x Resources: MyLambda: @@ -193,7 +194,7 @@ Resources: Properties: CodeUri: src/my-lambda Handler: app.handler - Runtime: nodejx18.x + Runtime: nodejs22.x `; const entries = plugin.entryFor("default", "", "template.yaml", template, "app"); expect(entries).toMatchSnapshot(); @@ -208,7 +209,7 @@ Transform: AWS::Serverless-2016-10-31 Globals: Function: - Runtime: nodejx20.x + Runtime: nodejs20.x Resources: MyLambda: @@ -216,7 +217,7 @@ Resources: Properties: CodeUri: src/my-lambda Handler: app.handler - Runtime: nodejx18.x + Runtime: nodejs22.x `; const entries = plugin.entryFor("default", "", "template.yaml", template, "app"); expect(entries).toMatchSnapshot(); @@ -238,7 +239,7 @@ Resources: Type: AWS::Serverless::Function Properties: CodeUri: src/my-lambda - Runtime: nodejx18.x + Runtime: nodejs22.x `; const entries = plugin.entryFor("default", "", "template.yaml", template, "app"); expect(entries).toMatchSnapshot(); @@ -256,7 +257,7 @@ Resources: Properties: CodeUri: src/my-lambda Handler: app.handler - Runtime: nodejx18.x + Runtime: nodejs22.x `; const entries = plugin.entryFor("default", "", "template.yaml", template, "app"); expect(entries).toMatchSnapshot(); @@ -278,7 +279,7 @@ Resources: Properties: CodeUri: src/my-lambda Handler: app.handler - Runtime: nodejx18.x + Runtime: nodejs22.x `; const entries = plugin.entryFor("default", "", "template.yaml", template, "app"); expect(entries).toMatchSnapshot(); @@ -295,7 +296,7 @@ Resources: Type: AWS::Serverless::Function Properties: CodeUri: src/my-lambda - Runtime: nodejx18.x + Runtime: nodejs22.x `; expect(() => plugin.entryFor("default", "", "template.yaml", template, "app")).toThrowError( "MyLambda is missing a Handler" @@ -319,7 +320,7 @@ Resources: Type: AWS::Serverless::Function Properties: Handler: app.handler - Runtime: nodejx18.x + Runtime: nodejs22.x `; const entries = plugin.entryFor("default", "", "template.yaml", template, "app"); expect(entries).toMatchSnapshot(); @@ -337,7 +338,7 @@ Resources: Properties: CodeUri: src/my-lambda Handler: app.handler - Runtime: nodejx18.x + Runtime: nodejs22.x `; const entries = plugin.entryFor("default", "", "template.yaml", template, "app"); expect(entries).toMatchSnapshot(); @@ -359,7 +360,7 @@ Resources: Properties: CodeUri: src/my-lambda Handler: app.handler - Runtime: nodejx18.x + Runtime: nodejs22.x `; const entries = plugin.entryFor("default", "", "template.yaml", template, "app"); expect(entries).toMatchSnapshot(); @@ -376,7 +377,7 @@ Resources: Type: AWS::Serverless::Function Properties: Handler: app.handler - Runtime: nodejx18.x + Runtime: nodejs22.x `; expect(() => plugin.entryFor("default", "", "template.yaml", template, "app")).toThrowError( "MyLambda is missing a CodeUri" @@ -410,7 +411,7 @@ Resources: Type: AWS::Serverless::Function Properties: Handler: apphandler - Runtime: nodejx18.x + Runtime: nodejs22.x `; expect(() => plugin.entryFor("default", "", "template.yaml", template, "app")).toThrowError( 'MyLambda Handler must contain exactly one "."' @@ -429,7 +430,7 @@ Resources: Properties: InlineCode: src/my-lambda Handler: app.handler - Runtime: nodejx18.x + Runtime: nodejs22.x `; const originalLog = console.log; console.log = jest.fn(); @@ -450,7 +451,7 @@ describe("Launch config name", () => { Globals: Function: - Runtime: nodejx18.x + Runtime: nodejs22.x Resources: MyLambda: @@ -472,7 +473,7 @@ describe("Launch config name", () => { Globals: Function: - Runtime: nodejx18.x + Runtime: nodejs22.x Resources: MyLambda: @@ -496,7 +497,7 @@ describe("SAM config entryPointName:", () => { Globals: Function: - Runtime: nodejx18.x + Runtime: nodejs22.x Resources: MyLambda: @@ -518,7 +519,7 @@ describe("SAM config entryPointName:", () => { Globals: Function: - Runtime: nodejx18.x + Runtime: nodejs22.x Resources: MyLambda: @@ -542,7 +543,7 @@ describe("When the template is in a subfolder", () => { Globals: Function: - Runtime: nodejx18.x + Runtime: nodejs22.x Resources: MyLambda: @@ -564,7 +565,7 @@ describe("When the template is in a subfolder", () => { Globals: Function: - Runtime: nodejx18.x + Runtime: nodejs22.x Resources: MyLambda: @@ -585,7 +586,7 @@ describe("When the template is in a subfolder", () => { Globals: Function: - Runtime: nodejx18.x + Runtime: nodejs22.x Resources: MyLambda: @@ -606,7 +607,7 @@ describe("When the template is in a subfolder", () => { Globals: Function: - Runtime: nodejx18.x + Runtime: nodejs22.x Resources: MyLambda: @@ -627,7 +628,7 @@ describe("When the template is in a subfolder", () => { Globals: Function: - Runtime: nodejx18.x + Runtime: nodejs22.x Resources: MyLambda: @@ -653,7 +654,7 @@ Resources: Properties: CodeUri: src/my-lambda Handler: app.handler - Runtime: nodejx18.x + Runtime: nodejs22.x FakeResource: Type: AWS::FakeResource::NahNah @@ -670,7 +671,7 @@ Transform: AWS::Serverless-2016-10-31 Globals: Function: - Runtime: nodejx18.x + Runtime: nodejs22.x Resources: MyLambda: @@ -696,7 +697,7 @@ describe("Property paths are rewritten correctly", () => { Properties: CodeUri: src/my-lambda Handler: app.handler - Runtime: nodejx18.x + Runtime: nodejs22.x MyResource: Type: AWS::ApiGateway::RestApi @@ -721,7 +722,7 @@ describe("Property paths are rewritten correctly", () => { Properties: CodeUri: src/my-lambda Handler: app.handler - Runtime: nodejx18.x + Runtime: nodejs22.x MyResource: Type: AWS::Lambda::Function @@ -744,7 +745,7 @@ describe("Property paths are rewritten correctly", () => { Properties: CodeUri: src/my-lambda Handler: app.handler - Runtime: nodejx18.x + Runtime: nodejs22.x MyResource: Type: AWS::AppSync::GraphQLSchema @@ -769,7 +770,7 @@ describe("Property paths are rewritten correctly", () => { Properties: CodeUri: src/my-lambda Handler: app.handler - Runtime: nodejx18.x + Runtime: nodejs22.x MyResource: Type: AWS::AppSync::Resolver @@ -794,7 +795,7 @@ describe("Property paths are rewritten correctly", () => { Properties: CodeUri: src/my-lambda Handler: app.handler - Runtime: nodejx18.x + Runtime: nodejs22.x MyResource: Type: AWS::AppSync::Resolver @@ -819,7 +820,7 @@ describe("Property paths are rewritten correctly", () => { Properties: CodeUri: src/my-lambda Handler: app.handler - Runtime: nodejx18.x + Runtime: nodejs22.x MyResource: Type: AWS::Serverless::Api @@ -844,7 +845,7 @@ describe("Property paths are rewritten correctly", () => { Properties: CodeUri: src/my-lambda Handler: app.handler - Runtime: nodejx18.x + Runtime: nodejs22.x MyResource: Type: AWS::Include @@ -867,7 +868,7 @@ describe("Property paths are rewritten correctly", () => { Properties: CodeUri: src/my-lambda Handler: app.handler - Runtime: nodejx18.x + Runtime: nodejs22.x MyResource: Type: AWS::ElasticBeanstalk::ApplicationVersion @@ -892,7 +893,7 @@ describe("Property paths are rewritten correctly", () => { Properties: CodeUri: src/my-lambda Handler: app.handler - Runtime: nodejx18.x + Runtime: nodejs22.x MyResource: Type: AWS::CloudFormation::Stack @@ -917,7 +918,7 @@ describe("Property paths are rewritten correctly", () => { Properties: CodeUri: src/my-lambda Handler: app.handler - Runtime: nodejx18.x + Runtime: nodejs22.x MyResource: Type: AWS::Glue::Job @@ -943,7 +944,7 @@ Resources: Properties: CodeUri: src/my-lambda Handler: app.handler - Runtime: nodejx18.x + Runtime: nodejs22.x MyResource: Type: AWS::StepFunctions::StateMachine @@ -970,7 +971,7 @@ describe("Property paths are not re-written when they are objects", () => { Properties: CodeUri: src/my-lambda Handler: app.handler - Runtime: nodejx18.x + Runtime: nodejs22.x MyResource: Type: AWS::ApiGateway::RestApi @@ -996,7 +997,7 @@ describe("Property paths are not re-written when they are objects", () => { Properties: CodeUri: src/my-lambda Handler: app.handler - Runtime: nodejx18.x + Runtime: nodejs22.x MyResource: Type: AWS::Lambda::Function @@ -1022,7 +1023,7 @@ describe("Property paths are not re-written when they are objects", () => { Properties: CodeUri: src/my-lambda Handler: app.handler - Runtime: nodejx18.x + Runtime: nodejs22.x MyResource: Type: AWS::AppSync::GraphQLSchema @@ -1047,7 +1048,7 @@ describe("Property paths are not re-written when they are objects", () => { Properties: CodeUri: src/my-lambda Handler: app.handler - Runtime: nodejx18.x + Runtime: nodejs22.x MyResource: Type: AWS::AppSync::Resolver @@ -1072,7 +1073,7 @@ describe("Property paths are not re-written when they are objects", () => { Properties: CodeUri: src/my-lambda Handler: app.handler - Runtime: nodejx18.x + Runtime: nodejs22.x MyResource: Type: AWS::AppSync::Resolver @@ -1098,7 +1099,7 @@ describe("Property paths are not re-written when they are objects", () => { Properties: CodeUri: src/my-lambda Handler: app.handler - Runtime: nodejx18.x + Runtime: nodejs22.x MyResource: Type: AWS::Serverless::Api @@ -1123,7 +1124,7 @@ describe("Property paths are not re-written when they are objects", () => { Properties: CodeUri: src/my-lambda Handler: app.handler - Runtime: nodejx18.x + Runtime: nodejs22.x MyResource: Type: AWS::Include @@ -1146,7 +1147,7 @@ describe("Property paths are not re-written when they are objects", () => { Properties: CodeUri: src/my-lambda Handler: app.handler - Runtime: nodejx18.x + Runtime: nodejs22.x MyResource: Type: AWS::ElasticBeanstalk::ApplicationVersion @@ -1172,7 +1173,7 @@ describe("Property paths are not re-written when they are objects", () => { Properties: CodeUri: src/my-lambda Handler: app.handler - Runtime: nodejx18.x + Runtime: nodejs22.x MyResource: Type: AWS::CloudFormation::Stack @@ -1197,7 +1198,7 @@ describe("Property paths are not re-written when they are objects", () => { Properties: CodeUri: src/my-lambda Handler: app.handler - Runtime: nodejx18.x + Runtime: nodejs22.x MyResource: Type: AWS::Glue::Job @@ -1223,7 +1224,7 @@ Resources: Properties: CodeUri: src/my-lambda Handler: app.handler - Runtime: nodejx18.x + Runtime: nodejs22.x MyResource: Type: AWS::StepFunctions::StateMachine @@ -1250,7 +1251,7 @@ Resources: Properties: CodeUri: src/my-lambda Handler: app.handler - Runtime: nodejx18.x + Runtime: nodejs22.x `; const entries = plugin.entryFor("default", "", "template.yaml", template, "app"); }); diff --git a/src/__tests__/integration.test.ts b/src/__tests__/integration.test.ts index d518fea..222fa67 100644 --- a/src/__tests__/integration.test.ts +++ b/src/__tests__/integration.test.ts @@ -11,7 +11,7 @@ Transform: AWS::Serverless-2016-10-31 Globals: Function: - Runtime: nodejx18.x + Runtime: nodejs22.x Resources: MyLambda: diff --git a/src/index.ts b/src/index.ts index 1128924..7d6da4a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -190,9 +190,9 @@ class AwsSamPlugin { } // Check the runtime is supported - if (!["nodejx18.x", "nodejx20.x", "nodejx18.x"].includes(properties.Runtime ?? defaultRuntime)) { + if (!["nodejs18.x", "nodejs20.x", "nodejs22.x"].includes(properties.Runtime ?? defaultRuntime)) { throw new Error( - `${resourceKey} has an unsupport Runtime. Must be nodejx18.x, nodejx20.x or nodejx18.x` + `${resourceKey} has an unsupport Runtime. Must be nodejs18.x, nodejs20.x or nodejs22.x` ); }