• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

jeremydaly / lambda-api / #220
83%

Build:
DEFAULT BRANCH: main
Ran 04 Jul 2026 01:37PM UTC
Jobs 1
Files 16
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

04 Jul 2026 01:37PM UTC coverage: 82.719% (-15.1%) from 97.822%
#220

push

github

web-flow
Add dual CJS/ESM build (#326)

* Add dual CJS/ESM build

* Update package-lock.json

* ci: build dual package once, run test matrix against prebuilt dist

The SWC build toolchain requires Node >= 16.14, so the Node 14 test job could
no longer build. Restructure CI to build the CJS/ESM output once on Node 20 and
share dist/ as an artifact, then run the Node 14-22 test matrix against that
prebuilt output (npm run test:prebuilt). This preserves runtime testing on all
supported Node versions without building on the ones the toolchain can't run on.

- pull-request.yml / release.yml: add a build job (build + tsd + upload dist),
  make the test matrix download dist and run tests without rebuilding
- build.yml: bump the coverage job from Node 14 to 20 (build tooling floor)
- add the test:prebuilt script (jest unit against an existing dist/)

* Fix eager AWS SDK load under ESM refactor + add dual-package e2e suite

The dual CJS/ESM refactor turned lambda-api's lazy S3 loading into static
top-level imports: src/index.js and src/lib/response.js statically import
s3-service, which statically imported @aws-sdk/*. That made require('lambda-api')
/ import 'lambda-api' throw "Cannot find module '@aws-sdk/client-s3'" whenever
the OPTIONAL peer deps weren't installed — breaking every non-S3 consumer — and
constructed an S3Client at module-eval time on every import.

Fix (src/lib/s3-service.js only): load @aws-sdk and construct the S3 client
lazily via dynamic import() inside the service, on first real S3 use. Keeps the
named exports getObject/getSignedUrl/setConfig and the synchronous setConfig the
existing unit tests rely on (sinon stubs + constructor assertion). SWC compiles
import() to a lazy require() in the CJS build and keeps native import() in ESM.
Also add "./package.json" to the exports map.

Add an extensive e2e suite (e2e/, excluded from the tarball):
 - Layer 1 (no Docker): installs the packed tarball into isolated CJS/ESM/deep-
   import/esbuild-.mjs(#295)... (continued)

804 of 983 branches covered (81.79%)

Branch coverage included in aggregate %.

766 of 915 relevant lines covered (83.72%)

121.29 hits per line

Jobs
ID Job ID Ran Files Coverage
1 #220.1 04 Jul 2026 01:37PM UTC 16
82.72
Source Files on build #220
  • Tree
  • List 16
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • 94439dfc on github
  • Prev Build on main
  • Next Build on main
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc