Skip to content

Releases: jeromeludmann/deno-irc

v0.8.1

07 Feb 21:32
Compare
Choose a tag to compare

Fixes

Mode Setting Formats

Some MODE message formats are not properly parsed.

Following variants are now supported:

MODE #channel +bme *!*@host someone!user@host

MODE #channel +b *!*@host -m +e someone!user@host

Coverage

Missing test cases have been added and coverage now reaches 100% for core and plugins parts.

To generate the coverage report:

make test-coverage

HTML report:

make test-coverage-html

v0.8.0

06 Feb 12:13
Compare
Choose a tag to compare

More Granular Raw Events

The client can now subscribe to more granular raw events.

For instance, instead of doing:

client.on("raw", (msg) => {
  if (msg.command === "join") {
    // ...
  }
});

client.on("raw", (msg) => {
  if (msg.command === "rpl_topic") {
    // ...
  }
});

it is now possible to just write:

client.on("raw:join", (msg) => {
  // ...
});

client.on("raw:rpl_topic", (msg) => {
  // ...
});

The previous raw event name keeps the same behavior:

client.on("raw", (msg) => {
  // all the raw events
});

But internally, it now translate into all the available raw events:

client.on([
  "raw:admin", "raw:cap", "raw:connect", // ...
  "raw:rpl_welcome", "raw:rpl_yourhost", "raw:rpl_created", // ...
  "raw:err_unknownerror", "raw:err_nosuchnick", "raw:err_nosuchnick", // ...
], (msg) => {
  // all the raw events
});

Multi Events Subscribing

Event emitter allow to listen more than one event.

Example from plugins/nicklist:

client.on(["part", "kick", "quit", "kill"], (msg) => {
  const { source, params } = msg; // msg is PartEvent | KickEvent | QuitEvent | KillEvent

  const nick = "nick" in params ? params.nick : source?.name;
  const channel = "channel" in params ? params.channel : undefined;

  if (nick !== undefined) {
    removeNick(nick, channel);
  }
});

Allowing to listen to several events at a time can be handy in some specific cases.

Supported Server Feature Events

Events related to supported server features are now emitted:

  • isupport:chanmodes and isupport:prefix (used by plugins/chanmodes to handle channel modes aspects)
  • isupport:chantypes (used by plugins/chantypes to provide some helpers like client.utils.isChannel)
  • isupport:usermodes

They are mainly used to offer a way to be aware of the server features and allow client to update its own behavior.

Client Helpers

client.utils contains some convenient methods based on supported server features.

Following have been added:

  • client.utils.isChannel (previously imported from core/strings)
  • client.utils.isCtcp (previously imported from plugins/ctcp)
  • client.utils.createCtcp (previously imported from plugins/ctcp)

v0.7.0

30 Jan 16:44
Compare
Choose a tag to compare

Fixes

Nicklist

Add missing NICK support to track nick changes in plugins/nicklist.

BREAKING CHANGES

Each message contains now source and params object.

  • source object is optional and replaces the old origin key. It contains name key (containing the user nick or the server host). It may also contain an optional mask object, containing user name and host name (only if the source refers to a user).

  • params object contains all the existing previous message keys, except the source object.

Example with privmsg event:

client.on("privmsg", (msg) => {
  const { source, params } = msg;

  if (!source) {
    return;
  }

  if (source.name === "nick") {
    client.privmsg(params.target, `Hello ${source.name}!`);
  }
});

Internal

Plugin Dependencies

Plugins resolve their dependencies first before to load themselves.

It allows to prevent a plugin which depends on another plugins to be loaded before them. It also improves plugin internal API by providing plugin factory from core/plugins.ts.

Potential circular dependencies will be prevented thanks to type checking.

Testing

Plugin unit tests use the full featured client constructor in order to have a more representative context of testing.

v0.6.1

16 Jan 21:31
Compare
Choose a tag to compare

Fixes:

  • fix case where MODE messages coming from server crashes the client

v0.6.0

16 Jan 20:49
Compare
Choose a tag to compare

Features:

  • plugins/nicklist: 'nicklist' event to keep nicklists up to date
  • plugins/names: used by plugins/nicklist, with multi-prefix capability
  • plugins/mode: user and channel modes management
  • plugins/isupport: supported features by the server
  • plugins/list: a way to retrieve the entire channel list, see #5
  • plugins/err_reply: convenient way to handle all ERR_ error replies

Internal:

  • capability requesting management on connect in plugins/registration
  • deleteProperty trap added and beforeMutate is now recursive in core/hooks
  • massive renaming to be more understandable

BREAKING CHANGES:

  • plugins/registration: put user data into user state
  • plugins/myinfo: put server data into server state

v0.5.1

04 Oct 10:03
Compare
Choose a tag to compare

Fixes:

  • fix #3 error: Uncaught (in promise) Interrupted: operation canceled on client.quit()

v0.5.0

29 Aug 16:18
Compare
Choose a tag to compare

Features:

v0.4.1

06 Jan 18:08
Compare
Choose a tag to compare

Internal features:

  • add and expose core/hooks feature to plugin parts

Fixes:

  • plugins/join: do not allow calling join() without channel
  • plugins/reconnect: throw on connect without existing error listener
  • plugins/verbose: stringify raw messages
  • plugins/oper_on_register: restore missing test

Refactoring:

  • core/client: preserve stack trace of thrown errors
  • core/events: change visibility of resetErrorThrowingBehavior() and count()

v0.4.0

21 Dec 19:57
Compare
Choose a tag to compare

Features:

  • add plugins/reconnect
  • allow join() command to take channel keys
  • add maxListeners option to avoid infinite loops caused by too many listeners

Fixes:

  • close link with server after using quit() and prevent error to be thrown

Refactoring:

  • rewrite plugin internal management

v0.3.0

27 Nov 17:27
Compare
Choose a tag to compare

Error handling:

  • rewrite error throwing behavior (BREAKING CHANGE)
  • merge "error:client" and "error:server" to "error"

Behavior changes:

  • resolve connect() with Deno.Conn when connected
  • remove listener on "disconnected" in disconnect()
  • remove the nick key from "myinfo" event payload
  • rename event "raw:ctcp" to "ctcp"

Improvements:

  • improve plugins/verbose (previously plugins/debug)

Internal:

  • rewrite tests using new mocks (see testing folder)