Skip to content

Commit

Permalink
Update Lambda base runtime to Node.js 20.x
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanblock committed Feb 5, 2024
1 parent c7f0e69 commit 52b4f72
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 9 deletions.
9 changes: 9 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

---

## [2.0.0] 2024-02-05

### Changed

- Updated Lambda base runtime to Node.js 20.x
- Updated dependencies

---

## [1.2.0] 2023-04-10

### Added
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@
"src/*"
],
"dependencies": {
"@types/aws-lambda": "^8.10.129",
"esbuild": "^0.19.8",
"@types/aws-lambda": "^8.10.133",
"esbuild": "^0.20.0",
"source-map-support": "^0.5.21"
},
"devDependencies": {
"@architect/architect": "^10.16.3",
"@architect/architect": "^11.0.2",
"@architect/eslint-config": "^2.1.2",
"cross-env": "^7.0.3",
"eslint": "^8.54.0",
"eslint": "^8.56.0",
"tap-arc": "^1.2.2",
"tape": "^5.7.2",
"tape": "^5.7.4",
"tiny-json-http": "^7.5.1"
},
"eslintConfig": {
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ The following higher-level settings are also available in your Architect project
- `esbuild-config` - add arbitrary [esbuild configuration](https://esbuild.github.io/api/) options
- Value is a relative path to a CJS file that exports an object of esbuild options; these options will be passed to the build
- Any options that conflict with this plugin's defaults will be ignored
- `base-runtime` - set a different base Node.js version; defaults to `nodejs16.x`
- `base-runtime` - set a different base Node.js version; defaults to `nodejs20.x`
- See [the list of Lambda-supported Node runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)

Example:
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = {
runtimes: function ({ inventory }) {
let { arc } = inventory.inv._project
let build = '.build'
let baseRuntime = 'nodejs16.x'
let baseRuntime = 'nodejs20.x'
if (arc.typescript) {
let settings = Object.fromEntries(arc.typescript)
if (settings.build && typeof settings.build === 'string') {
Expand Down
4 changes: 2 additions & 2 deletions test/integration/base-runtime-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ test('Inventory + SAM runtime config', async t => {
t.plan(4)
let inv = await inventory({ rawArc: arcFile, deployStage: 'staging' })
let sam = pkg(inv)
t.equal(inv.inv.http[0].config.runtimeConfig.baseRuntime, 'nodejs16.x', 'Default Inventory runtime is Node.js 16')
t.equal(sam.Resources.GetOkHTTPLambda.Properties.Runtime, 'nodejs16.x', 'Default SAM runtime is Node 16')
t.equal(inv.inv.http[0].config.runtimeConfig.baseRuntime, 'nodejs20.x', 'Default Inventory runtime is Node.js 16')
t.equal(sam.Resources.GetOkHTTPLambda.Properties.Runtime, 'nodejs20.x', 'Default SAM runtime is Node 16')

arcFile += [ '\n', '@typescript', 'base-runtime nodejs18.x' ].join('\n')
inv = await inventory({ rawArc: arcFile, deployStage: 'staging' })
Expand Down

0 comments on commit 52b4f72

Please sign in to comment.