Skip to content

chore: release packages (beta)#110

Merged
btravers merged 1 commit into
mainfrom
changeset-release/main
Jul 25, 2026
Merged

chore: release packages (beta)#110
btravers merged 1 commit into
mainfrom
changeset-release/main

Conversation

@btravers

@btravers btravers commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

⚠️⚠️⚠️⚠️⚠️⚠️

main is currently in pre mode so this branch has prereleases rather than normal releases. If you want to exit prereleases, run changeset pre exit on main.

⚠️⚠️⚠️⚠️⚠️⚠️

Releases

unthrown@5.0.0-beta.0

Major Changes

  • 284b7be: The error channel is now matched exhaustively with ts-pattern (Thesis chore: migrate repo + docs URLs to btravstack org #5).
    The error combinators — mapErr, flatMapErr, recoverErr, tapErr,
    flatTapErr — no longer take a plain callback. Their callback receives a
    ts-pattern match builder over the error (match(error)) plus the injected
    defect helper, and returns the un-terminated builder — the combinator
    calls .exhaustive() for you:

    import { P, tag } from "unthrown";
    
    // before
    result.mapErr((error) => {
      if (error._tag === "RecordNotFound") return new NotFoundException(id);
      throw error.cause; // silent fallthrough — a future tag lands here unnoticed
    });
    
    // after — exhaustive; the type checker forces every case to be handled
    result.mapErr((matcher, defect) =>
      matcher
        .with(tag("RecordNotFound"), () => new NotFoundException(id))
        .with(tag("DriverError"), (e) => defect(e.cause))
    );

    The matcher callback parameter is named matcher (not m).

    Every error is handled explicitly, and enriching the error channel is a
    compile error at every consuming site
    until each new case is handled. Because
    the combinator runs .exhaustive(), a missing case does not compile — there is
    no .exhaustive() to forget and no .otherwise() to smuggle in a fallback.

    • Match on anything ts-pattern supports_tag, a code-discriminated
      union (the oRPC shape), structural shapes, guards, and grouped patterns
      (.with(a, b, handler) — one strategy for several cases). tag("X") is sugar
      for the { _tag: "X" } pattern.
    • P._ is the deliberate catch-all — the uniform "handle everything else"
      branch that replaces the old single callback, made explicit and greppable.
    • Each branch receives the narrowed variant and the injected defect helper
      (.with(tag("X"), (e) => defect(e.cause))); its Defect arm is subtracted
      from the outgoing E (Exclude<O, Defect>, the boundary inference). A
      throwing branch also becomes a Defect (the safety net).
    • Observers match exhaustively too (tapErr/flatTapErr, use P._ for a
      catch-all); the error is observed and flows through unchanged.

    Core now depends on ts-pattern (a small, types-heavy, dual-copy-safe
    library), and re-exports match and P, plus tag — so the matcher, and
    matching a whole Result (match(r).with(P.Ok(), …)), are first-class in one
    import. The @unthrown/pattern package is removed — its tag helper moved
    into core; the P.Ok/P.Err/P.Defect sugar is dropped (match the union
    structurally instead).

    match now matches the error channel exhaustively too, and matchTags is
    removed.
    match's err handler no longer takes a blanket (error) => R
    callback — it receives the same ts-pattern matcher and returns the un-terminated
    builder (no defect helper: match folds to a value, with no Defect output
    channel). This subsumes the old matchTags fold — a per-tag fold over a tagged
    union is now match with the matcher and tag(t), and it generalises to any
    discriminant, not only _tag:

    import { P, tag } from "unthrown";
    
    // before
    matchTags(result, {
      Ok: (n) => `got ${n}`,
      Defect: (cause) => `bug: ${String(cause)}`,
      NotFound: () => "404",
      Forbidden: (e) => `403 for ${e.user}`,
    });
    
    // after
    result.match({
      ok: (n) => `got ${n}`,
      defect: (cause) => `bug: ${String(cause)}`,
      err: (matcher) =>
        matcher
          .with(tag("NotFound"), () => "404")
          .with(tag("Forbidden"), (e) => `403 for ${e.user}`),
    });

    Use .with(P._, …) for a uniform catch-all. matchTags and its TagHandlers
    type are gone; TaggedError and tag are unchanged. Library code generic in
    the error type E
    (which ts-pattern can't prove exhaustive over an unresolved
    type parameter) should fold with the isOk / isErr / isDefect guards
    instead of match.

    Also breaking: the deprecated error-channel aliases orElse and recover
    are removed; the extractor aliases (unwrap, unwrapErr, unwrapOr,
    unwrapOrElse) remain. AsyncOkOf / AsyncErrOf now infer through the
    awaitable channel only (same results for ordinary AsyncResult types).

  • a1f68d5: The extractor family is spelled only get…, and getOrThrow is now gated.

    The deprecated unwrap* aliases are removedunwrap, unwrapErr,
    unwrapOr, unwrapOrElse (they were runtime-identical delegates). Rename to
    their replacements:

    result.unwrap(); // → result.get()
    result.unwrapErr(); // → result.getErr()
    result.unwrapOr(v); // → result.getOr(v)
    result.unwrapOrElse(f); // → result.getOrElse(f)

    getOrThrow is now type-gated as the complement of get. It compiles only
    when the error channel is non-empty (E is not never) — there must be a
    modeled error for it to throw. On a Result<T, never> there is nothing to
    throw, so use get() (which gates the other way). Together they partition
    extraction by the error channel's state:

    declare const fallible: Result<number, "e">;
    declare const total: Result<number, never>;
    
    fallible.getOrThrow(); // ok — throws "e" on Err
    fallible.get(); // ✗ compile error — error channel not empty
    total.get(); // ok
    total.getOrThrow(); // ✗ compile error — nothing to throw; use get()

    UnwrapError is renamed to GetError — it is what the get… extractors
    throw on a wrong-variant access, so it now lives in the get register (its
    message no longer says "unwrap" either). It is unreachable through well-typed
    code (only a cast or JS caller reaches it), so most callers never name it; those
    that instanceof/catch it do a one-line rename.

    Also: the aggregates are hardened against out-of-contract input (only reachable
    via untyped/cast code). allAsync / allFromDictAsync adopt each input
    defensively (a rejecting thenable becomes a Defect instead of rejecting the
    internal promise), and all four aggregates now surface a non-Result element (a
    hole/undefined) as a Defect rather than throwing on .tag (sync) or
    rejecting (async) — upholding "an AsyncResult's internal promise never rejects"
    for every input.

Patch Changes

  • 3b06099: Adopt @btravstack/tsconfig@0.2.0 (verbatimModuleSyntax), @btravstack/oxlint@0.2.1 (consistent-type-imports), and @btravstack/lefthook.
  • 4096713: Remove the local tools/tsconfig / tools/typedoc packages and consume the published @btravstack/tsconfig / @btravstack/typedoc config directly (every package now extends @btravstack/* and takes it from the catalog).

@unthrown/boxed@5.0.0-beta.0

Patch Changes

  • Updated dependencies [3b06099]
  • Updated dependencies [284b7be]
  • Updated dependencies [4096713]
  • Updated dependencies [a1f68d5]
    • unthrown@5.0.0-beta.0

@unthrown/effect@5.0.0-beta.0

Patch Changes

  • Updated dependencies [3b06099]
  • Updated dependencies [284b7be]
  • Updated dependencies [4096713]
  • Updated dependencies [a1f68d5]
    • unthrown@5.0.0-beta.0

@unthrown/neverthrow@5.0.0-beta.0

Patch Changes

  • Updated dependencies [3b06099]
  • Updated dependencies [284b7be]
  • Updated dependencies [4096713]
  • Updated dependencies [a1f68d5]
    • unthrown@5.0.0-beta.0

@unthrown/orpc@0.1.1-beta.0

Patch Changes

  • 3b06099: Adopt @btravstack/tsconfig@0.2.0 (verbatimModuleSyntax), @btravstack/oxlint@0.2.1 (consistent-type-imports), and @btravstack/lefthook.
  • 4096713: Remove the local tools/tsconfig / tools/typedoc packages and consume the published @btravstack/tsconfig / @btravstack/typedoc config directly (every package now extends @btravstack/* and takes it from the catalog).
  • Updated dependencies [3b06099]
  • Updated dependencies [284b7be]
  • Updated dependencies [4096713]
  • Updated dependencies [a1f68d5]
    • unthrown@5.0.0-beta.0

@unthrown/prisma@0.1.1-beta.0

Patch Changes

  • 3b06099: Adopt @btravstack/tsconfig@0.2.0 (verbatimModuleSyntax), @btravstack/oxlint@0.2.1 (consistent-type-imports), and @btravstack/lefthook.
  • 4096713: Remove the local tools/tsconfig / tools/typedoc packages and consume the published @btravstack/tsconfig / @btravstack/typedoc config directly (every package now extends @btravstack/* and takes it from the catalog).
  • Updated dependencies [3b06099]
  • Updated dependencies [284b7be]
  • Updated dependencies [4096713]
  • Updated dependencies [a1f68d5]
    • unthrown@5.0.0-beta.0

@unthrown/standard-schema@5.0.0-beta.0

Patch Changes

  • Updated dependencies [3b06099]
  • Updated dependencies [284b7be]
  • Updated dependencies [4096713]
  • Updated dependencies [a1f68d5]
    • unthrown@5.0.0-beta.0

@unthrown/vitest@5.0.0-beta.0

Patch Changes

  • Updated dependencies [3b06099]
  • Updated dependencies [284b7be]
  • Updated dependencies [4096713]
  • Updated dependencies [a1f68d5]
    • unthrown@5.0.0-beta.0

@unthrown/oxlint@5.0.0-beta.0

Copilot AI review requested due to automatic review settings July 24, 2026 07:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Release PR generated by Changesets to publish the next patch versions of the unthrown core package and its satellite packages. This aligns the repository state (package versions + changelogs) with the release notes derived from recent changesets, so npm publishing can proceed on merge.

Changes:

  • Bump package versions for unthrown and related @unthrown/* packages (4.3.1 / 0.1.1).
  • Update package changelogs to include the new release entries.
  • Remove consumed changeset markdown files after versioning.

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/core/package.json Bump unthrown version to 4.3.1.
packages/core/CHANGELOG.md Add 4.3.1 release notes (tsconfig/typedoc tooling adoption notes).
packages/boxed/package.json Bump @unthrown/boxed version to 4.3.1.
packages/boxed/CHANGELOG.md Add 4.3.1 entry noting updated dependency on unthrown@4.3.1.
packages/effect/package.json Bump @unthrown/effect version to 4.3.1.
packages/effect/CHANGELOG.md Add 4.3.1 entry noting updated dependency on unthrown@4.3.1.
packages/neverthrow/package.json Bump @unthrown/neverthrow version to 4.3.1.
packages/neverthrow/CHANGELOG.md Add 4.3.1 entry noting updated dependency on unthrown@4.3.1.
packages/pattern/package.json Bump @unthrown/pattern version to 4.3.1.
packages/pattern/CHANGELOG.md Add 4.3.1 entry noting updated dependency on unthrown@4.3.1.
packages/standard-schema/package.json Bump @unthrown/standard-schema version to 4.3.1.
packages/standard-schema/CHANGELOG.md Add 4.3.1 entry noting updated dependency on unthrown@4.3.1.
packages/vitest/package.json Bump @unthrown/vitest version to 4.3.1.
packages/vitest/CHANGELOG.md Add 4.3.1 release header entry.
packages/oxlint/package.json Bump @unthrown/oxlint version to 4.3.1.
packages/oxlint/CHANGELOG.md Add 4.3.1 release header entry.
packages/orpc/package.json Bump @unthrown/orpc version to 0.1.1.
packages/orpc/CHANGELOG.md Add 0.1.1 entry including tooling adoption notes + dependency update to unthrown@4.3.1.
packages/prisma/package.json Bump @unthrown/prisma version to 0.1.1.
packages/prisma/CHANGELOG.md Add 0.1.1 entry including tooling adoption notes + dependency update to unthrown@4.3.1.
.changeset/adopt-btravstack-0.2.md Remove consumed changeset after versioning.
.changeset/remove-tools-packages.md Remove consumed changeset after versioning.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@btravers
btravers force-pushed the changeset-release/main branch 2 times, most recently from 6f9b61f to 51f4500 Compare July 24, 2026 10:38
@btravers btravers changed the title chore: release packages chore: release packages (beta) Jul 25, 2026
@btravers
btravers force-pushed the changeset-release/main branch from 51f4500 to 8a0c5d6 Compare July 25, 2026 11:53
@btravers
btravers merged commit 0f0cd7a into main Jul 25, 2026
14 checks passed
@btravers
btravers deleted the changeset-release/main branch July 25, 2026 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants