Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bun-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4.4
1.4.5
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.4.4](https://bun.sh/blog/bun-v1.4.4)
Current bun version: [1.4.5](https://bun.sh/blog/bun-v1.4.5)

## Installation

Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.4.4";
const bunVersion = "1.4.5";

export interface BunFunctionProps extends Omit<
FunctionProps,
Expand Down
53 changes: 5 additions & 48 deletions test/runtime.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,57 +66,14 @@ async function waitFor(props: { condition: () => boolean; timeoutMs: number }):
}
}

// JS reserved words cannot be used as a `const`/`function` binding name, so a
// generated handler like `export const in = ...` is a syntax error. Excluding
// them keeps the generated identifiers valid (otherwise the test is flaky).
const reservedWords = new Set([
"break",
"case",
"catch",
"class",
"const",
"continue",
"debugger",
"default",
"delete",
"do",
"else",
"enum",
"export",
"extends",
"false",
"finally",
"for",
"function",
"if",
"import",
"in",
"instanceof",
"new",
"null",
"return",
"super",
"switch",
"this",
"throw",
"true",
"try",
"typeof",
"var",
"void",
"while",
"with",
"yield",
"let",
"static",
"await",
"async",
]);

// The "h" prefix guarantees a valid identifier: a bare generated name can be a
// reserved word in strict-mode ESM (e.g. `in`, `public`, `eval`), which makes
// the generated handler module a syntax error and the test flaky.
function validIdentifier(props: { minLength: number; maxLength: number }): fc.Arbitrary<string> {
return fc
.string({ minLength: props.minLength, maxLength: props.maxLength })
.filter((value) => /^[a-zA-Z][a-zA-Z0-9]*$/.test(value) && !reservedWords.has(value));
.filter((value) => /^[a-zA-Z0-9]+$/.test(value))
.map((value) => `h${value}`);
}

describe("handler string resolution (Property 1)", () => {
Expand Down