@beesolve/lambda-bun-runtime 1.3.0 → 1.3.1
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/.jsii +3 -3
- package/CHANGELOG.md +7 -0
- package/README.md +1 -0
- package/lib/bun-lambda-layer-1.3.3.zip +0 -0
- package/lib/index.js +2 -2
- package/package.json +1 -1
package/.jsii
CHANGED
|
@@ -8431,7 +8431,7 @@
|
|
|
8431
8431
|
},
|
|
8432
8432
|
"name": "@beesolve/lambda-bun-runtime",
|
|
8433
8433
|
"readme": {
|
|
8434
|
-
"markdown": "# Lambda bun runtime\n\n[](https://constructs.dev/packages/@beesolve/lambda-bun-runtime)\n\nThis repository contains custom built bun runtime for AWS Lambda. It also contains CDK constructs for `BunFunction` which uses `BunLambdaLayer`.\n\n[Bun](https://bun.com) is a fast JavaScript runtime.\n\nCurrent bun version: [1.3.3](https://bun.com/blog/bun-v1.3.3)\n\n## Installation\n\nYou can install current version of our Lambda bun runtime from `npm` like this:\n\n```bash\nnpm i @beesolve/lambda-bun-runtime\n```\n\n## Usage\n\nThere are two constructs which you can use right ahead - `BunFunction` which depends on `BunLambdaLayer`:\n\n\n```ts\nimport { BunLambdaLayer, BunFunction } from '@beesolve/lambda-bun-runtime';\nimport { Duration } from \"aws-cdk-lib\";\n\nconst bunLayer = new BunLambdaLayer(this, \"BunLayer\");\n\nconst apiHandler = new BunFunction(this, \"ApiHandler\", {\n entrypoint: `${__dirname}/dist/api.js`,\n memorySize: 1024,\n timeout: Duration.seconds(10),\n environment: {\n STAGE: 'prod',\n },\n bunLayer,\n});\n```\n\nYou can pass additional properties to both `BunLambdaLayer` and `BunFunction`.\n\nThe code for `BunFunction` needs to be built beforehand.\n\nWe recommend to use following build script as quick start:\n\n\n```ts\n// build.ts\nimport * as Bun from \"bun\";\nimport { rmSync } from \"node:fs\";\n\nconsole.time(\"Built.\");\n\nrmSync(\"dist\", { force: true, recursive: true });\n\nawait Bun.build({\n entrypoints: [\"api.ts\"],\n outdir: \"dist\",\n target: \"bun\", // this is important as the built code runs in Bun environment\n minify: true,\n splitting: true,\n sourcemap: \"inline\",\n});\n\nconsole.timeEnd(\"Built.\");\n```\n\nWhen you persist above build script in `build.ts` you can then run it with `bun run build.ts`.\n\n## Why the fork?\n\nThis runtime is fork of official [`bun-lambda`](https://github.com/oven-sh/bun/tree/main/packages/bun-lambda). It was created because it seems that Lambda is not very high on Bun's roadmap and there are multiple pull requests which haven't been merged.\n\nThe [usage](https://github.com/oven-sh/bun/tree/main/packages/bun-lambda#usage) is the same as in official runtime.\n\nHere are changes which were added on top of the original runtime:\n\n- https://github.com/oven-sh/bun/pull/17449 - `traceId` is not guaranteed in all Lambda environments so exitting when `traceId` is not present has been removed\n- https://github.com/oven-sh/bun/pull/21018 - setting cookies now works with both HTTP Event v1 and HTTP Event v2\n- https://github.com/oven-sh/bun/pull/20640 - when using API Gateway Authorizer the authorization context is present in `Request` header called `x-amzn-authorizer`\n\n\n## Roadmap\n\n- [ ] keep in sync with latest versions of Bun\n- [ ] investigate https://github.com/oven-sh/bun/pull/20825\n- [ ] investigate https://github.com/oven-sh/bun/issues/14139\n- [ ] investigate https://github.com/oven-sh/bun/issues/6003\n- [ ] investigate https://github.com/oven-sh/bun/issues?q=is%3Aissue%20state%3Aopen%20label%3Alambda\n"
|
|
8434
|
+
"markdown": "# Lambda bun runtime\n\n[](https://constructs.dev/packages/@beesolve/lambda-bun-runtime)\n\nThis repository contains custom built bun runtime for AWS Lambda. It also contains CDK constructs for `BunFunction` which uses `BunLambdaLayer`.\n\n[Bun](https://bun.com) is a fast JavaScript runtime.\n\nCurrent bun version: [1.3.3](https://bun.com/blog/bun-v1.3.3)\n\n## Installation\n\nYou can install current version of our Lambda bun runtime from `npm` like this:\n\n```bash\nnpm i @beesolve/lambda-bun-runtime\n```\n\n## Usage\n\nThere are two constructs which you can use right ahead - `BunFunction` which depends on `BunLambdaLayer`:\n\n\n```ts\nimport { BunLambdaLayer, BunFunction } from '@beesolve/lambda-bun-runtime';\nimport { Duration } from \"aws-cdk-lib\";\n\nconst bunLayer = new BunLambdaLayer(this, \"BunLayer\");\n\nconst apiHandler = new BunFunction(this, \"ApiHandler\", {\n entrypoint: `${__dirname}/dist/api.js`,\n memorySize: 1024,\n timeout: Duration.seconds(10),\n environment: {\n STAGE: 'prod',\n },\n bunLayer,\n});\n```\n\nYou can pass additional properties to both `BunLambdaLayer` and `BunFunction`.\n\nThe code for `BunFunction` needs to be built beforehand.\n\nWe recommend to use following build script as quick start:\n\n\n```ts\n// build.ts\nimport * as Bun from \"bun\";\nimport { rmSync } from \"node:fs\";\n\nconsole.time(\"Built.\");\n\nrmSync(\"dist\", { force: true, recursive: true });\n\nawait Bun.build({\n entrypoints: [\"api.ts\"],\n outdir: \"dist\",\n target: \"bun\", // this is important as the built code runs in Bun environment\n minify: true,\n splitting: true,\n sourcemap: \"inline\",\n});\n\nconsole.timeEnd(\"Built.\");\n```\n\nWhen you persist above build script in `build.ts` you can then run it with `bun run build.ts`.\n\n## Why the fork?\n\nThis runtime is fork of official [`bun-lambda`](https://github.com/oven-sh/bun/tree/main/packages/bun-lambda). It was created because it seems that Lambda is not very high on Bun's roadmap and there are multiple pull requests which haven't been merged.\n\nThe [usage](https://github.com/oven-sh/bun/tree/main/packages/bun-lambda#usage) is the same as in official runtime.\n\nHere are changes which were added on top of the original runtime:\n\n- https://github.com/oven-sh/bun/pull/17449 - `traceId` is not guaranteed in all Lambda environments so exitting when `traceId` is not present has been removed\n- https://github.com/oven-sh/bun/pull/21018 - setting cookies now works with both HTTP Event v1 and HTTP Event v2\n- https://github.com/oven-sh/bun/pull/20640 - when using API Gateway Authorizer the authorization context is present in `Request` header called `x-amzn-authorizer`\n\n\n## Roadmap\n\n- [ ] keep in sync with latest versions of Bun\n- [ ] investigate https://github.com/oven-sh/bun/pull/20825\n- [ ] investigate https://github.com/oven-sh/bun/issues/14139\n- [ ] investigate https://github.com/oven-sh/bun/issues/6003\n- [ ] investigate https://github.com/oven-sh/bun/issues?q=is%3Aissue%20state%3Aopen%20label%3Alambda\n- [ ] implement automatic code bundling with `BunFunction`\n"
|
|
8435
8435
|
},
|
|
8436
8436
|
"repository": {
|
|
8437
8437
|
"type": "git",
|
|
@@ -8598,6 +8598,6 @@
|
|
|
8598
8598
|
"symbolId": "src/index:BunLambdaLayerProps"
|
|
8599
8599
|
}
|
|
8600
8600
|
},
|
|
8601
|
-
"version": "1.3.
|
|
8602
|
-
"fingerprint": "
|
|
8601
|
+
"version": "1.3.1",
|
|
8602
|
+
"fingerprint": "RJey+zJTMxHyxan2ww5F3OCxC3gaswuuHV4H6tVZs0M="
|
|
8603
8603
|
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
|
|
2
|
+
## [1.3.0](https://github.com/beesolve/lambda-bun-runtime/compare/v1.2.3...v1.3.0) (2025-12-05)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* do not exit runtime when traceId is not present ([a762790](https://github.com/beesolve/lambda-bun-runtime/commit/a7627904cb3bca9cd4eb94fa4023fd6a52c56ec6))
|
|
8
|
+
|
|
2
9
|
## [1.2.3](https://github.com/beesolve/lambda-bun-runtime/compare/v1.2.2...v1.2.3) (2025-12-04)
|
|
3
10
|
|
|
4
11
|
|
package/README.md
CHANGED
|
@@ -88,3 +88,4 @@ Here are changes which were added on top of the original runtime:
|
|
|
88
88
|
- [ ] investigate https://github.com/oven-sh/bun/issues/14139
|
|
89
89
|
- [ ] investigate https://github.com/oven-sh/bun/issues/6003
|
|
90
90
|
- [ ] investigate https://github.com/oven-sh/bun/issues?q=is%3Aissue%20state%3Aopen%20label%3Alambda
|
|
91
|
+
- [ ] implement automatic code bundling with `BunFunction`
|
|
Binary file
|
package/lib/index.js
CHANGED
|
@@ -22,7 +22,7 @@ class BunFunction extends aws_lambda_1.Function {
|
|
|
22
22
|
}
|
|
23
23
|
exports.BunFunction = BunFunction;
|
|
24
24
|
_a = JSII_RTTI_SYMBOL_1;
|
|
25
|
-
BunFunction[_a] = { fqn: "@beesolve/lambda-bun-runtime.BunFunction", version: "1.3.
|
|
25
|
+
BunFunction[_a] = { fqn: "@beesolve/lambda-bun-runtime.BunFunction", version: "1.3.1" };
|
|
26
26
|
class BunLambdaLayer extends aws_lambda_1.LayerVersion {
|
|
27
27
|
constructor(scope, id, props) {
|
|
28
28
|
super(scope, id, {
|
|
@@ -38,7 +38,7 @@ class BunLambdaLayer extends aws_lambda_1.LayerVersion {
|
|
|
38
38
|
}
|
|
39
39
|
exports.BunLambdaLayer = BunLambdaLayer;
|
|
40
40
|
_b = JSII_RTTI_SYMBOL_1;
|
|
41
|
-
BunLambdaLayer[_b] = { fqn: "@beesolve/lambda-bun-runtime.BunLambdaLayer", version: "1.3.
|
|
41
|
+
BunLambdaLayer[_b] = { fqn: "@beesolve/lambda-bun-runtime.BunLambdaLayer", version: "1.3.1" };
|
|
42
42
|
function toEntry(entrypoint) {
|
|
43
43
|
const entry = entrypoint.split("/").pop()?.split(".").shift();
|
|
44
44
|
if (entry == null)
|