diff --git a/.changeset/pre.json b/.changeset/pre.json index a44598d..4f22071 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -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", diff --git a/packages/boxed/CHANGELOG.md b/packages/boxed/CHANGELOG.md index e126813..426d492 100644 --- a/packages/boxed/CHANGELOG.md +++ b/packages/boxed/CHANGELOG.md @@ -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 diff --git a/packages/boxed/package.json b/packages/boxed/package.json index 0279140..443a0ee 100644 --- a/packages/boxed/package.json +++ b/packages/boxed/package.json @@ -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", diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index fd229ea..705c4ab 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -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 diff --git a/packages/core/package.json b/packages/core/package.json index 909c58a..4eac344 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -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", diff --git a/packages/effect/CHANGELOG.md b/packages/effect/CHANGELOG.md index d105bfb..befdc31 100644 --- a/packages/effect/CHANGELOG.md +++ b/packages/effect/CHANGELOG.md @@ -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 diff --git a/packages/effect/package.json b/packages/effect/package.json index a1f9170..28cf883 100644 --- a/packages/effect/package.json +++ b/packages/effect/package.json @@ -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", diff --git a/packages/neverthrow/CHANGELOG.md b/packages/neverthrow/CHANGELOG.md index 0ec2c43..482a333 100644 --- a/packages/neverthrow/CHANGELOG.md +++ b/packages/neverthrow/CHANGELOG.md @@ -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 diff --git a/packages/neverthrow/package.json b/packages/neverthrow/package.json index fec7d1c..012665f 100644 --- a/packages/neverthrow/package.json +++ b/packages/neverthrow/package.json @@ -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", diff --git a/packages/oxlint/CHANGELOG.md b/packages/oxlint/CHANGELOG.md index 7c91de4..574cf98 100644 --- a/packages/oxlint/CHANGELOG.md +++ b/packages/oxlint/CHANGELOG.md @@ -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 diff --git a/packages/oxlint/package.json b/packages/oxlint/package.json index 491d831..3fc837b 100644 --- a/packages/oxlint/package.json +++ b/packages/oxlint/package.json @@ -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", diff --git a/packages/standard-schema/CHANGELOG.md b/packages/standard-schema/CHANGELOG.md index 31f995b..4e333aa 100644 --- a/packages/standard-schema/CHANGELOG.md +++ b/packages/standard-schema/CHANGELOG.md @@ -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 diff --git a/packages/standard-schema/package.json b/packages/standard-schema/package.json index 235844e..f4c26c6 100644 --- a/packages/standard-schema/package.json +++ b/packages/standard-schema/package.json @@ -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", diff --git a/packages/vitest/CHANGELOG.md b/packages/vitest/CHANGELOG.md index 28a8f19..fa81568 100644 --- a/packages/vitest/CHANGELOG.md +++ b/packages/vitest/CHANGELOG.md @@ -1,5 +1,7 @@ # @unthrown/vitest +## 5.0.0-beta.9 + ## 5.0.0-beta.8 ## 5.0.0-beta.7 diff --git a/packages/vitest/package.json b/packages/vitest/package.json index 895c61a..b40d30f 100644 --- a/packages/vitest/package.json +++ b/packages/vitest/package.json @@ -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",