From 679f0d295369deb99318841f8d2bd2922164c3a0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 21 Aug 2026 06:29:29 +0000 Subject: [PATCH 1/2] feat: update bun runtime to v1.4.0 --- .bun-version | 2 +- README.md | 2 +- src/index.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.bun-version b/.bun-version index 085c0f2..88c5fb8 100644 --- a/.bun-version +++ b/.bun-version @@ -1 +1 @@ -1.3.14 +1.4.0 diff --git a/README.md b/README.md index ad16fd0..3818c71 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ A custom [Bun](https://bun.sh) runtime for AWS Lambda with CDK constructs for ea > [!NOTE] > **v3 is ESM-only and no longer published as a jsii package.** Polyglot CDK support (Python, Java, .NET) has been removed — there were zero consumers. If you need the layer without CDK, the zip is available as a GitHub Release asset. See [ADR: Drop jsii](docs/adr-drop-jsii.md) for the full rationale. -Current bun version: [1.3.14](https://bun.sh/blog/bun-v1.3.14) +Current bun version: [1.4.0](https://bun.sh/blog/bun-v1.4.0) ## Installation diff --git a/src/index.ts b/src/index.ts index 62b9552..a1987ae 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,7 +7,7 @@ import type { LayerVersionProps } from "aws-cdk-lib/aws-lambda"; import { LogGroup, RetentionDays } from "aws-cdk-lib/aws-logs"; import type { Construct } from "constructs"; -const bunVersion = "1.3.14"; +const bunVersion = "1.4.0"; export interface BunFunctionProps extends Omit< FunctionProps, From 615463e915cca7b6cd0644396d3caac4607f2cdf Mon Sep 17 00:00:00 2001 From: Ivan Barlog Date: Sat, 22 Aug 2026 11:34:47 +0200 Subject: [PATCH 2/2] fix: derive test version dynamically from src/index.ts --- test/buildLayer.test.ts | 12 ++++++------ test/constructs.test.ts | 7 +++++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/test/buildLayer.test.ts b/test/buildLayer.test.ts index 6de90da..fe4b644 100644 --- a/test/buildLayer.test.ts +++ b/test/buildLayer.test.ts @@ -1,4 +1,9 @@ import { describe, expect, test } from "bun:test"; +import { readFileSync } from "node:fs"; +import { resolve } from "node:path"; + +const srcIndex = readFileSync(resolve(__dirname, "../src/index.ts"), "utf8"); +const bunVersion = srcIndex.match(/const bunVersion = "([^"]+)"/)?.[1] ?? ""; describe("version parameter precedence (Property 6)", () => { // Uses non-existent versions that pass validation but 404 at download (fast failure) @@ -20,17 +25,12 @@ describe("version parameter precedence (Property 6)", () => { }); test("falls back to src/index.ts version when both are absent", () => { - // The script resolves 1.3.14 from src/index.ts and starts downloading. - // We don't wait for the full download — just verify it found the right version. - // Use a fake non-downloadable version by temporarily patching would be complex, - // so instead we rely on the output showing the resolved version. const proc = Bun.spawnSync(["bun", "command/buildLayer.ts"], { env: { ...process.env, BUN_VERSION: undefined }, timeout: 3000, }); const output = proc.stdout.toString() + proc.stderr.toString(); - // The script should print "Downloading Bun v1.3.14" proving it read src/index.ts - expect(output).toContain("1.3.14"); + expect(output).toContain(bunVersion); }); }); diff --git a/test/constructs.test.ts b/test/constructs.test.ts index f09015c..fc707ce 100644 --- a/test/constructs.test.ts +++ b/test/constructs.test.ts @@ -1,5 +1,5 @@ import { describe, expect, test, beforeAll, afterAll } from "bun:test"; -import { existsSync, writeFileSync, unlinkSync } from "node:fs"; +import { existsSync, readFileSync, writeFileSync, unlinkSync } from "node:fs"; import { resolve } from "node:path"; import { App, Stack } from "aws-cdk-lib"; @@ -8,8 +8,11 @@ import * as fc from "fast-check"; import { BunFunction, BunLambdaLayer } from "../src/index"; +const srcIndex = readFileSync(resolve(__dirname, "../src/index.ts"), "utf8"); +const bunVersion = srcIndex.match(/const bunVersion = "([^"]+)"/)?.[1] ?? ""; + // CDK's Code.fromAsset requires the zip to exist on disk during synth -const dummyZipPath = resolve(__dirname, "../src/bun-lambda-layer-1.3.14.zip"); +const dummyZipPath = resolve(__dirname, `../src/bun-lambda-layer-${bunVersion}.zip`); beforeAll(() => { if (!existsSync(dummyZipPath)) {