Deprecate @unthrown/pattern on npm and publish a 4.x → 5.0 migration note
Summary
@unthrown/pattern was absorbed into core in 5.0 (match / P / tag are now exported from
unthrown itself), but nothing on npm or in the repo says so.
What a consumer sees
@unthrown/patternstops at4.3.0and declares"unthrown": "^4.3.0", so it silently conflicts withunthrown@5.- The npm page carries no deprecation notice.
- There is no changelog or migration note explaining that
tagmoved.
Working out where tag went meant downloading both tarballs and diffing dist/index.d.mts.
Suggested fixes
-
npm deprecate @unthrown/pattern "merged into unthrown@5 — import match/P/tag from 'unthrown'" -
A
MIGRATION.md(or a release note on the 5.0 tag) listing the breaking surface. From the.d.mtsdiff, 4.3.0 → 5.0.0-beta.4 is:Renamed — every Err-channel combinator now takes an exhaustive matcher:
mapErr→mapErrCases,flatMapErr→flatMapErrCases,recoverErr→recoverErrCases,tapErr→tapErrCases,flatTapErr→flatTapErrCases.Removed (the 4.1
@deprecatedaliases):orElse,recover,unwrap,unwrapErr,unwrapOr,unwrapOrElse. AlsomatchTagsand theTagHandlerstype.Renamed export:
UnwrapError→GetError.Changed behaviour, same name:
.match({ err })(handler now receives the matcher — see the separate issue; this one is not caught by the compiler) andgetOrThrow()(now gated to a non-neverErr channel).New:
ensure,DoAsync, and theP/match/tagre-exports.
Having that list up front would have turned step one of the upgrade into a checklist instead of a tarball diff. Happy to open a PR with the migration doc if the list above looks right.
Environment
- upgrading an 18-package monorepo from
[email protected]to5.0.0-beta.4
MIGRATION.md is in the repo now — that's the bigger half, thank you.
The npm side doesn't look done though: @unthrown/pattern still shows no deprecation notice.
$ npm view @unthrown/pattern dist-tags
{ latest: '4.3.0' }
$ npm view @unthrown/[email protected] deprecated
$ # empty
So a consumer who installs unthrown@5 alongside an existing @unthrown/pattern still gets no signal that the package was folded into core — and since @unthrown/[email protected] declares unthrown: ^4.3.0, it will quietly conflict with the v5 they just installed.
$ npm deprecate @unthrown/pattern "merged into unthrown@5 — import match/P/tag from 'unthrown'"
Happy to be told this is deliberate (e.g. you'd rather deprecate at 5.0.0 final) — just flagging that the issue closed with only half of it shipped.