Skip to content

Commit aed8ad1

Browse files
authored
feat(lambda-nodejs): add bun support (#31770)
### Issue #31753 Closes #31753. ### Reason for this change `bun` is rapidly gaining popularity because it's extremely performant compared to `node`. `bun` has its own lockfile, `bun.lockb`, which is not currently respected by AWS CDK when bundling `NodejsFunction`s. ### Description of changes This code is very well-structured, so it was simple to add bun support alongside `yarn`, `pnpm` and `npm`. ### Description of how you validated changes I linked this code up to a simple, sample CDK app with a `bun` lockfile. I wasn't able to `bun cdk synth` before my changes. Then, after linking up my local workspace, I was able to bundle with my `bun` lockfile. I also added unit tests similar to those that exist for the other packages managers. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 0ce71fc commit aed8ad1

File tree

21 files changed

+31703
-9
lines changed

21 files changed

+31703
-9
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// eslint-disable-next-line import/no-extraneous-dependencies
2+
import axios from 'axios';
3+
4+
export async function handler() {
5+
await axios.get('https://www.google.com');
6+
}

packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.dependencies-bun.js.snapshot/BunTestDefaultTestDeployAssert773BA602.assets.json

+32
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.dependencies-bun.js.snapshot/BunTestDefaultTestDeployAssert773BA602.template.json

+319
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.dependencies-bun.js.snapshot/TestStack.assets.json

+32
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)