diff --git a/changelog.md b/changelog.md index 6b574e7..591dd74 100644 --- a/changelog.md +++ b/changelog.md @@ -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 diff --git a/package.json b/package.json index 4359d06..7f9cda5 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/readme.md b/readme.md index d67c07f..df993c5 100644 --- a/readme.md +++ b/readme.md @@ -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: diff --git a/src/index.js b/src/index.js index 6520fda..4440f33 100644 --- a/src/index.js +++ b/src/index.js @@ -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') { diff --git a/test/integration/base-runtime-test.js b/test/integration/base-runtime-test.js index 6e9a5d9..494a5e0 100644 --- a/test/integration/base-runtime-test.js +++ b/test/integration/base-runtime-test.js @@ -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' })