Skip to content

Commit

Permalink
feat(type-safe-api): handlers default to python 3.13 and node 22 (#900)
Browse files Browse the repository at this point in the history
* feat(type-safe-api): handlers default to python 3.13 and node 22

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.

* chore(type-safe-api): update test snapshots

Updating test snapshots in a separate commit for review readability.

---------

Co-authored-by: Jack Stevenson <[email protected]>
  • Loading branch information
jstrunk and cogwirrel authored Feb 18, 2025
1 parent 0596dd3 commit adc072f
Show file tree
Hide file tree
Showing 15 changed files with 73 additions and 73 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

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

Loading

0 comments on commit adc072f

Please sign in to comment.