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
2 changes: 2 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
"oxlint-catch-all-recommended",
"oxlint-four-rules",
"oxlint-no-catch-all-pattern",
"oxlint-p-tag-message",
"p-tag-pattern",
"prisma-transaction-defect",
"remove-tools-packages",
"rename-err-combinators-cases",
Expand Down
7 changes: 7 additions & 0 deletions packages/boxed/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @unthrown/boxed

## 5.0.0-beta.9

### Patch Changes

- Updated dependencies [e43d44e]
- unthrown@5.0.0-beta.9

## 5.0.0-beta.8

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/boxed/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@unthrown/boxed",
"version": "5.0.0-beta.8",
"version": "5.0.0-beta.9",
"description": "Boxed interop for unthrown",
"keywords": [
"boxed",
Expand Down
36 changes: 36 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,41 @@
# unthrown

## 5.0.0-beta.9

### Major Changes

- e43d44e: **`tag(t)` moves onto the pattern namespace as `P.tag(t)`; the standalone
`tag` export is removed.** `tag` is a pattern constructor, and every other one
already lives on `P` (`P._` / `P.any` / `P.instanceOf` / `P.when` / `P.union` /
`P.string` / `P.number`) — having exactly one of them sitting loose in the root
export was the odd one out. There is no alias: one concept, one name.

The type and the runtime behaviour are unchanged — it still produces the
`{ _tag: t }` object pattern, still narrows to the matching variant with its
payload, and still works in grouped patterns and inside `P.union`.

Migration is mechanical: drop `tag` from the import (keeping or adding `P`) and
prefix the call sites. (The `- import { tag } from "unthrown"` line below is the
v5-beta spelling; coming from 4.x the import was `@unthrown/pattern`, which is
gone — see the v5 upgrade guide.)

```diff
- import { tag } from "unthrown";
+ import { P } from "unthrown";

result.mapErrCases((matcher) =>
matcher
- .with(tag("NotFound"), () => new ApiError({ status: 404 }))
- .with(tag("Conflict"), tag("DriverError"), (e) => defect(e.cause)),
+ .with(P.tag("NotFound"), () => new ApiError({ status: 404 }))
+ .with(P.tag("Conflict"), P.tag("DriverError"), (e) => defect(e.cause)),
);
```

`TaggedError` (and the `TaggedErrorConstructor` / `TaggedErrorInstance` types)
are untouched and still exported from the root — only the matcher pattern
moved.

## 5.0.0-beta.8

## 5.0.0-beta.7
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "unthrown",
"version": "5.0.0-beta.8",
"version": "5.0.0-beta.9",
"description": "Explicit errors as values, with a separate defect (panic) channel",
"keywords": [
"defect",
Expand Down
7 changes: 7 additions & 0 deletions packages/effect/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @unthrown/effect

## 5.0.0-beta.9

### Patch Changes

- Updated dependencies [e43d44e]
- unthrown@5.0.0-beta.9

## 5.0.0-beta.8

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/effect/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@unthrown/effect",
"version": "5.0.0-beta.8",
"version": "5.0.0-beta.9",
"description": "Effect interop for unthrown",
"keywords": [
"effect",
Expand Down
7 changes: 7 additions & 0 deletions packages/neverthrow/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @unthrown/neverthrow

## 5.0.0-beta.9

### Patch Changes

- Updated dependencies [e43d44e]
- unthrown@5.0.0-beta.9

## 5.0.0-beta.8

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/neverthrow/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@unthrown/neverthrow",
"version": "5.0.0-beta.8",
"version": "5.0.0-beta.9",
"description": "neverthrow interop for unthrown",
"keywords": [
"errors-as-values",
Expand Down
10 changes: 10 additions & 0 deletions packages/oxlint/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# @unthrown/oxlint

## 5.0.0-beta.9

### Patch Changes

- e43d44e: Update `no-catch-all-pattern`'s diagnostic and documentation to spell the
recommended form as `.with(P.tag("A"), P.tag("B"), …, handler)`, following
core's move of the `tag` pattern constructor onto the `P` namespace. No rule
behaviour, name, or option changed — only the guidance text a developer reads
when the rule fires.

## 5.0.0-beta.8

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/oxlint/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@unthrown/oxlint",
"version": "5.0.0-beta.8",
"version": "5.0.0-beta.9",
"description": "oxlint plugin enforcing unthrown's conventions",
"keywords": [
"errors-as-values",
Expand Down
7 changes: 7 additions & 0 deletions packages/standard-schema/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @unthrown/standard-schema

## 5.0.0-beta.9

### Patch Changes

- Updated dependencies [e43d44e]
- unthrown@5.0.0-beta.9

## 5.0.0-beta.8

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/standard-schema/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@unthrown/standard-schema",
"version": "5.0.0-beta.8",
"version": "5.0.0-beta.9",
"description": "Standard Schema (Zod, Valibot, ArkType, …) interop for unthrown",
"keywords": [
"arktype",
Expand Down
2 changes: 2 additions & 0 deletions packages/vitest/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# @unthrown/vitest

## 5.0.0-beta.9

Comment thread
btravers marked this conversation as resolved.
## 5.0.0-beta.8

## 5.0.0-beta.7
Expand Down
2 changes: 1 addition & 1 deletion packages/vitest/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@unthrown/vitest",
"version": "5.0.0-beta.8",
"version": "5.0.0-beta.9",
"description": "Vitest matchers for unthrown",
"keywords": [
"errors-as-values",
Expand Down
Loading