@beesolve/lambda-bun-runtime 1.2.3 → 1.3.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/.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[![View on Construct Hub](https://constructs.dev/badge?package=%40beesolve%2Flambda-bun-runtime)](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"
8434
+ "markdown": "# Lambda bun runtime\n\n[![View on Construct Hub](https://constructs.dev/badge?package=%40beesolve%2Flambda-bun-runtime)](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"
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.2.3",
8602
- "fingerprint": "NN/mQvdPb0jTthGa1cIMtHHBZ29z7G4IioHWB7HzGGk="
8601
+ "version": "1.3.0",
8602
+ "fingerprint": "HKU3YCqDH+hAKArJ/1EMHLV/8lpsvTUJ3C1J27mYZBI="
8603
8603
  }
package/CHANGELOG.md CHANGED
@@ -1,4 +1,13 @@
1
1
 
2
+ ## [1.2.3](https://github.com/beesolve/lambda-bun-runtime/compare/v1.2.2...v1.2.3) (2025-12-04)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * fix BunFunction code path ([09032c4](https://github.com/beesolve/lambda-bun-runtime/commit/09032c4d35de58df3408f52a4cf7ad1b06ca89a4))
8
+ * fix BunFunction code path ([f517c35](https://github.com/beesolve/lambda-bun-runtime/commit/f517c35966c82a71d4401da2d3874248cdca5689))
9
+ * fix BunFunction code path ([3b7403c](https://github.com/beesolve/lambda-bun-runtime/commit/3b7403c9a4ca6374b13e0e57ada64f22fdcc1801))
10
+
2
11
  ## [1.2.2](https://github.com/beesolve/lambda-bun-runtime/compare/v1.2.1...v1.2.2) (2025-12-04)
3
12
 
4
13
 
package/README.md CHANGED
@@ -67,3 +67,24 @@ console.timeEnd("Built.");
67
67
  ```
68
68
 
69
69
  When you persist above build script in `build.ts` you can then run it with `bun run build.ts`.
70
+
71
+ ## Why the fork?
72
+
73
+ This 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.
74
+
75
+ The [usage](https://github.com/oven-sh/bun/tree/main/packages/bun-lambda#usage) is the same as in official runtime.
76
+
77
+ Here are changes which were added on top of the original runtime:
78
+
79
+ - 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
80
+ - https://github.com/oven-sh/bun/pull/21018 - setting cookies now works with both HTTP Event v1 and HTTP Event v2
81
+ - 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`
82
+
83
+
84
+ ## Roadmap
85
+
86
+ - [ ] keep in sync with latest versions of Bun
87
+ - [ ] investigate https://github.com/oven-sh/bun/pull/20825
88
+ - [ ] investigate https://github.com/oven-sh/bun/issues/14139
89
+ - [ ] investigate https://github.com/oven-sh/bun/issues/6003
90
+ - [ ] investigate https://github.com/oven-sh/bun/issues?q=is%3Aissue%20state%3Aopen%20label%3Alambda
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.2.3" };
25
+ BunFunction[_a] = { fqn: "@beesolve/lambda-bun-runtime.BunFunction", version: "1.3.0" };
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.2.3" };
41
+ BunLambdaLayer[_b] = { fqn: "@beesolve/lambda-bun-runtime.BunLambdaLayer", version: "1.3.0" };
42
42
  function toEntry(entrypoint) {
43
43
  const entry = entrypoint.split("/").pop()?.split(".").shift();
44
44
  if (entry == null)
package/package.json CHANGED
@@ -73,7 +73,7 @@
73
73
  "publishConfig": {
74
74
  "access": "public"
75
75
  },
76
- "version": "1.2.3",
76
+ "version": "1.3.0",
77
77
  "types": "lib/index.d.ts",
78
78
  "stability": "stable",
79
79
  "jsii": {