Skip to content

Commit ec18611

Browse files
committed
docs: reword lingering ts-pattern references to the built-in matcher
The dependency is gone (beta.6 builds the matcher into unthrown); the migration guide, worker errors JSDoc, and the agent dependency rules now say 'exhaustive matcher' instead of naming ts-pattern, and the catalog note no longer lists it.
1 parent fff11ff commit ec18611

3 files changed

Lines changed: 17 additions & 17 deletions

File tree

.agents/rules/dependencies.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
| `zod` | Direct dep of `contract` (used internally for the `defineContract` runtime validation pass); user-side schema lib for the others |
1414
| `valibot` / `arktype` | User-side schema libraries (Standard Schema) |
1515

16-
`pino` and `ts-pattern` appear in the catalog and are used by `examples/` only — they're not imported from any published package's `src/`.
16+
`pino` appears in the catalog and is used by `examples/` only — it's not imported from any published package's `src/`.
1717

1818
## Tooling
1919

docs/guide/migrating-to-unthrown.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -52,21 +52,21 @@ the same name but is now imported from `"unthrown"`.
5252

5353
## API mapping
5454

55-
| neverthrow | unthrown |
56-
| -------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
57-
| `import { ResultAsync } from "neverthrow"` | `import { fromPromise } from "unthrown"` |
58-
| type `ResultAsync<T, E>` | type `AsyncResult<T, E>` |
59-
| type `Result<T, E>` | `Result<T, E>` (now from `"unthrown"`) |
60-
| `ok(v)` / `err(e)` | `Ok(v)` / `Err(e)` (from `"unthrown"`) |
61-
| `okAsync(v)` | `Ok(v).toAsync()` (no `okAsync`) |
62-
| `errAsync(e)` | `Err(e).toAsync()` (no `errAsync`) |
63-
| `ResultAsync.fromPromise(promise, errFn)` | `fromPromise(promise, errFn)` |
64-
| `ResultAsync.fromSafePromise(promise)` | `fromSafePromise(promise)` |
65-
| `.andThen(fn)` | `.flatMap(fn)` |
66-
| `.map(fn)` / `.mapErr(fn)` / `.orElse(fn)` | `.map(fn)` / `.mapErrCases(m)` / `.flatMapErrCases(m)` (the error combinators take an exhaustive ts-pattern matcher `m`, not a plain callback) |
67-
| `Result.combine([...])` | `all([...])` |
68-
| `result.match(okFn, errFn)` (positional) | `result.match({ ok, errCases, defect })` (object, 3 channels; `errCases` is an exhaustive matcher) |
69-
| `result.isOk()` / `result.isErr()` to narrow | `result.isOk()` / `result.isErr()` / `result.isDefect()` (methods narrow; `isOk(result)` free functions also exist) |
55+
| neverthrow | unthrown |
56+
| -------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
57+
| `import { ResultAsync } from "neverthrow"` | `import { fromPromise } from "unthrown"` |
58+
| type `ResultAsync<T, E>` | type `AsyncResult<T, E>` |
59+
| type `Result<T, E>` | `Result<T, E>` (now from `"unthrown"`) |
60+
| `ok(v)` / `err(e)` | `Ok(v)` / `Err(e)` (from `"unthrown"`) |
61+
| `okAsync(v)` | `Ok(v).toAsync()` (no `okAsync`) |
62+
| `errAsync(e)` | `Err(e).toAsync()` (no `errAsync`) |
63+
| `ResultAsync.fromPromise(promise, errFn)` | `fromPromise(promise, errFn)` |
64+
| `ResultAsync.fromSafePromise(promise)` | `fromSafePromise(promise)` |
65+
| `.andThen(fn)` | `.flatMap(fn)` |
66+
| `.map(fn)` / `.mapErr(fn)` / `.orElse(fn)` | `.map(fn)` / `.mapErrCases(m)` / `.flatMapErrCases(m)` (the error combinators take an exhaustive matcher `m`, not a plain callback) |
67+
| `Result.combine([...])` | `all([...])` |
68+
| `result.match(okFn, errFn)` (positional) | `result.match({ ok, errCases, defect })` (object, 3 channels; `errCases` is an exhaustive matcher) |
69+
| `result.isOk()` / `result.isErr()` to narrow | `result.isOk()` / `result.isErr()` / `result.isDefect()` (methods narrow; `isOk(result)` free functions also exist) |
7070

7171
## `okAsync` / `errAsync` are gone
7272

packages/worker/src/errors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ export class ChildWorkflowError extends TaggedError("@temporal-contract/ChildWor
346346
* distinct {@link TaggedError}s, so call sites discriminate on the `_tag`
347347
* (or `instanceof ChildWorkflowCancelledError`) instead of relying on an
348348
* `instanceof ChildWorkflowError` that also matches cancellation. A
349-
* `result.match` with the ts-pattern `errCases` matcher folds the
349+
* `result.match` with the exhaustive `errCases` matcher folds the
350350
* `ChildWorkflowError | ChildWorkflowCancelledError` union exhaustively.
351351
*/
352352
export class ChildWorkflowCancelledError extends TaggedError(

0 commit comments

Comments
 (0)