Skip to content

Commit

Permalink
feat(type-safe-api): support python 3.13 and node 22 lambda runtimes (#…
Browse files Browse the repository at this point in the history
…899)

AWS Lambda now supports Python 3.13 and Node 22. This change enables API handlers to use the current
runtimes.

fix #897
  • Loading branch information
jstrunk authored Dec 20, 2024
1 parent 6c662d4 commit 22771cb
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ class NodeRuntimeVersionUtils {
return "NODEJS_18_X";
case NodeVersion.NODE_20:
return "NODEJS_20_X";
case NodeVersion.NODE_22:
return "NODEJS_22_X";
default:
throw new Error(`Unsupported node runtime ${runtimeVersion}`);
}
Expand All @@ -75,6 +77,8 @@ class NodeRuntimeVersionUtils {
runtimeVersion: NodeVersion
): string => {
switch (runtimeVersion) {
case NodeVersion.NODE_22:
return "node22";
case NodeVersion.NODE_20:
return "node20";
case NodeVersion.NODE_18:
Expand All @@ -99,6 +103,8 @@ class PythonRuntimeVersionUtils {
return "PYTHON_3_11";
case PythonVersion.PYTHON_3_12:
return "PYTHON_3_12";
case PythonVersion.PYTHON_3_13:
return "PYTHON_3_13";
default:
throw new Error(`Unsupported python runtime ${runtimeVersion}`);
}
Expand Down Expand Up @@ -131,6 +137,8 @@ class PythonRuntimeVersionUtils {
runtimeVersion: PythonVersion
): string => {
switch (runtimeVersion) {
case PythonVersion.PYTHON_3_13:
return "3.13";
case PythonVersion.PYTHON_3_12:
return "3.12";
case PythonVersion.PYTHON_3_11:
Expand Down
2 changes: 2 additions & 0 deletions packages/type-safe-api/src/project/languages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export enum Language {
export enum NodeVersion {
NODE_18 = "NODE_18",
NODE_20 = "NODE_20",
NODE_22 = "NODE_22",
}

/**
Expand All @@ -33,6 +34,7 @@ export enum JavaVersion {
export enum PythonVersion {
PYTHON_3_11 = "PYTHON_3_11",
PYTHON_3_12 = "PYTHON_3_12",
PYTHON_3_13 = "PYTHON_3_13",
}

/**
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ describe("TypeScript ESM Generator Tests", () => {
"x-handlers-typescript-asset-path": "test/ts/dist",
"x-handlers-python-asset-path": "test/py/dist",
"x-handlers-java-asset-path": "test/java/dist",
"x-handlers-node-lambda-runtime-version": "NODEJS_20_X",
"x-handlers-python-lambda-runtime-version": "PYTHON_3_12",
"x-handlers-node-lambda-runtime-version": "NODEJS_22_X",
"x-handlers-python-lambda-runtime-version": "PYTHON_3_13",
"x-handlers-java-lambda-runtime-version": "JAVA_21",
}
)}'`,
Expand Down

0 comments on commit 22771cb

Please sign in to comment.