Skip to content

Commit 75b0c29

Browse files
committed
Fix default export handling in Node.js 22, update Lambda runtimes
1 parent 74e1eb6 commit 75b0c29

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"@architect/utils": "~4.0.6",
2828
"@aws-lite/client": "^0.21.1",
2929
"@aws-lite/ssm": "^0.2.3",
30-
"lambda-runtimes": "~2.0.2"
30+
"lambda-runtimes": "~2.0.5"
3131
},
3232
"devDependencies": {
3333
"@architect/eslint-config": "~3.0.0",

src/config/pragmas/plugins.js

+6
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ module.exports = async function getPluginModules ({ arc, inventory, errors }) {
2121
if (arc?.plugins?.length) tagPlugins(arc.plugins, 'plugin')
2222
if (arc?.macros?.length) tagPlugins(arc.macros, 'macro')
2323

24+
let { node } = process.versions
25+
let nodeVer = Number(node.split('.')[0])
26+
2427
for (let pluginItem of pluginItems) {
2528
let { plugin, type } = pluginItem
2629
let name
@@ -52,6 +55,9 @@ module.exports = async function getPluginModules ({ arc, inventory, errors }) {
5255
if (type === 'plugin') {
5356
try {
5457
plugins[name] = require(pluginPath)
58+
if (nodeVer >= 22 && plugins[name].default) {
59+
plugins[name] = plugins[name].default
60+
}
5561
}
5662
catch (err) {
5763
if (hasEsmError(err)) {

test/unit/src/config/pragmas/populate-lambda/get-runtimes-test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ test('Friendly runtime names (aka aliases)', t => {
3131
t.equal(config.runtimeAlias, 'java', `Alias returned lowcase as runtimeAlias: ${config.runtimeAlias}`)
3232

3333
config = getRuntimes({ config: c('.net'), inventory })
34-
t.match(config.runtime, /dotnet7/, `Alias mapped to valid AWS .NET string: ${config.runtime}`)
34+
t.match(config.runtime, /dotnet8/, `Alias mapped to valid AWS .NET string: ${config.runtime}`)
3535
t.equal(config.runtimeAlias, '.net', `Alias returned lowcase as runtimeAlias: ${config.runtimeAlias}`)
3636

3737
config = getRuntimes({ config: c('custom'), inventory })
@@ -64,7 +64,7 @@ test('Exact runtime names', t => {
6464
t.equal(config.runtime, name, `Returned correct runtime string: ${name}`)
6565
t.notOk(config.runtimeAlias, 'Did not get runtimeAlias')
6666

67-
name = 'dotnet6'
67+
name = 'dotnet8'
6868
config = getRuntimes({ config: c(name), inventory })
6969
t.equal(config.runtime, name, `Returned correct runtime string: ${name}`)
7070
t.notOk(config.runtimeAlias, 'Did not get runtimeAlias')

0 commit comments

Comments
 (0)