Skip to content

Commit

Permalink
feat(lambda-nodejs): add bun support (#31770)
Browse files Browse the repository at this point in the history
### 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*
  • Loading branch information
blimmer authored Dec 5, 2024
1 parent 0ce71fc commit aed8ad1
Show file tree
Hide file tree
Showing 21 changed files with 31,703 additions and 9 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// eslint-disable-next-line import/no-extraneous-dependencies
import axios from 'axios';

export async function handler() {
await axios.get('https://www.google.com');
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit aed8ad1

Please sign in to comment.