From b60250318e20cdb5b6c49f20ef7466a272936b96 Mon Sep 17 00:00:00 2001 From: Marko Schulz Date: Tue, 26 Apr 2022 16:16:00 +0200 Subject: [PATCH] Update `nrf-device-lib-js` to 0.4.6 --- Changelog.md | 6 +++ package-lock.json | 44 +++++++++---------- package.json | 4 +- .../DeviceSelector/DeviceSelector.test.tsx | 36 ++++++++++----- src/Device/deviceLister.ts | 9 ---- src/Device/sdfuOperations.ts | 8 ---- 6 files changed, 54 insertions(+), 53 deletions(-) diff --git a/Changelog.md b/Changelog.md index ef5295c57..309a70eb0 100644 --- a/Changelog.md +++ b/Changelog.md @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 6.0.2 - 2022-04-28 + +### Changed + +- Update `nrf-device-lib-js` to 0.4.6. + ## 6.0.1 - 2022-04-11 ### Changed diff --git a/package-lock.json b/package-lock.json index 1a2870ec5..de2a09391 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "pc-nrfconnect-shared", - "version": "6.0.1", + "version": "6.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -3223,9 +3223,9 @@ } }, "@nordicsemiconductor/nrf-device-lib-js": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/@nordicsemiconductor/nrf-device-lib-js/-/nrf-device-lib-js-0.4.4.tgz", - "integrity": "sha512-sFPoDrjUoFUylYfxExW6KBbN2aoKwCG4Tdg6k7nEcwzHwIMuHdE80mi8lydlPF+wpY8Oc/okybbvWFVN+M9ynA==", + "version": "0.4.6", + "resolved": "https://registry.npmjs.org/@nordicsemiconductor/nrf-device-lib-js/-/nrf-device-lib-js-0.4.6.tgz", + "integrity": "sha512-H9Me7p3qIwV9E07AL6xFkznI9XDrX6PrH/6SDZjR8b69XKrH0tkUizZxsxljiIAXERNBHzaSkG4mJHXXWcjrGQ==", "requires": { "cmake-js": "^6.1.0", "fs": "0.0.1-security", @@ -7578,13 +7578,13 @@ } }, "es5-ext": { - "version": "0.10.53", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz", - "integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==", + "version": "0.10.61", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.61.tgz", + "integrity": "sha512-yFhIqQAzu2Ca2I4SE2Au3rxVfmohU9Y7wqGR+s7+H7krk26NXhIRAZDgqd6xqjCEFUomDEA3/Bo/7fKmIkW1kA==", "requires": { - "es6-iterator": "~2.0.3", - "es6-symbol": "~3.1.3", - "next-tick": "~1.0.0" + "es6-iterator": "^2.0.3", + "es6-symbol": "^3.1.3", + "next-tick": "^1.1.0" } }, "es6-error": { @@ -13726,9 +13726,9 @@ "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==" }, "next-tick": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", - "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=" + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", + "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==" }, "nice-try": { "version": "1.0.5", @@ -14247,9 +14247,9 @@ "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" }, "nw-gyp": { - "version": "3.6.5", - "resolved": "https://registry.npmjs.org/nw-gyp/-/nw-gyp-3.6.5.tgz", - "integrity": "sha512-vYrOIYJEKpq9CfaHuiqEjV1rBYgr6uaUrPhPRiznb91LujkAUqGhQ5QqDC1bLdd+zo9jf2H0Zkl2M5zQB7+CuQ==", + "version": "3.6.6", + "resolved": "https://registry.npmjs.org/nw-gyp/-/nw-gyp-3.6.6.tgz", + "integrity": "sha512-FeMnpFQWtEEMJ1BrSfK3T62CjuxaNl0mNHqdrxFcIF5XQdC3gaZYW4n+77lQLk8PE3Upfknkl9VRo6gDKJIHuA==", "requires": { "fstream": "^1.0.0", "glob": "^7.0.3", @@ -15050,9 +15050,9 @@ } }, "prebuild-install": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.0.1.tgz", - "integrity": "sha512-QBSab31WqkyxpnMWQxubYAHR5S9B2+r81ucocew34Fkl98FhvKIF50jIJnNOBmAZfyNV7vE5T6gd3hTVWgY6tg==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.0.tgz", + "integrity": "sha512-CNcMgI1xBypOyGqjp3wOc8AAo1nMhZS3Cwd3iHIxOdAUbb+YxdNuM4Z5iIrZ8RLvOsf3F3bl7b7xGq6DjQoNYA==", "requires": { "detect-libc": "^2.0.0", "expand-template": "^2.0.3", @@ -15112,9 +15112,9 @@ } }, "node-abi": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.8.0.tgz", - "integrity": "sha512-tzua9qWWi7iW4I42vUPKM+SfaF0vQSLAm4yO5J83mSwB7GeoWrDKC/K+8YCnYNwqP5duwazbw2X9l4m8SC2cUw==", + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.15.0.tgz", + "integrity": "sha512-Ic6z/j6I9RLm4ov7npo1I48UQr2BEyFCqh6p7S1dhEx9jPO0GPGq/e2Rb7x7DroQrmiVMz/Bw1vJm9sPAl2nxA==", "requires": { "semver": "^7.3.5" } diff --git a/package.json b/package.json index e896fde0a..c7f3e0ad1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pc-nrfconnect-shared", - "version": "6.0.1", + "version": "6.0.2", "description": "Shared commodities for developing pc-nrfconnect-* packages", "repository": { "type": "git", @@ -36,7 +36,7 @@ "@babel/preset-typescript": "7.16.7", "@electron/remote": "^2.0.4", "@mdi/font": "3.9.97", - "@nordicsemiconductor/nrf-device-lib-js": "0.4.4", + "@nordicsemiconductor/nrf-device-lib-js": "0.4.6", "@reduxjs/toolkit": "1.8.0", "@svgr/webpack": "5.5.0", "@swc/core": "1.2.148", diff --git a/src/Device/DeviceSelector/DeviceSelector.test.tsx b/src/Device/DeviceSelector/DeviceSelector.test.tsx index 2888b0b40..c52d69dba 100644 --- a/src/Device/DeviceSelector/DeviceSelector.test.tsx +++ b/src/Device/DeviceSelector/DeviceSelector.test.tsx @@ -19,6 +19,30 @@ import DeviceSelector from './DeviceSelector'; jest.mock('../sdfuOperations', () => ({})); const testDevice: Device = { + id: 1, + hwInfo: { + romSize: 123, + ramSize: 456, + romPageSize: 789, + deviceFamily: 'PCATest', + deviceVersion: 'PCATest', + }, + broken: null, + usb: { + serialNumber: '000000001', + manufacturer: 'testManufacturer', + product: 'testProduct', + device: { + busNumber: 2, + address: 3, + descriptor: { + bDescriptorType: 4, + idVendor: 5, + idProduct: 6, + }, + configurations: [], + }, + }, serialNumber: '000000001', serialPorts: [ { @@ -56,7 +80,6 @@ const testDevice: Device = { comName: 'COM1', }, favorite: false, - // @ts-expect-error The DeviceTraits type was wrong, but will be fixed by https://github.com/NordicPlayground/nrf-device-lib-js/pull/104 traits: { jlink: true, }, @@ -83,7 +106,6 @@ describe('DeviceSelector', () => { it('should have no device selected by default', () => { const { getByText } = render( { it('should show no connected devices', () => { const { getByText } = render( { it('should list connected devices', () => { const { getByText } = render( { it('should unlist disconnected devices', () => { const { queryByText } = render( { it('should show more device info when selecting the expand button', () => { const { getByText, getByTestId, getAllByText } = render( { it('can select connected devices', () => { const { getAllByText, getByText } = render( { it('can deselect selected devices', async () => { const { getAllByText, getByText, findByTestId, getByTestId } = render( { it('should allow device selection when custom devices are enabled and no valid firmware is defined', () => { const { queryByText, getAllByText, getByText } = render( { it('should deselect device when custom devices are disabled and no valid firmware is defined', async () => { const { getByText, getAllByText, queryByText } = render( { it('should show firmware prompt when a valid firmware is defined', async () => { const { getByText } = render( { it('should select device when cancelling firmware prompt', async () => { const { getByText, getAllByText, findByText } = render( { } }; -// @ts-expect-error This is how the nrfdl-js api works at the moment. const DEFAULT_TRAITS: DeviceTraits = { serialPort: true, - // usb: false, - // nordicUsb: false, - // nordicDfu: false, - // seggerUsb: false, - // jlink: false, - // broken: false, - // mcuboot: false, - // modem: false, }; /** diff --git a/src/Device/sdfuOperations.ts b/src/Device/sdfuOperations.ts index 09a7829a7..04cc9a44a 100644 --- a/src/Device/sdfuOperations.ts +++ b/src/Device/sdfuOperations.ts @@ -427,17 +427,9 @@ const prepareInDFUBootloader = async ( ) ); - // @ts-expect-error This is how the nrfdl-js api works at the moment. return waitForDevice(device.serialNumber, DEFAULT_DEVICE_WAIT_TIME, { serialPort: true, nordicUsb: true, - // broken: false, - // jlink: false, - // mcuboot: false, - // modem: false, - // nordicDfu: false, - // seggerUsb: false, - // usb: false, }); };