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](c97efbdf2c))
This commit is contained in:
semantic-release-bot 2022-01-08 00:22:32 +00:00
Родитель c97efbdf2c
Коммит 3caefde76e
3 изменённых файлов: 15 добавлений и 9 удалений

Просмотреть файл

@ -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",

Просмотреть файл

@ -21,16 +21,18 @@ const log = console.log
const debug = console.debug
const error = console.error
export async function devToolsCommand(options?: {
export async function devToolsCommand(
options?: {
packets?: boolean
internet?: boolean
} & TransportsOptions) {
} & 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)

Просмотреть файл

@ -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)