Skip to content

Releases: badgeteam/mch2022-webusb-lib

v1.2.0: Barely SemVer

06 Apr 17:13
Compare
Choose a tag to compare

🚀 Additions

  • Verbose RX/TX debugging
    • Can be turned on via $BadgeAPI.badge.debug.rx = true / $BadgeAPI.badge.debug.tx = true

✨ Improvements

  • RX data is now handled completely asynchronously
  • Code readability
  • Return type of BadgeFileSystemApi.list() is now a discriminated union FSListing of FileListing and DirListing to allow type narrowing

⚠️ Breaking change ⚠️

The type export FileListing of api/filesystem has been renamed to FSListing. The new export FileListing only represents actual files instead of both files and folders, and is complemented by DirListing. FSListing is a union of FileListing and DirListing. This allows type narrowing when consuming an FSListing, e.g. from BadgeAPI.fileSystem.list():

const items = await $BadgeAPI.fileSystem.list('/internal');
items.forEach(item => {
  if (item.type == 'file') {
    /* type of `item` is narrowed to FileListing */
  }
  else {
    /* type of `item` narrowed to DirListing */
  }
})

v1.1.3: RX/TX debug

04 Apr 22:22
Compare
Choose a tag to compare
const $BadgeAPI = new BadgeAPI();

await $BadgeAPI.connect();
$BadgeAPI.badge.debug = {
  rx: true,
  tx: false,
};

v1.1.1: Stability and logging improvements

01 Apr 07:29
Compare
Choose a tag to compare

🚀 Additions

  • path in BadgeAPI.fileSystem.list() return type
  • BadgeAPI.onConnect() hook
  • crcErrors in BadgeUSB.connectionStats

✨ Improvements

  • BadgeUSB.transaction()
    • Implemented transaction queueing
    • Fixed error call stacks
    • Much better debug logging
    • Error response decoding with BadgeUSBError

⚠️ Breaking change ⚠️

BadgeAPI.onConnectionLost is a callable function now instead of a setter.
This is in order to allow setting multiple callbacks.

Before:

badgeApi.onConnect = () => {
  /* callback */
}

After:

badgeApi.onConnect(() => {
  /* callback */
});

v1.0.2: BadgeAPI.onConnectionLost ✨

30 Mar 18:53
Compare
Choose a tag to compare
Add BadgeAPI.onConnectionLost

v1.0.1: Initial production release 🚀

30 Mar 18:22
Compare
Choose a tag to compare

RC2: Fix BadgeUSB.connect()

30 Mar 12:37
Compare
Choose a tag to compare
v1.0.0-RC2

Fix BadgeUSB.connect()

RC1: Test release (fixed CI build) 🚧

RC0: Initial test release 🚧

29 Mar 21:19
Compare
Choose a tag to compare
Pre-release
v1.0.0-RC0

Change package registry to NPM