nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: motdotla/node-lambda
Pull request #608 (2022-05-19 00:38:39)

bump to 1.0.0
1.0.0 because the default exclusions change.


Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 98d5e3a..fb3a1b1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -450,3 +450,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
 - Support for Architectures parameter [#591](https://github.com/motdotla/node-lambda/pull/591)
 ### Bugfixes
 - fix: skip installing the package, when there is no `package.json` [#589](https://github.com/motdotla/node-lambda/pull/589)
+
+## [1.0.0] - 2022-05-19
+### Features
+- feat: remove BUILD from the exclusion list [#607](https://github.com/motdotla/node-lambda/pull/607)
+    - BREAKING CHANGES
+- add nodejs16.x to runtime [#605](https://github.com/motdotla/node-lambda/pull/605)
diff --git a/package-lock.json b/package-lock.json
index 47c15e6..0b76f1a 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
 {
   "name": "node-lambda",
-  "version": "0.22.0",
+  "version": "1.0.0",
   "lockfileVersion": 2,
   "requires": true,
   "packages": {
     "": {
       "name": "node-lambda",
-      "version": "0.22.0",
+      "version": "1.0.0",
       "license": "BSD-2-Clause",
       "dependencies": {
         "archiver": "^5.3.0",
diff --git a/package.json b/package.json
index 395a83d..6fb4ea9 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "node-lambda",
-  "version": "0.22.0",
+  "version": "1.0.0",
   "description": "Command line tool for locally running and remotely deploying your node.js applications to Amazon Lambda.",
   "main": "lib/main.js",
   "directories": {


Test patch:
diff --git a/test/main.js b/test/main.js
index 83b9c8e..8a809ef 100644
--- a/test/main.js
+++ b/test/main.js
@@ -151,7 +151,7 @@ describe('lib/main', function () {
   })
 
   it('version should be set', () => {
-    assert.equal(lambda.version, '0.22.0')
+    assert.equal(lambda.version, '1.0.0')
   })
 
   describe('_codeDirectory', () => {
Repository: motdotla/node-lambda
Pull request #615 (2022-10-26 01:18:53)

bump to 1.1.0


Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index fb3a1b1..85d8d64 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -456,3 +456,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).
 - feat: remove BUILD from the exclusion list [#607](https://github.com/motdotla/node-lambda/pull/607)
     - BREAKING CHANGES
 - add nodejs16.x to runtime [#605](https://github.com/motdotla/node-lambda/pull/605)
+
+## [1.1.0] - 2022-10-26
+### Features
+- feat: support esm [#613](https://github.com/motdotla/node-lambda/pull/613)
+
+### Bugfixes
+- fix the bug in `excludeGlobs` in `_fileCopy` [#609](https://github.com/motdotla/node-lambda/pull/609)
diff --git a/package-lock.json b/package-lock.json
index e60e04d..77f7f9c 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
 {
   "name": "node-lambda",
-  "version": "1.0.0",
+  "version": "1.1.0",
   "lockfileVersion": 2,
   "requires": true,
   "packages": {
     "": {
       "name": "node-lambda",
-      "version": "1.0.0",
+      "version": "1.1.0",
       "license": "BSD-2-Clause",
       "dependencies": {
         "archiver": "^5.3.1",
diff --git a/package.json b/package.json
index 23cae4a..65ab67d 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "node-lambda",
-  "version": "1.0.0",
+  "version": "1.1.0",
   "description": "Command line tool for locally running and remotely deploying your node.js applications to Amazon Lambda.",
   "main": "lib/main.js",
   "directories": {


Test patch:
diff --git a/test/main.js b/test/main.js
index 8a809ef..6156344 100644
--- a/test/main.js
+++ b/test/main.js
@@ -151,7 +151,7 @@ describe('lib/main', function () {
   })
 
   it('version should be set', () => {
-    assert.equal(lambda.version, '1.0.0')
+    assert.equal(lambda.version, '1.1.0')
   })
 
   describe('_codeDirectory', () => {
Repository: motdotla/node-lambda
Pull request #616 (2022-12-09 10:09:54)

Add support for nodejs18x runtime
**description:** node-lambda run gives an error if `AWS_RUNTIME=nodejs18.x`

[AWS now supports nodejs18.x runtime.](https://aws.amazon.com/blogs/compute/node-js-18-x-runtime-now-available-in-aws-lambda/)

**fixes:**
- add `nodejs18.x` to the if statement at `main.js`




Patch:
diff --git a/lib/main.js b/lib/main.js
index ad1cd8b..6628ddd 100644
--- a/lib/main.js
+++ b/lib/main.js
@@ -52,7 +52,7 @@ event_sources.json and ${program.eventFile} files as needed.`)
   }
 
   async run (program) {
-    if (!['nodejs14.x', 'nodejs16.x'].includes(program.runtime)) {
+    if (!['nodejs14.x', 'nodejs16.x', 'nodejs18.x'].includes(program.runtime)) {
       console.error(`Runtime [${program.runtime}] is not supported.`)
       process.exit(254)
     }


Test patch:
diff --git a/test/node-lambda.js b/test/node-lambda.js
index 85e36c4..8ba0dbc 100644
--- a/test/node-lambda.js
+++ b/test/node-lambda.js
@@ -171,6 +171,27 @@ describe('bin/node-lambda', () => {
       })
     })
 
+    describe('node-lambda run (Runtime nodejs18.x is supported)', () => {
+      const eventObj = {
+        asyncTest: false,
+        callbackWaitsForEmptyEventLoop: true // True is the default value of Lambda
+      }
+
+      before(() => {
+        process.env.AWS_RUNTIME = 'nodejs18.x'
+      })
+      after(() => {
+        process.env.AWS_RUNTIME = 'nodejs16.x'
+      })
+
+      it('`node-lambda run` exitCode is not `254` (callback(null))', (done) => {
+        _generateEventFile(Object.assign(eventObj, {
+          callbackCode: 'callback(null);'
+        }))
+        _testMain({ stdoutRegExp: /Success:$/, exitCode: 0 }, done)
+      })
+    })
+
     describe('node-lambda run (Multiple events))', () => {
       const eventObj = [{
         asyncTest: false,
Repository: motdotla/node-lambda
Pull request #696 (2023-11-27 23:34:27)

bump to 1.2.1

abetomo: fixes #695
abetomo: The ci is failing will be fixed in #697 .

Patch:
diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml
index 3bbca0e..ac45b90 100644
--- a/.github/workflows/workflow.yml
+++ b/.github/workflows/workflow.yml
@@ -16,7 +16,6 @@ jobs:
       with:
         node-version: ${{ matrix.node-version }}
         cache: 'npm'
-    - run: npm i -g npm
     - run: node -v
     - run: npm -v
     - run: npm ci
@@ -35,7 +34,6 @@ jobs:
       with:
         node-version: 20.x
         cache: 'npm'
-    - run: npm i -g npm
     - run: node -v
     - run: npm -v
     - run: npm ci
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a9dd7a0..5a3dae4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -467,3 +467,16 @@ This project adheres to [Semantic Versioning](http://semver.org/).
 ## [1.2.0] - 2022-12-21
 ### Features
 - Add support for nodejs18x [#616](https://github.com/motdotla/node-lambda/pull/616)
+
+## [1.2.1] - 2023-11-28
+### Features
+- Add 'ap-southeast-3' to S3_LOCATION_POSSIBLE_VALUES [#621](https://github.com/motdotla/node-lambda/pull/621)
+
+### Bugfixes
+- Fix minimatch import [#640](https://github.com/motdotla/node-lambda/pull/640)
+- Fix typo [#654](https://github.com/motdotla/node-lambda/pull/654)
+
+### Minor changes
+- Improve testing
+- Update dependencies
+- Update README
diff --git a/package-lock.json b/package-lock.json
index 05cb0c2..e99075f 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
 {
   "name": "node-lambda",
-  "version": "1.2.0",
+  "version": "1.2.1",
   "lockfileVersion": 2,
   "requires": true,
   "packages": {
     "": {
       "name": "node-lambda",
-      "version": "1.2.0",
+      "version": "1.2.1",
       "license": "BSD-2-Clause",
       "dependencies": {
         "archiver": "^6.0.0",
diff --git a/package.json b/package.json
index a6cfe5b..84e09c5 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "node-lambda",
-  "version": "1.2.0",
+  "version": "1.2.1",
   "description": "Command line tool for locally running and remotely deploying your node.js applications to Amazon Lambda.",
   "main": "lib/main.js",
   "directories": {


Test patch:
diff --git a/test/main.js b/test/main.js
index c51a042..d4bec29 100644
--- a/test/main.js
+++ b/test/main.js
@@ -160,7 +160,7 @@ describe('lib/main', function () {
   })
 
   it('version should be set', () => {
-    assert.equal(lambda.version, '1.2.0')
+    assert.equal(lambda.version, '1.2.1')
   })
 
   describe('_codeDirectory', () => {
Repository: motdotla/node-lambda
Pull request #702 (2023-12-27 10:08:47)

Update lambda runtime list
https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html


Patch:
diff --git a/README.md b/README.md
index d3a794c..9f7cf5e 100644
--- a/README.md
+++ b/README.md
@@ -230,7 +230,7 @@ AWS Lambda will let you set environment variables for your function. Use the sam
 
 ## Node.js Runtime Configuration
 
-AWS Lambda now supports Node.js 18, Node.js 16 and Node.js 14. Please also check the [Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) page.
+AWS Lambda now supports Node.js 20, Node.js 18 and Node.js 16. Please also check the [Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) page.
 
 ## Use S3 to deploy
 
diff --git a/lib/.env.example b/lib/.env.example
index 4dfd135..fd20d26 100644
--- a/lib/.env.example
+++ b/lib/.env.example
@@ -10,7 +10,7 @@ AWS_HANDLER=index.handler
 AWS_MEMORY_SIZE=128
 AWS_TIMEOUT=3
 AWS_DESCRIPTION=
-AWS_RUNTIME=nodejs18.x
+AWS_RUNTIME=nodejs20.x
 AWS_VPC_SUBNETS=
 AWS_VPC_SECURITY_GROUPS=
 AWS_TRACING_CONFIG=
diff --git a/lib/main.js b/lib/main.js
index b9e5108..e9efc5b 100644
--- a/lib/main.js
+++ b/lib/main.js
@@ -52,7 +52,7 @@ event_sources.json and ${program.eventFile} files as needed.`)
   }
 
   async run (program) {
-    if (!['nodejs14.x', 'nodejs16.x', 'nodejs18.x'].includes(program.runtime)) {
+    if (!['nodejs16.x', 'nodejs18.x', 'nodejs20.x'].includes(program.runtime)) {
       console.error(`Runtime [${program.runtime}] is not supported.`)
       process.exit(254)
     }


Test patch:
diff --git a/test/main.js b/test/main.js
index d4bec29..d91c870 100644
--- a/test/main.js
+++ b/test/main.js
@@ -23,7 +23,7 @@ const originalProgram = {
   memorySize: 128,
   timeout: 3,
   description: '',
-  runtime: 'nodejs18.x',
+  runtime: 'nodejs20.x',
   deadLetterConfigTargetArn: '',
   tracingConfig: '',
   Layers: '',
diff --git a/test/node-lambda.js b/test/node-lambda.js
index 834e344..a55799c 100644
--- a/test/node-lambda.js
+++ b/test/node-lambda.js
@@ -157,7 +157,7 @@ describe('bin/node-lambda', () => {
         process.env.AWS_RUNTIME = 'test'
       })
       after(() => {
-        process.env.AWS_RUNTIME = 'nodejs18.x'
+        process.env.AWS_RUNTIME = 'nodejs20.x'
       })
 
       it('`node-lambda run` exitCode is `254` (callback(null))', (done) => {
@@ -171,14 +171,14 @@ describe('bin/node-lambda', () => {
       })
     })
 
-    describe('node-lambda run (Runtime nodejs18.x is supported)', () => {
+    describe('node-lambda run (Runtime nodejs20.x is supported)', () => {
       const eventObj = {
         asyncTest: false,
         callbackWaitsForEmptyEventLoop: true // True is the default value of Lambda
       }
 
       before(() => {
-        process.env.AWS_RUNTIME = 'nodejs18.x'
+        process.env.AWS_RUNTIME = 'nodejs20.x'
       })
 
       it('`node-lambda run` exitCode is not `254` (callback(null))', (done) => {
Repository: motdotla/node-lambda
Pull request #769 (2024-12-11 08:45:01)

Use sdk-v3 with _listEventSourceMappings()
GH-641


Patch:
diff --git a/lib/main.js b/lib/main.js
index e5f71f0..8752968 100644
--- a/lib/main.js
+++ b/lib/main.js
@@ -30,6 +30,7 @@ const { createNamespace } = require('continuation-local-storage')
 const {
   LambdaClient,
   CreateFunctionCommand,
+  ListEventSourceMappingsCommand,
   GetFunctionCommand,
   UpdateFunctionCodeCommand,
   UpdateFunctionConfigurationCommand
@@ -766,16 +767,12 @@ they may not work as expected in the Lambda environment.
     return this._zip(program, codeDirectory)
   }
 
-  _listEventSourceMappings (lambda, params) {
-    return new Promise((resolve, reject) => {
-      lambda.listEventSourceMappings(params, (err, data) => {
-        if (err) return reject(err)
-        if (data && data.EventSourceMappings) {
-          return resolve(data.EventSourceMappings)
-        }
-        return resolve([])
-      })
-    })
+  async _listEventSourceMappings (lambda, params) {
+    const data = await lambda.send(new ListEventSourceMappingsCommand(params))
+    if (data && data.EventSourceMappings) {
+      return data.EventSourceMappings
+    }
+    return []
   }
 
   _getStartingPosition (eventSource) {
@@ -1009,7 +1006,7 @@ they may not work as expected in the Lambda environment.
         FunctionName: params.FunctionName
       }).promise().then(() => {
         // Function exists
-        return this._listEventSourceMappings(lambda, {
+        return this._listEventSourceMappings(lambdaClient, {
           FunctionName: params.FunctionName
         }).then((existingEventSourceList) => {
           return Promise.all([


Test patch:
diff --git a/test/main.js b/test/main.js
index 23b37f9..4f60a85 100644
--- a/test/main.js
+++ b/test/main.js
@@ -20,6 +20,7 @@ const { mockClient } = require('aws-sdk-client-mock')
 const {
   LambdaClient,
   CreateFunctionCommand,
+  ListEventSourceMappingsCommand,
   GetFunctionCommand,
   UpdateFunctionCodeCommand,
   UpdateFunctionConfigurationCommand
@@ -175,6 +176,7 @@ describe('lib/main', function () {
     mockLambdaClient.on(GetFunctionCommand).resolves(lambdaMockSettings.getFunction)
     mockLambdaClient.on(UpdateFunctionCodeCommand).resolves(lambdaMockSettings.updateFunctionCode)
     mockLambdaClient.on(UpdateFunctionConfigurationCommand).resolves(lambdaMockSettings.updateFunctionConfiguration)
+    mockLambdaClient.on(ListEventSourceMappingsCommand).resolves(lambdaMockSettings.listEventSourceMappings)
   })
   after(() => {
     _awsRestore()
@@ -1358,7 +1360,7 @@ describe('lib/main', function () {
   describe('_listEventSourceMappings', () => {
     it('simple test with mock', () => {
       return lambda._listEventSourceMappings(
-        awsLambda,
+        lambdaClient,
         { FunctionName: 'test-func' }
       ).then((results) => {
         assert.deepEqual(