Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .changeset/bump-unthrown-beta-7.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
"@temporal-contract/contract": patch
"@temporal-contract/client": patch
"@temporal-contract/worker": patch
---

Bump `unthrown` to `5.0.0-beta.7` and raise the peer range to `^5.0.0-beta.7`.

Two changes come with it, neither requiring code changes here:

- **`returnType<R>()` on the built-in matcher** — pins a match's output type so
every branch is checked against it, instead of the result being the union of
the branch returns. Available on all five `*ErrCases` combinators, `match`'s
`errCases` handler, and standalone `match(value)`.
- **`tapErrCases` no longer silently drops a `defect(…)` branch.** Such a branch
now produces a `Defect` whose cause is an `AggregateError` of the branch's
cause and the observed error, matching what a `throw` in the same position
already did. Only a breaking change for code that relied on the value being
discarded — this package's single `tapErrCases` call site logs and does not
use the `defect` marker.
4 changes: 2 additions & 2 deletions docs/explanation/why-temporal-contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ or charges wrongly, and leaves a failed execution to explain.
## Failures as values

Temporal's failure model is strings: an `ApplicationFailure` with a `type` that
retry policies match on. Effective for retries, weak for branching. `if
(error.type === "CARD_DECLINED")` is a stringly-typed conditional with a typo
retry policies match on. Effective for retries, weak for branching. A check like
`error.type === "CARD_DECLINED"` is a stringly-typed conditional with a typo
waiting to happen, and no payload beyond a message.

A contract can declare its failures:
Expand Down
2 changes: 1 addition & 1 deletion docs/how-to/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ types. Your code and the library must resolve to the _same_ copy.

| Peer | Required by | Range |
| ---------------------- | ------------------------ | --------------- |
| `unthrown` | contract, worker, client | `^5.0.0-beta.6` |
| `unthrown` | contract, worker, client | `^5.0.0-beta.7` |
| `@temporalio/common` | worker, client | `^1` |
| `@temporalio/worker` | worker, testing | `^1` |
| `@temporalio/workflow` | worker | `^1` |
Expand Down
9 changes: 5 additions & 4 deletions docs/how-to/upgrade-to-v8.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ Version 8 has two breaking changes:
Both are mechanical. Budget an afternoon for a medium codebase.

::: warning 8.0 is currently a prerelease
The 8.0 line is published under the `beta` tag. `npm install
@temporal-contract/contract` still resolves 7.x. Install explicitly:
The 8.0 line is published under the `beta` tag, so a plain
`npm install @temporal-contract/contract` still resolves 7.x. Install
explicitly:

```bash
pnpm add @temporal-contract/contract@beta @temporal-contract/worker@beta \
Expand All @@ -31,7 +32,7 @@ pnpm add @temporal-contract/contract@beta \
@temporal-contract/worker@beta \
@temporal-contract/client@beta
pnpm add -D @temporal-contract/testing@beta
pnpm add unthrown@^5.0.0-beta.6
pnpm add unthrown@^5.0.0-beta.7
```

If an intermediate beta had you install `ts-pattern` as a peer, remove it —
Expand Down Expand Up @@ -222,7 +223,7 @@ const retryOnce: ClientInterceptor = (args, next) =>
## Checklist

- [ ] All four `@temporal-contract/*` packages on the same 8.0 version
- [ ] `unthrown` resolves to `^5.0.0-beta.6`
- [ ] `unthrown` resolves to `^5.0.0-beta.7`
- [ ] `ts-pattern` removed if it was added for beta.5
- [ ] `mapErr` / `flatMapErr` / `tapErr` / `recoverErr` → `*Cases`
- [ ] `match({ err })` → `match({ errCases })`
Expand Down
2 changes: 1 addition & 1 deletion packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"peerDependencies": {
"@temporalio/client": "^1",
"@temporalio/common": "^1",
"unthrown": "^5.0.0-beta.6"
"unthrown": "^5.0.0-beta.7"
},
"engines": {
"node": ">=22.19.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/contract/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"vitest": "catalog:"
},
"peerDependencies": {
"unthrown": "^5.0.0-beta.6"
"unthrown": "^5.0.0-beta.7"
},
"peerDependenciesMeta": {
"unthrown": {
Expand Down
2 changes: 1 addition & 1 deletion packages/worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"@temporalio/common": "^1",
"@temporalio/worker": "^1",
"@temporalio/workflow": "^1",
"unthrown": "^5.0.0-beta.6"
"unthrown": "^5.0.0-beta.7"
},
"engines": {
"node": ">=22.19.0"
Expand Down
42 changes: 21 additions & 21 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ catalog:
"@temporalio/worker": 1.20.3
"@temporalio/workflow": 1.20.3
"@types/node": 26.1.1
"@unthrown/vitest": 5.0.0-beta.6
"@unthrown/vitest": 5.0.0-beta.7
"@vitest/coverage-v8": 4.1.10
arktype: 2.2.3
knip: 6.27.0
Expand All @@ -41,7 +41,7 @@ catalog:
typedoc: 0.28.20
typedoc-plugin-markdown: 4.12.0
typescript: 6.0.3
unthrown: 5.0.0-beta.6
unthrown: 5.0.0-beta.7
valibot: 1.4.2
vitest: 4.1.10
zod: 4.4.3
Expand Down
Loading