Releases: badgeteam/mch2022-webusb-lib
Releases · badgeteam/mch2022-webusb-lib
v1.2.0: Barely SemVer
🚀 Additions
- Verbose RX/TX debugging
- Can be turned on via
$BadgeAPI.badge.debug.rx = true
/$BadgeAPI.badge.debug.tx = true
- Can be turned on via
✨ Improvements
- RX data is now handled completely asynchronously
- Code readability
- Return type of
BadgeFileSystemApi.list()
is now a discriminated unionFSListing
ofFileListing
andDirListing
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
const $BadgeAPI = new BadgeAPI();
await $BadgeAPI.connect();
$BadgeAPI.badge.debug = {
rx: true,
tx: false,
};
v1.1.1: Stability and logging improvements
🚀 Additions
path
inBadgeAPI.fileSystem.list()
return typeBadgeAPI.onConnect()
hookcrcErrors
inBadgeUSB.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 ✨
Add BadgeAPI.onConnectionLost
v1.0.1: Initial production release 🚀
Bump to v1.0.1
RC2: Fix BadgeUSB.connect()
v1.0.0-RC2 Fix BadgeUSB.connect()
RC1: Test release (fixed CI build) 🚧
RC0: Initial test release 🚧
v1.0.0-RC0 Change package registry to NPM