node-lambda 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/README.md +1 -1
- package/lib/main.js +15 -4
- package/package.json +10 -10
- package/test/main.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -456,3 +456,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
|
456
456
|
- feat: remove BUILD from the exclusion list [#607](https://github.com/motdotla/node-lambda/pull/607)
|
|
457
457
|
- BREAKING CHANGES
|
|
458
458
|
- add nodejs16.x to runtime [#605](https://github.com/motdotla/node-lambda/pull/605)
|
|
459
|
+
|
|
460
|
+
## [1.1.0] - 2022-10-26
|
|
461
|
+
### Features
|
|
462
|
+
- feat: support esm [#613](https://github.com/motdotla/node-lambda/pull/613)
|
|
463
|
+
|
|
464
|
+
### Bugfixes
|
|
465
|
+
- fix the bug in `excludeGlobs` in `_fileCopy` [#609](https://github.com/motdotla/node-lambda/pull/609)
|
package/README.md
CHANGED
|
@@ -221,7 +221,7 @@ AWS Lambda will let you set environment variables for your function. Use the sam
|
|
|
221
221
|
|
|
222
222
|
## Node.js Runtime Configuration
|
|
223
223
|
|
|
224
|
-
AWS Lambda now supports Node.js 16
|
|
224
|
+
AWS Lambda now supports 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.
|
|
225
225
|
|
|
226
226
|
## Use S3 to deploy
|
|
227
227
|
|
package/lib/main.js
CHANGED
|
@@ -51,8 +51,8 @@ Edit the .env, deploy.env, ${program.contextFile}, \
|
|
|
51
51
|
event_sources.json and ${program.eventFile} files as needed.`)
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
run (program) {
|
|
55
|
-
if (!['
|
|
54
|
+
async run (program) {
|
|
55
|
+
if (!['nodejs14.x', 'nodejs16.x'].includes(program.runtime)) {
|
|
56
56
|
console.error(`Runtime [${program.runtime}] is not supported.`)
|
|
57
57
|
process.exit(254)
|
|
58
58
|
}
|
|
@@ -67,7 +67,18 @@ event_sources.json and ${program.eventFile} files as needed.`)
|
|
|
67
67
|
this._setRunTimeEnvironmentVars(program)
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
const
|
|
70
|
+
const handlerFilePath = (() => {
|
|
71
|
+
const filePath = path.join(process.cwd(), filename)
|
|
72
|
+
if (path.sep === '\\') {
|
|
73
|
+
// Convert because of error in Windows.
|
|
74
|
+
// Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]:
|
|
75
|
+
// Only URLs with a scheme in: file, data are supported by the default ESM loader.
|
|
76
|
+
// On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'
|
|
77
|
+
return 'file:///' + filePath.split(path.sep).join('/')
|
|
78
|
+
}
|
|
79
|
+
return filePath
|
|
80
|
+
})()
|
|
81
|
+
const handler = (await import(handlerFilePath))[handlername]
|
|
71
82
|
const event = require(path.join(process.cwd(), program.eventFile))
|
|
72
83
|
const context = require(path.join(process.cwd(), program.contextFile))
|
|
73
84
|
const enableRunMultipleEvents = (() => {
|
|
@@ -364,7 +375,7 @@ Emulate only the body of the API Gateway event.
|
|
|
364
375
|
return true
|
|
365
376
|
}
|
|
366
377
|
|
|
367
|
-
if (!minimatch(src, pattern, { matchBase: true })) {
|
|
378
|
+
if (!minimatch(src, pattern, { matchBase: true, windowsPathsNoEscape: true })) {
|
|
368
379
|
return true
|
|
369
380
|
}
|
|
370
381
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-lambda",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Command line tool for locally running and remotely deploying your node.js applications to Amazon Lambda.",
|
|
5
5
|
"main": "lib/main.js",
|
|
6
6
|
"directories": {
|
|
@@ -35,21 +35,21 @@
|
|
|
35
35
|
"node": ">= 10.0.0"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"archiver": "^5.3.
|
|
39
|
-
"aws-sdk": "^2.
|
|
40
|
-
"aws-xray-sdk-core": "^3.3.
|
|
41
|
-
"commander": "^9.
|
|
38
|
+
"archiver": "^5.3.1",
|
|
39
|
+
"aws-sdk": "^2.1238.0",
|
|
40
|
+
"aws-xray-sdk-core": "^3.3.8",
|
|
41
|
+
"commander": "^9.4.1",
|
|
42
42
|
"continuation-local-storage": "^3.2.1",
|
|
43
|
-
"dotenv": "^16.0.
|
|
44
|
-
"fs-extra": "^10.
|
|
43
|
+
"dotenv": "^16.0.3",
|
|
44
|
+
"fs-extra": "^10.1.0",
|
|
45
45
|
"klaw": "^4.0.1",
|
|
46
|
-
"minimatch": "^5.
|
|
46
|
+
"minimatch": "^5.1.0",
|
|
47
47
|
"proxy-agent": "^5.0.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"aws-sdk-mock": "^5.
|
|
50
|
+
"aws-sdk-mock": "^5.8.0",
|
|
51
51
|
"chai": "^4.3.6",
|
|
52
|
-
"mocha": "^
|
|
52
|
+
"mocha": "^10.1.0",
|
|
53
53
|
"node-zip": "^1.1.1",
|
|
54
54
|
"standard": "^17.0.0"
|
|
55
55
|
}
|