HarperFast / HarperFast/harper

@aws-sdk/client-s3 + @smithy ship in every install (~18MB) for the S3 export path only — make them optional peers like bedrock

Open
#2,607 0 comments 0 reactions 1 assignee Claimed by @heskew View on GitHub
Dominant language
JavaScript
Stars
89
Forks
10
Avg merge
2d 6h
Merged PRs (30d)
200

Description

## Summary

| dep | size |
|---|---|
| @aws-sdk (client-s3, lib-storage, nested-clients, core) | 11M |
| @smithy | 8M |

~18MB in every install, used by exactly two files: `utility/AWS/AWSConnector.js` (top-level `require('@aws-sdk/client-s3')`) and `dataLayer/export.ts` (`require('@aws-sdk/lib-storage')` at module scope) — the S3 export/import operations. No other subsystem touches it.

harper already has the exact pattern for this: `@aws-sdk/client-bedrock-runtime` is an optional peer via `peerDependenciesMeta`. Proposal — same treatment for the S3 pair:

1. Move `@aws-sdk/client-s3` and `@aws-sdk/lib-storage` to `peerDependencies` + `peerDependenciesMeta: { optional: true }`.
2. Convert the two require sites to lazy `import()` with a clear operation-level error when the SDK is absent (`S3 export requires @aws-sdk/client-s3 — npm install @aws-sdk/client-s3 @aws-sdk/lib-storage`).

Deployments that use S3 export install the peers explicitly; every other install drops ~18MB.

## Method

`npm install harper@5.2.7 --omit=dev` on darwin/arm64, npm 11.16.0; per-package `du -sm`; import sites via grep excluding tests/dist. Both requires are reachable from the operations registry, so the lazy conversion is the load-bearing part of the change.

## References

- #2164 — install footprint umbrella (part of lever 4, the always-installed tail)
- Bedrock optional-peer precedent: `peerDependenciesMeta` in package.json

---

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.