Releases: btravstack/amqp-contract
@amqp-contract/worker@2.0.0
Patch Changes
- Updated dependencies [8707df1]
- @amqp-contract/contract@2.0.0
- @amqp-contract/core@2.0.0
@amqp-contract/worker@1.0.0
@amqp-contract/testing@2.0.0
@amqp-contract/testing@2.0.0
@amqp-contract/testing@1.0.0
@amqp-contract/testing@1.0.0
@amqp-contract/core@2.0.0
Patch Changes
- Updated dependencies [8707df1]
- @amqp-contract/contract@2.0.0
@amqp-contract/core@1.0.0
@amqp-contract/contract@2.0.0
Major Changes
-
8707df1: BREAKING: Upgrade
unthrownto1.0.0.unthrown 1.0 renames the value constructors —
ok→Ok,err→Err,defect→Defect(the lowercase forms are removed). All packages now depend onunthrown@1.0.0, so consumers that buildResult/AsyncResultvalues directly must update their call sites:- import { ok, err } from "unthrown"; - return ok(undefined).toAsync(); - return err(new RetryableError("...")).toAsync(); + import { Ok, Err } from "unthrown"; + return Ok(undefined).toAsync(); + return Err(new RetryableError("...")).toAsync();
Everything else is unchanged: the
.match({ ok, err, defect })handler keys stay lowercase (they're case branches, not constructors), andfromPromise/fromSafePromise/fromThrowable/all/allAsync/TaggedError(tag, { name })/.isOk()/.toAsync()/.unwrap()keep the same signatures.
@amqp-contract/contract@1.0.0
Major Changes
-
d5fec7e: BREAKING: Replace the
neverthrowdependency withunthrownfor value-based error handling across all packages.unthrownkeeps the errors-as-values model but adds a thirdDefectchannel for unexpected failures, and renames/reshapes several APIs. If you consume theResult/AsyncResultvalues returned by the client, worker, and core, you will need to update your call sites.What changed
ResultAsync→AsyncResult. All async-returning methods (publish,call,create,close, handler return types, …) now returnunthrown'sAsyncResult<T, E>..match()is now boxed and has three channels.result.match(okFn, errFn)→result.match({ ok, err, defect }). The extradefectbranch handles unexpected throws..andThen→.flatMap,.andTee→.tap,.orTee→.tapErr(.map,.mapErr,.orElseare unchanged).- No
okAsync/errAsync. Build async results withok(value).toAsync()/err(error).toAsync(). - No static
ResultAsync.fromPromise/Result.fromThrowable. Use the free functionsfromPromise(promise, qualify),fromSafePromise(promise), andfromThrowable(fn, qualify). Thequalifymapper returnsE | Defect. ._unsafeUnwrap()→.unwrap(),._unsafeUnwrapErr()→.unwrapErr()(these now throwUnwrapErroron the wrong variant, and re-throw the original cause on aDefect)..isOk()/.isErr()/.isDefect()narrow like neverthrow's did (they guardthis); standaloneisOk(result)/isErr(result)/isDefect(result)functions are also available.- Error classes are now
TaggedErrors.TechnicalError,MessageValidationError,RetryableError,NonRetryableError,RpcTimeoutError, andRpcCancelledErroreach carry a_tagfor exhaustive dispatch viamatchTags. The tags are namespaced —"@amqp-contract/TechnicalError","@amqp-contract/RetryableError", etc. — so they don't collide with other libraries' tags in a sharedmatchTags. The human-facingError.nameis kept bare ("TechnicalError","RetryableError", …), so stack traces and.namechecks are unaffected. Their positional constructors are unchanged. HandlerErroris now a tagged-union type, not an abstract class. It isRetryableError | NonRetryableError. Replaceerror instanceof HandlerErrorwithisHandlerError(error).
Patch Changes
- 4ed4abe: Update repository, homepage, and bug-tracker URLs after the project moved from the
btraversGitHub profile to thebtravstackorganization. Documentation now lives at https://btravstack.github.io/amqp-contract/.
@amqp-contract/client@2.0.0
Patch Changes
- Updated dependencies [8707df1]
- @amqp-contract/contract@2.0.0
- @amqp-contract/core@2.0.0