SIGN IN SIGN UP

test: verify packed browser bundles target ES2020 (#2496)

## Summary

- Extend the existing packed-package integration check to install the
actual npm tarball and bundle an ordinary SDK import with Vite/Rolldown
for browser-targeted ES2020 ESM.
- Fail when package-internal imports cannot resolve, Node built-ins
enter the browser graph, or the emitted bundle contains post-ES2020
syntax such as top-level `await`.
- Reuse the existing Vitest/Vite and ts-node/Acorn dependency trees
while keeping optional peers absent and leaving package metadata,
lockfiles, webpack fixtures, CI policy, and production code unchanged.

Follow-up to #2494. Its native-browser production fix is handled
independently in #2495; this PR is based directly on `main` and does not
include or require that patch to pass.

## Verification

- `PATH=/Users/jbeckwith/.nvm/versions/node/v24.16.0/bin:$PATH
./scripts/build`
- `PATH=/Users/jbeckwith/.nvm/versions/node/v24.16.0/bin:$PATH node
--experimental-strip-types scripts/test-packed-package.ts`
- `node --experimental-strip-types scripts/test-packed-package.ts` on
Node 22.22.0
- `PATH=/Users/jbeckwith/.nvm/versions/node/v24.16.0/bin:$PATH
./scripts/lint`
- `PATH=/Users/jbeckwith/.nvm/versions/node/v24.16.0/bin:$PATH
node_modules/.bin/tsc`
- Injected unresolved `#package` imports, `node:fs`, and top-level
`await` into the ignored built artifact and confirmed the
packed-artifact check rejected all three.
- Two consecutive adversarial review rounds with two independent
read-only reviewers per round reported no in-scope findings.
J
Justin Beckwith committed
7ef99c48f76146a409763bb28f388837a2002bbd
Parent: b86efac
Committed by GitHub <noreply@github.com> on 8/27/2026, 3:51:54 PM