Skip to content

fix(deps): update dependency emittery to v2 - #52

Open
renovate[bot] wants to merge 1 commit into
0.xfrom
renovate/emittery-2.x
Open

renovate[bot] wants to merge 1 commit into
0.xfrom
renovate/emittery-2.x

Conversation

@renovate

@renovate renovate Bot commented Mar 16, 2026 •

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
emittery ^1.2.1 → ^2.1.0 age confidence

Release Notes

sindresorhus/emittery (emittery)

v2.1.0

Compare Source

Improvements
  • Improve TypeScript types cf2297d
    • Emittery.mixin() now returns a class type that includes the emittery property and the mixed-in methods
    • The iterators from .events() and .anyEvent() now type next() and return() precisely, instead of any
    • Emittery.listenerAdded and Emittery.listenerRemoved are now accepted everywhere the runtime accepts them, like .on(), .events(), and .listenerCount()
    • .emit() without data now works on an untyped emitter
    • .bindMethods() now accepts any object, including a class instance
    • methodNames for Emittery.mixin() and .bindMethods() now only accepts real method names. A list typed as string[] needs as const or the new EmitteryMethodName type.
Fixes
  • Fix async iterators hanging forever when next() is called concurrently 7157da9
  • Fix a rejected event data promise causing an unhandled rejection when an iterator never reads it 7157da9
    • A rejection that is read now throws from the iteration and closes the iterator, so a for await loop cannot leave the subscription behind.
  • Fix .clearListeners() with one event name ending an .events() iterator that listens to several events 7157da9
  • Fix .anyEvent() yielding the internal listenerAdded and listenerRemoved events 7157da9
  • Fix listenerAdded and listenerRemoved firing when nothing changed 4987e5f
    • For example, for a duplicate .on(), a repeated .off(), or .off() of a listener that was never added.
  • Fix .off() with several event names stopping at the first error and leaving the rest subscribed 4987e5f
  • Fix .offAny() not removing the listener when the debug logger throws 4987e5f
  • Fix the unsubscribe function from .on() changing when the event name array is mutated afterwards 4987e5f
  • Fix .clearListeners() removing every listener when given an invalid event name 51d4812
    • It now throws a TypeError. Only undefined means "all events".
  • Fix instances created from the same debug options object sharing their debug settings 5b47694
    • The options are now copied. To toggle logging after construction, set emitter.debug.enabled instead of changing the object you passed in.
  • Fix .emit() in environments without iterator helpers 4de0d10
  • Fix Emittery.mixin() silently overwriting an existing property with the same name as the emittery property 3702d31

v2.0.0

Compare Source

Breaking Changes
Listeners now receive a unified {name, data} object instead of raw data

All listeners (.on(), .onAny(), .once(), async iterators) now receive a single event object with name and data properties instead of the raw event data.

- emitter.on('🦄', data => {
-   console.log(data);
+ emitter.on('🦄', ({data}) => {
+   console.log(data);
  });

For .onAny():

- emitter.onAny((eventName, eventData) => {
-   console.log(eventName, eventData);
+ emitter.onAny(({name, data}) => {
+   console.log(name, data);
  });

For .once():

- const data = await emitter.once('🦄');
+ const {data} = await emitter.once('🦄');

For .events() and .anyEvent() async iterators:

- for await (const data of emitter.events('🦄')) {
+ for await (const {data} of emitter.events('🦄')) {
    console.log(data);
  }

- for await (const [eventName, eventData] of emitter.anyEvent()) {
+ for await (const {name, data} of emitter.anyEvent()) {
    …
  }

For predicates in .once():

- emitter.once('data', data => data.ok === true);
+ emitter.once('data', ({data}) => data.ok === true);
emit() now throws AggregateError instead of rejecting with a single error

When multiple listeners throw, emit() now collects all errors into an AggregateError instead of silently dropping errors after the first one. All listeners always run to completion.

  try {
    await emitter.emit('event');
  } catch (error) {
-   // error was from the first listener that threw
+   // error is an AggregateError with all listener errors in error.errors
+   console.log(error.errors);
  }
Requires Node.js 22

The minimum required Node.js version is now 22 (previously 14.16).

New Features
  • init/deinit lifecycle hooks - Register setup/teardown logic that runs when the first listener subscribes and the last listener unsubscribes for a given event.
  • Disposable support - Unsubscribe functions from .on() and .onAny() are now Disposable (usable with using for automatic cleanup).
  • AsyncDisposable support - Async iterators from .events() and .anyEvent() are now AsyncDisposable (usable with await using).
  • AbortSignal support for .events(), .anyEvent(), and .once() - Pass {signal} to cancel subscriptions externally.
  • .once() options object - Accepts {predicate, signal} in addition to a plain predicate function.
  • TC39 standard decorator support - Emittery.mixin() now works with both legacy and TC39 standard decorator syntax.
Bug Fixes
  • emit() no longer silently drops errors from multiple listeners
  • Debug logger no longer emits noise for internal meta events
  • Fixed emitMetaEvent breaking async emit() overrides in subclasses
  • Fixed Emittery not working when wrapped in a Proxy
  • Fixed mixin decorator to work with TC39 standard decorator syntax


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • Between 12:00 AM and 03:59 AM, only on Monday (* 0-3 * * 1)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate
renovate Bot force-pushed the renovate/emittery-2.x branch from 0aec56d to cb47a2e Compare April 10, 2026 07:39
@renovate
renovate Bot force-pushed the renovate/emittery-2.x branch 3 times, most recently from 3d67b67 to acf44bb Compare September 25, 2026 22:01
@renovate
renovate Bot force-pushed the renovate/emittery-2.x branch from acf44bb to b6f705a Compare September 26, 2026 15:08
@renovate

renovate Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author

⚠️ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: yarn.lock
! Corepack is about to download https://repo.yarnpkg.com/4.18.1/packages/yarnpkg-cli/bin/yarn.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants