Skip to content

Commit

Permalink
feat(type-safe-api): handlers default to python 3.13 and node 22
Browse files Browse the repository at this point in the history
In order to default to the most secure configuration, handler functions now default to the latest
supported AWS Lambda runtimes for Python and Node.

BREAKING CHANGE: API handlers that don't specify the runtime version need to be validated with
Python 3.13 or Node 22.
  • Loading branch information
jstrunk committed Dec 23, 2024
1 parent 22771cb commit b012e03
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export abstract class GeneratedPythonHandlersBaseProject extends PythonProject {
});
TypeSafeApiCommandEnvironment.ensure(this);
this.options = options;
this.runtimeVersion = options.runtimeVersion ?? PythonVersion.PYTHON_3_11;
this.runtimeVersion = options.runtimeVersion ?? PythonVersion.PYTHON_3_13;
this.tstDir = "test";

if (options.pytest ?? true) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export abstract class GeneratedTypescriptHandlersBaseProject extends TypeScriptP
npmignoreEnabled: false,
});
this.options = options;
this.runtimeVersion = options.runtimeVersion ?? NodeVersion.NODE_18;
this.runtimeVersion = options.runtimeVersion ?? NodeVersion.NODE_22;

TypeSafeApiCommandEnvironment.ensure(this);

Expand Down
4 changes: 2 additions & 2 deletions packages/type-safe-api/src/project/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ export interface GeneratedTypeScriptHandlersOptions

/**
* Runtime version to target for the handlers
* @default NodeVersion.NODE_18
* @default NodeVersion.NODE_22
*/
readonly runtimeVersion?: NodeVersion;
}
Expand All @@ -231,7 +231,7 @@ export interface GeneratedPythonHandlersOptions

/**
* Runtime version to target for the handlers
* @default PythonVersion.PYTHON_3_11
* @default PythonVersion.PYTHON_3_13
*/
readonly runtimeVersion?: PythonVersion;
}
Expand Down

0 comments on commit b012e03

Please sign in to comment.