bug: refactor npm tarballs include compiled native binaries
- Dominant language
- TypeScript
- Stars
- 283
- Forks
- 95
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 183
Description
## Description
On the `refactor` branch, the npm package's `files` allowlist includes all of `dist`. Packing a workspace after compiling native binaries therefore includes `dist/bin` and any other stale build output in the npm tarball.
## Reproduction
```sh
bun install --frozen-lockfile
bun run build
bun run compile:linux-x64
bun pm pack --ignore-scripts
tar -tzf aws-agentcore-*.tgz
```
No publishing is needed to reproduce this.
## Actual Behavior
The tarball includes `dist/bin/agentcore-linux-x64`. In a local reproduction, adding just this binary increased the compressed package from 1.44 MB to 40.37 MB. Other files left under `dist`, such as source maps, logs, and old build directories, are also included.
The automated release currently packs before compilation, which avoids the binaries on a fresh runner, but the package metadata does not enforce that separation for manual packaging or a reused build directory.
## Expected Behavior
Publish only the Node launcher, Node bundle, runtime assets, and standard package metadata to npm. Keep standalone native binaries as separate GitHub release assets, regardless of build/pack order.
## Environment
- Branch: `refactor`
- Base commit: `4fe2c108`
- Bun: 1.4.0
- Platform: Linux x64
Contributor guide
Research direction
Start with the npm package metadata that defines the `files` allowlist, then reproduce the issue with `bun pm pack --ignore-scripts` after the listed build and native compilation commands. Done means the tarball contains the Node launcher, bundle, runtime assets, and standard metadata, while excluding `dist/bin` and stale build output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- bun, typescript
- Domain
- build-system, cli, release
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100