From 3caefde76eec16866271644080720b117bb71b2d Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Sat, 8 Jan 2022 00:22:32 +0000 Subject: [PATCH] chore(release): 1.2.3 [skip ci] ## [1.2.3](https://github.com/microsoft/jacdac-cli/compare/v1.2.2...v1.2.3) (2022-01-08) ### Bug Fixes * support for transports in devtools ([#1](https://github.com/microsoft/jacdac-cli/issues/1)) ([c97efbd](https://github.com/microsoft/jacdac-cli/commit/c97efbdf2cdc5561c6b2e9a796a0a726e73f1a1f)) --- package.json | 2 +- src/devtools.ts | 20 +++++++++++++------- src/stream.ts | 2 +- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index b23e2fb..a1f148e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jacdac-cli", - "version": "1.2.2", + "version": "1.2.3", "description": "Command line interface for Jacdac", "preferGlobal": true, "main": "./dist/cli.ts", diff --git a/src/devtools.ts b/src/devtools.ts index 2aa1b56..e8a6786 100644 --- a/src/devtools.ts +++ b/src/devtools.ts @@ -21,16 +21,18 @@ const log = console.log const debug = console.debug const error = console.error -export async function devToolsCommand(options?: { - packets?: boolean - internet?: boolean -} & TransportsOptions) { +export async function devToolsCommand( + options?: { + packets?: boolean + internet?: boolean + } & TransportsOptions +) { const { packets, internet } = options || {} const port = 8081 const tcpPort = 8082 const listenHost = internet ? undefined : "127.0.0.1" - const transports = createTransports(options); + const transports = createTransports(options) debug(`starting dev tools...`) log(` dashboard: http://localhost:${port}`) @@ -80,9 +82,13 @@ export async function devToolsCommand(options?: { }) // passive bus to sniff packets - const bus = new JDBus(transports, { client: false, disableRoleManager: true, proxy: true }) + const bus = new JDBus(transports, { + client: false, + disableRoleManager: true, + proxy: true, + }) bus.on(ERROR, e => error(e)) - bus.passive = transports.length === 0; + bus.passive = transports.length === 0 const processPacket = (message: Buffer | Uint8Array, sender: string) => { const data = new Uint8Array(message) diff --git a/src/stream.ts b/src/stream.ts index 194b494..ef83213 100644 --- a/src/stream.ts +++ b/src/stream.ts @@ -20,7 +20,7 @@ export async function streamCommand( } & TransportsOptions = {} ) { if (!options.usb && !options.serial) options.usb = options.serial = true - const transports = createTransports(options); + const transports = createTransports(options) log(`starting bus...`) const bus = new JDBus(transports, { client: false }) if (options.packets)