Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: aws/aws-lambda-nodejs-runtime-interface-client
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.1.0
Choose a base ref
...
head repository: aws/aws-lambda-nodejs-runtime-interface-client
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Loading
Showing with 10,398 additions and 8,996 deletions.
  1. +5 −4 .dockerignore
  2. +7 −0 .eslintignore
  3. +19 −26 .eslintrc
  4. +10 −0 .github/PULL_REQUEST_TEMPLATE.md
  5. +15 −0 .github/dependabot.yml
  6. +22 −8 .github/workflows/test-on-push-and-pr.yml
  7. +11 −76 .gitignore
  8. +4 −75 .npmignore
  9. +3 −15 Makefile
  10. +11 −4 README.md
  11. +2 −2 THIRD-PARTY-LICENSES
  12. +0 −14 bin/index.js
  13. +14 −0 bin/index.mjs
  14. +2 −2 binding.gyp
  15. BIN deps/curl-7_83_1.tar.gz
  16. +131 −0 deps/patches/libcurl-configure-template.patch
  17. +3,676 −6,111 package-lock.json
  18. +35 −29 package.json
  19. +7 −2 scripts/postinstall.sh
  20. +53 −4 scripts/preinstall.sh
  21. +2 −1 scripts/update_dependencies.sh
  22. +33 −0 src/BeforeExitListener.js
  23. +146 −0 src/CallbackContext.js
  24. +0 −84 src/Common/index.ts
  25. +121 −0 src/Errors.js
  26. +0 −115 src/Errors/XRayError.ts
  27. +0 −137 src/Errors/index.ts
  28. +33 −0 src/HttpResponseStream.js
  29. +139 −0 src/InvokeContext.js
  30. +244 −0 src/LogPatch.js
  31. +7 −0 src/NativeModuleLoader.js
  32. +213 −0 src/RAPIDClient.js
  33. +288 −0 src/ResponseStream.js
  34. +204 −0 src/Runtime.js
  35. +0 −49 src/Runtime/BeforeExitListener.ts
  36. +0 −164 src/Runtime/CallbackContext.ts
  37. +0 −173 src/Runtime/InvokeContext.ts
  38. +0 −126 src/Runtime/Runtime.ts
  39. +0 −6 src/Runtime/index.ts
  40. +0 −247 src/RuntimeClient/RuntimeClient.ts
  41. +0 −7 src/RuntimeClient/index.ts
  42. +0 −153 src/RuntimeClient/runtime-client.cc
  43. +83 −0 src/StreamingContext.js
  44. +321 −0 src/UserFunction.js
  45. +49 −0 src/VerboseLog.js
  46. +94 −0 src/XRayError.js
  47. +49 −0 src/build.js
  48. +53 −0 src/index.mjs
  49. +0 −65 src/index.ts
  50. +156 −0 src/rapid-client.cc
  51. +0 −6 src/tsconfig.json
  52. +10 −0 src/types/awslambda.d.ts
  53. +1 −0 src/types/index.d.mts
  54. +0 −108 src/utils/LogPatch.ts
  55. +0 −165 src/utils/UserFunction.ts
  56. +11 −0 test/handlers/asyncInit.mjs
  57. +26 −0 test/handlers/asyncInitRejection.mjs
  58. +7 −0 test/handlers/async_init_package/cjsModuleInEsmPackage.js
  59. +11 −0 test/handlers/async_init_package/index.js
  60. +5 −0 test/handlers/async_init_package/nested/even/more/index.js
  61. +1 −0 test/handlers/async_init_package/nested/even/package.json
  62. +1 −0 test/handlers/async_init_package/nested/even/readme.txt
  63. +7 −0 test/handlers/async_init_package/nested/index.js
  64. +12 −0 test/handlers/async_init_package/package.json
  65. +7 −0 test/handlers/async_init_type_not_module/index.js
  66. +3 −0 test/handlers/async_init_type_not_module/package.json
  67. +7 −0 test/handlers/async_init_with_node_modules/node_modules/index.js
  68. +12 −0 test/handlers/async_init_with_node_modules/package.json
  69. +24 −0 test/handlers/beforeExitBehaviour.js
  70. +5 −0 test/handlers/cjsModule.cjs
  71. +39 −0 test/handlers/core.js
  72. +7 −0 test/handlers/defaultHandler.js
  73. +3 −0 test/handlers/defaultHandlerESM.mjs
  74. +5 −0 test/handlers/esModule.mjs
  75. +19 −0 test/handlers/esModuleImports.mjs
  76. +6 −0 test/handlers/extensionless/esm-extensionless
  77. +8 −0 test/handlers/extensionless/index
  78. +11 −0 test/handlers/nestedHandler.js
  79. +872 −0 test/handlers/package-lock.json
  80. +63 −0 test/handlers/package.json
  81. +9 −0 test/handlers/pkg-less/cjsAndMjs.js
  82. +9 −0 test/handlers/pkg-less/cjsImportCjs.js
  83. +10 −0 test/handlers/pkg-less/cjsImportESM.cjs
  84. +8 −0 test/handlers/pkg-less/cjsInMjs.mjs
  85. +7 −0 test/handlers/pkg-less/cjsModule.cjs
  86. +7 −0 test/handlers/pkg-less/esmImportCjs.mjs
  87. +6 −0 test/handlers/pkg-less/esmInCjs.cjs
  88. +9 −0 test/handlers/pkg-less/esmModule.js
  89. +7 −0 test/handlers/pkg-less/esmRequireCjs.mjs
  90. +8 −0 test/handlers/pkg/type-cjs/cjs
  91. +7 −0 test/handlers/pkg/type-cjs/cjsModule.js
  92. +6 −0 test/handlers/pkg/type-cjs/esm
  93. +6 −0 test/handlers/pkg/type-cjs/esmModule.js
  94. +3 −0 test/handlers/pkg/type-cjs/package.json
  95. +8 −0 test/handlers/pkg/type-esm/cjs
  96. +8 −0 test/handlers/pkg/type-esm/cjsModule.js
  97. +6 −0 test/handlers/pkg/type-esm/esm
  98. +5 −0 test/handlers/pkg/type-esm/esmModule.js
  99. +3 −0 test/handlers/pkg/type-esm/package.json
  100. +6 −0 test/handlers/precedence
  101. +5 −0 test/handlers/precedence.js
  102. +3 −0 test/handlers/precedence.json
  103. +5 −0 test/handlers/precedence.mjs
  104. +1 −0 test/handlers/precedence.node
  105. +5 −0 test/handlers/precedenceJsVsMjs.js
  106. +5 −0 test/handlers/precedenceJsVsMjs.mjs
  107. +5 −0 test/handlers/precedenceMjsVsCjs.cjs
  108. +5 −0 test/handlers/precedenceMjsVsCjs.mjs
  109. +14 −2 test/integration/codebuild-local/codebuild_build.sh
  110. +2 −1 test/integration/codebuild-local/test_all.sh
  111. +2 −4 test/integration/codebuild/buildspec.os.alpine.1.yml
  112. +4 −7 test/integration/codebuild/buildspec.os.alpine.2.yml
  113. +113 −0 test/integration/codebuild/buildspec.os.alpine.3.yml
  114. +2 −1 test/integration/codebuild/buildspec.os.amazonlinux.2.yml
  115. +5 −3 test/integration/codebuild/{buildspec.os.amazonlinux.1.yml → buildspec.os.amazonlinux.2023.yml}
  116. +3 −4 test/integration/codebuild/{buildspec.os.centos.2.yml → buildspec.os.centos.yml}
  117. +3 −3 test/integration/codebuild/{buildspec.os.debian.yml → buildspec.os.debian.1.yml}
  118. +11 −7 test/integration/codebuild/{buildspec.os.centos.1.yml → buildspec.os.debian.2.yml}
  119. +3 −4 test/integration/codebuild/buildspec.os.ubuntu.1.yml
  120. +3 −1 test/integration/codebuild/buildspec.os.ubuntu.2.yml
  121. +13 −1 test/integration/docker/Dockerfile.echo.alpine
  122. +17 −4 test/integration/docker/Dockerfile.echo.amazonlinux
  123. +2 −1 test/integration/docker/Dockerfile.echo.centos
  124. +2 −1 test/integration/docker/Dockerfile.echo.debian
  125. +3 −1 test/integration/docker/Dockerfile.echo.ubuntu
  126. +14 −2 test/integration/docker/Dockerfile.programmatic.alpine
  127. BIN test/integration/resources/aws-lambda-rie-arm64.tar.gz
  128. BIN test/integration/resources/aws-lambda-rie.tar.gz
  129. +4 −2 test/integration/test-handlers/echo/index.js
  130. +0 −1 test/integration/test-handlers/echo/package.json
  131. +4 −2 test/integration/test-handlers/programmatic/{index.js → index.mjs}
  132. +0 −1 test/integration/test-handlers/programmatic/package.json
  133. +0 −21 test/unit/Common/Common.test.ts
  134. +7 −0 test/unit/Dockerfile.nodejs18.x
  135. +7 −0 test/unit/Dockerfile.nodejs20.x
  136. +7 −0 test/unit/Dockerfile.nodejs22.x
  137. +0 −125 test/unit/Errors/Errors.test.ts
  138. +0 −53 test/unit/Errors/XRayError.test.ts
  139. +32 −0 test/unit/ErrorsTest.js
  140. +130 −0 test/unit/FakeTelemetryTarget.js
  141. +37 −0 test/unit/InvokeContextTest.js
  142. +936 −0 test/unit/LogPatchTest.js
  143. +87 −0 test/unit/LoggingGlobals.js
  144. +117 −0 test/unit/RAPIDClientTest.js
  145. +577 −0 test/unit/ResponseStreamTest.js
  146. +0 −59 test/unit/Runtime/BeforeExitListener.test.ts
  147. +0 −108 test/unit/Runtime/CallbackContext.test.ts
  148. +0 −42 test/unit/Runtime/InvokeContext.test.ts
  149. +0 −49 test/unit/RuntimeClient/RuntimeClient.test.ts
  150. +123 −0 test/unit/StreamingContextTest.js
  151. +431 −0 test/unit/UserFunctionTest.js
  152. +48 −0 test/unit/package.json
  153. +0 −12 test/unit/tsconfig.json
  154. +0 −100 test/unit/utils/FakeTelemetryTarget.ts
  155. +0 −229 test/unit/utils/LogPatch.test.ts
  156. +0 −58 test/unit/utils/LoggingGlobals.ts
  157. +0 −18 test/unit/utils/NoOpNativeHttp.ts
  158. +0 −30 test/unit/utils/StubHttp.ts
  159. +18 −23 test/{utils/StdoutReporter.ts → util/StdoutReporter.test.js}
  160. +0 −31 tsconfig-base.json
  161. +0 −7 tsconfig.json
9 changes: 5 additions & 4 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
node_modules
**/node_modules

# Required for the async_init_with_node_modules unit test
!test/handlers/async_init_with_node_modules/node_modules

build
**/build

lib
**/lib
dist
**/dist

.idea
**/.idea

package-lock.json
**/package-lock.json

test/integration/*.ts

.git
.DS_STORE
7 changes: 7 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules
**/node_modules

async_init_package
test-handlers

dist/**
45 changes: 19 additions & 26 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,38 +1,31 @@
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": ["src/tsconfig.json", "test/unit/tsconfig.json"]
"ecmaVersion": 2022
},
"plugins": ["@typescript-eslint", "prettier"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
"plugin:prettier/recommended"
],
"env": {
"node": true,
"mocha": true,
"es6": true
},
"rules": {
"@typescript-eslint/restrict-plus-operands": "error",
"@typescript-eslint/interface-name-prefix": "off",
"no-async-promise-executor": "warn",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/indent": "off",
"@typescript-eslint/ban-types": "warn",
"no-console": "warn",
"no-shadow": "warn"
},
"overrides": [
{
"files":["test/**/*.ts"],
"rules": {
"no-console": "off",
"@typescript-eslint/no-explicit-any": "off",
"no-prototype-builtins": "off",
"strictBindCallApply": "off"
"strict": [
"error",
"global"
],
"indent": [
"error",
2
],
"camelcase": "error",
"no-console": "off",
"no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_"
}
}
]
]
}
}
10 changes: 10 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
_Issue #, if available:_

_Description of changes:_

_Target (OCI, Managed Runtime, both):_

## Checklist
- [ ] I have run `npm install` to generate the `package-lock.json` correctly and included it in the PR.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: 2
updates:

- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "npm"
directory: "/test/handlers"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
30 changes: 22 additions & 8 deletions .github/workflows/test-on-push-and-pr.yml
Original file line number Diff line number Diff line change
@@ -7,14 +7,28 @@ on:
branches: [ '*' ]

jobs:
build:
unit-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [18, 20, 22]

steps:
- uses: actions/checkout@v4
- name: Build and run tests for Node.js ${{ matrix.node-version }}
run: |
docker build -f test/unit/Dockerfile.nodejs${{ matrix.node-version }}.x -t unit/nodejs.${{ matrix.node-version }}x .
docker run unit/nodejs.${{ matrix.node-version }}x
integration-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
distro: [alpine, amazonlinux, centos, debian, ubuntu]

steps:
- uses: actions/checkout@v2
- name: Set up node
uses: actions/setup-node@v1
with:
node-version: '16'
- name: Run 'pr' target
run: make pr
- uses: actions/checkout@v4
- name: Run ${{ matrix.distro }} integration tests
run: DISTRO=${{ matrix.distro }} make test-integ
87 changes: 11 additions & 76 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -7,9 +7,6 @@ test/integration/resources/init
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
@@ -20,103 +17,41 @@ pids
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo
# Required for the async_init_with_node_modules unit test
!test/handlers/async_init_with_node_modules/node_modules

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history
.eslintignore

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
lib/

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port
# Build
dist/

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
.idea/
deps/artifacts/
deps/aws-lambda-cpp*/
deps/curl*/

# Local codebuild
codebuild.*/
Loading