Repository navigation
v0.4.1 — fail safe by default
Fail safe by default
baerly-storage 0.4.1 is an operational-hardening release. The theme: when something is misconfigured, fail loud at boot instead of quietly losing data. Plus two new ways to run it — Cloudflare Workers over S3, and S3 on EKS.
Note: 0.4.1 supersedes 0.4.0, which has been deprecated on npm. 0.4.0 shipped a mis-stamped
kernelVersion("0.3.0") in its served/v1/spec; 0.4.1 corrects it and is otherwise identical to 0.4.0. Install 0.4.1.
Fail closed, not silent
The failure mode this release closes: an app falls back to in-memory or local-disk storage in production, writes "succeed" into RAM or an ephemeral container disk, then vanish on the next restart with no signal.
MemoryStoragerefuses to construct in a detected deployment (NODE_ENV=productionor a known PaaS marker) unless you explicitly pass{ ephemeral: true }or setBAERLY_ALLOW_EPHEMERAL_STORAGE=true. Tests, local dev, and CI are unaffected.- The Node example servers fail loud in a deployment when a real bucket is missing or typo'd — they won't silently run on the local-fs dev fallback.
- Invalid object keys are rejected before the wire.
./../ empty keys now throw a clearInvalidConfigon every adapter, instead of drawing an opaque bucket-root403. sigV4Signerfails fast on blank or whitespace-only credentials rather than signing with empty values and drawing a 403.
Runs in more places
- Cloudflare Workers can now use S3-compatible storage over HTTP, not just a native R2 binding — via the new Worker-safe
@gusto/baerly-storage/s3subpath. Opt-in; the R2 binding stays the default. - S3 on EKS works out of the box. New
fromWebIdentity()andfromEks()credential providers add IRSA (AWS_ROLE_ARN+AWS_WEB_IDENTITY_TOKEN_FILE) support alongside the existing Pod Identity path — no AWS SDK dependency. - Zero-credential local dev. The new
localFsStorage()factory lets Node apps run against the local filesystem in development and promote to S3/R2 once bucket env vars are set.
Also in this release
- New type exports —
PredicateArg,Predicate,Collection(root) andPredicateArg(/client) — so you can name.where(...)arguments directly. Fixes aPath<T>bug where an optional array field broke predicate typing. - Smaller S3 bundle — swapped
fast-xml-parserfor@rgrove/parse-xml: −87 KiB raw / −14 KiB min-gz on thes3.jsclosure, zero transitive deps, and the XML-entity-expansion CVE class can no longer recur. - Durable-contract promises written down —
LogEntryis versionless and additive-only, version axes are drift-gated, and storage capabilities are split required vs. optional. Docs + internal tooling only; no runtime change.
Upgrade
pnpm add @gusto/baerly-storage@0.4.1No action required for apps already on a real S3/R2 bucket. The one thing to know: if you were (accidentally) running on in-memory or local-fs storage in a deployment, it will now refuse to boot — that's the point.
Full changelog + migration notes: CHANGELOG.md