@nordicsemiconductor/pc-nrfconnect-shared 230.0.0 → 231.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Changelog.md +1669 -1674
- package/README.md +8 -8
- package/config/colors.js +1 -1
- package/config/eslintrc.js +16 -5
- package/config/jest.config.js +1 -1
- package/ipc/MetaFiles.ts +2 -2
- package/ipc/README.md +14 -14
- package/ipc/appDetails.ts +1 -1
- package/ipc/apps.ts +5 -5
- package/ipc/infrastructure/mainToRenderer.ts +3 -3
- package/ipc/infrastructure/rendererToMain.ts +5 -5
- package/ipc/open.ts +2 -2
- package/ipc/safeStorage.ts +2 -2
- package/ipc/schema/packageJson.ts +1 -1
- package/ipc/serialPort.ts +2 -2
- package/mocks/electronStoreMock.ts +1 -1
- package/nrfutil/collectingResultParser.ts +3 -4
- package/nrfutil/device/batch.ts +29 -29
- package/nrfutil/device/boardController.ts +2 -2
- package/nrfutil/device/common.ts +6 -6
- package/nrfutil/device/deviceInfo.ts +3 -3
- package/nrfutil/device/erase.ts +2 -2
- package/nrfutil/device/getBoardControllerConfig.ts +2 -2
- package/nrfutil/device/getBoardControllerVersion.ts +2 -2
- package/nrfutil/device/getCoreInfo.ts +2 -2
- package/nrfutil/device/getFwInfo.ts +2 -2
- package/nrfutil/device/getProtectionStatus.ts +2 -2
- package/nrfutil/device/list.ts +2 -2
- package/nrfutil/device/logLibVersions.ts +7 -7
- package/nrfutil/device/program.ts +11 -11
- package/nrfutil/device/recover.ts +2 -2
- package/nrfutil/device/reset.ts +2 -2
- package/nrfutil/device/setMcuState.ts +2 -2
- package/nrfutil/device/setProtectionStatus.ts +2 -2
- package/nrfutil/device/xRead.ts +2 -2
- package/nrfutil/modules.ts +9 -9
- package/nrfutil/sandbox.ts +49 -49
- package/nrfutil/version/jlinkVersion.test.ts +34 -34
- package/nrfutil/version/jlinkVersion.ts +7 -7
- package/nrfutil/version/moduleVersion.ts +7 -7
- package/nrfutil/version/version.ts +3 -3
- package/package.json +7 -7
- package/release_notes.md +21 -3
- package/scripts/check-app-properties.ts +12 -12
- package/scripts/check-for-typescript.ts +2 -2
- package/scripts/create-source.ts +2 -2
- package/scripts/esbuild-renderer.ts +8 -8
- package/scripts/esbuild.ts +2 -2
- package/scripts/get-release-numbers.ts +1 -1
- package/scripts/is-releasable.ts +3 -3
- package/scripts/nordic-publish.ts +34 -34
- package/scripts/nrfconnect-license.ts +6 -6
- package/scripts/prepare-shared-release.ts +10 -10
- package/src/About/Feedback.tsx +3 -3
- package/src/About/SupportCard.tsx +1 -1
- package/src/App/App.test.tsx +1 -1
- package/src/App/App.tsx +3 -3
- package/src/App/VisibilityBar.tsx +1 -1
- package/src/App/appLayout.ts +12 -12
- package/src/Button/Button.tsx +1 -1
- package/src/ConfirmBeforeClose/ConfirmCloseDialog.tsx +1 -1
- package/src/ConfirmBeforeClose/confirmBeforeCloseSlice.ts +5 -5
- package/src/Device/DeviceSelector/DeviceList/Device.tsx +2 -2
- package/src/Device/DeviceSelector/DeviceList/DeviceList.tsx +3 -3
- package/src/Device/DeviceSelector/DeviceList/VirtualDevices.tsx +2 -2
- package/src/Device/DeviceSelector/DeviceSelector.test.tsx +16 -16
- package/src/Device/DeviceSelector/DeviceSelector.tsx +13 -13
- package/src/Device/DeviceSelector/Favorite.tsx +1 -1
- package/src/Device/DeviceSelector/SelectDevice.tsx +1 -1
- package/src/Device/DeviceSetup/DeviceSetupView.tsx +1 -1
- package/src/Device/deviceAutoSelectSlice.ts +5 -5
- package/src/Device/deviceInfo/deviceInfo.ts +2 -2
- package/src/Device/deviceLister.test.ts +4 -4
- package/src/Device/deviceLister.ts +49 -51
- package/src/Device/deviceSetup.ts +27 -26
- package/src/Device/deviceSetupSlice.ts +2 -2
- package/src/Device/deviceSlice.ts +17 -17
- package/src/Device/initPacket.ts +13 -13
- package/src/Device/jprogOperations.ts +11 -11
- package/src/Device/sdfuOperations.ts +47 -47
- package/src/Dropdown/Dropdown.test.tsx +3 -3
- package/src/Dropdown/Dropdown.tsx +6 -6
- package/src/Dropdown/DropdownHelpers.test.ts +1 -1
- package/src/Dropdown/DropdownHelpers.ts +4 -4
- package/src/ErrorBoundary/ErrorBoundary.test.tsx +5 -5
- package/src/ErrorBoundary/ErrorBoundary.tsx +7 -5
- package/src/ErrorDialog/ErrorDialog.tsx +4 -4
- package/src/ErrorDialog/errorDialogSlice.ts +3 -3
- package/src/FactoryReset/FactoryResetButton.test.tsx +1 -1
- package/src/FlashMessage/FlashMessage.tsx +8 -8
- package/src/FlashMessage/FlashMessageSlice.ts +3 -3
- package/src/Group/Group.tsx +11 -11
- package/src/InlineInput/InlineInput.tsx +4 -4
- package/src/InlineInput/NumberInlineInput.tsx +13 -13
- package/src/InlineInput/NumberInputWithDropdown.tsx +2 -2
- package/src/Link/ExternalLink.tsx +1 -1
- package/src/Link/FileLink.tsx +1 -1
- package/src/Log/LogEntry.tsx +1 -1
- package/src/Log/logSlice.ts +1 -1
- package/src/Log/syncLogToStore.ts +1 -1
- package/src/MasonryLayout/MasonryLayout.tsx +8 -6
- package/src/NavBar/NavMenuItem.tsx +1 -1
- package/src/NumberInput/NumberInput.tsx +3 -3
- package/src/Parsers/shellParser.test.ts +99 -101
- package/src/Parsers/shellParser.ts +20 -20
- package/src/PseudoButton/PseudoButton.tsx +1 -1
- package/src/SerialPort/ConflictingSettingsDialog.tsx +11 -9
- package/src/SerialPort/SerialPort.test.ts +4 -4
- package/src/SerialPort/SerialPort.ts +22 -18
- package/src/Slider/Handle.tsx +3 -3
- package/src/Slider/Slider.test.tsx +2 -2
- package/src/Slider/Slider.tsx +2 -2
- package/src/Slider/Ticks.tsx +2 -2
- package/src/Slider/percentage.ts +2 -2
- package/src/Slider/range.ts +7 -7
- package/src/StartStopButton/StartStopButton.tsx +1 -1
- package/src/StateSelector/StateSelector.tsx +1 -1
- package/src/Stepper/Stepper.tsx +2 -2
- package/src/Toggle/Toggle.tsx +2 -2
- package/src/logging/appTransport.test.ts +2 -2
- package/src/logging/appTransport.ts +1 -1
- package/src/logging/describeError.test.ts +1 -1
- package/src/logging/describeError.ts +1 -1
- package/src/logging/index.ts +4 -4
- package/src/logging/sendInitialLogMessages.ts +2 -2
- package/src/store.ts +4 -5
- package/src/telemetry/TelemetrySender.ts +2 -2
- package/src/telemetry/TelemetrySenderInMain.ts +1 -2
- package/src/telemetry/flatObject.test.ts +1 -1
- package/src/telemetry/telemetry.ts +3 -3
- package/src/utils/classNames.test.ts +2 -2
- package/src/utils/packageJson.ts +4 -4
- package/src/utils/persistentStore.ts +19 -19
- package/src/utils/systemReport.ts +8 -8
- package/src/utils/truncateMiddle.test.ts +1 -1
- package/src/utils/truncateMiddle.ts +1 -1
- package/src/utils/udevInstalled.ts +1 -1
- package/src/utils/useHotKey.ts +2 -2
- package/src/utils/useStopwatch.test.tsx +1 -11
- package/src/utils/useStopwatch.ts +3 -3
- package/test/dispatchTo.ts +1 -1
- package/test/setupTests.ts +3 -3
- package/test/testrenderer.tsx +4 -8
- package/typings/generated/ipc/appDetails.d.ts.map +1 -1
- package/typings/generated/ipc/apps.d.ts.map +1 -1
- package/typings/generated/ipc/infrastructure/mainToRenderer.d.ts +1 -1
- package/typings/generated/ipc/infrastructure/mainToRenderer.d.ts.map +1 -1
- package/typings/generated/ipc/infrastructure/rendererToMain.d.ts.map +1 -1
- package/typings/generated/ipc/open.d.ts.map +1 -1
- package/typings/generated/ipc/safeStorage.d.ts +4 -5
- package/typings/generated/ipc/safeStorage.d.ts.map +1 -1
- package/typings/generated/ipc/schema/packageJson.d.ts +3 -3
- package/typings/generated/ipc/schema/parseJson.d.ts +1 -1
- package/typings/generated/ipc/schema/parseJson.d.ts.map +1 -1
- package/typings/generated/ipc/serialPort.d.ts +10 -11
- package/typings/generated/ipc/serialPort.d.ts.map +1 -1
- package/typings/generated/main/index.d.ts +13 -14
- package/typings/generated/main/index.d.ts.map +1 -1
- package/typings/generated/nrfutil/collectingResultParser.d.ts +1 -2
- package/typings/generated/nrfutil/collectingResultParser.d.ts.map +1 -1
- package/typings/generated/nrfutil/common.d.ts +0 -1
- package/typings/generated/nrfutil/common.d.ts.map +1 -1
- package/typings/generated/nrfutil/device/__mocks__/device.d.ts +1 -2
- package/typings/generated/nrfutil/device/__mocks__/device.d.ts.map +1 -1
- package/typings/generated/nrfutil/device/batchTypes.d.ts.map +1 -1
- package/typings/generated/nrfutil/device/boardController.d.ts.map +1 -1
- package/typings/generated/nrfutil/device/common.d.ts.map +1 -1
- package/typings/generated/nrfutil/device/device.d.ts +17 -17
- package/typings/generated/nrfutil/device/device.d.ts.map +1 -1
- package/typings/generated/nrfutil/device/deviceInfo.d.ts.map +1 -1
- package/typings/generated/nrfutil/device/erase.d.ts.map +1 -1
- package/typings/generated/nrfutil/device/getBoardControllerConfig.d.ts.map +1 -1
- package/typings/generated/nrfutil/device/getBoardControllerVersion.d.ts.map +1 -1
- package/typings/generated/nrfutil/device/getCoreInfo.d.ts.map +1 -1
- package/typings/generated/nrfutil/device/getFwInfo.d.ts.map +1 -1
- package/typings/generated/nrfutil/device/getProtectionStatus.d.ts.map +1 -1
- package/typings/generated/nrfutil/device/list.d.ts +2 -2
- package/typings/generated/nrfutil/device/list.d.ts.map +1 -1
- package/typings/generated/nrfutil/device/logLibVersions.d.ts.map +1 -1
- package/typings/generated/nrfutil/device/program.d.ts +0 -1
- package/typings/generated/nrfutil/device/program.d.ts.map +1 -1
- package/typings/generated/nrfutil/device/recover.d.ts.map +1 -1
- package/typings/generated/nrfutil/device/reset.d.ts.map +1 -1
- package/typings/generated/nrfutil/device/setMcuState.d.ts.map +1 -1
- package/typings/generated/nrfutil/device/setProtectionStatus.d.ts +1 -1
- package/typings/generated/nrfutil/device/setProtectionStatus.d.ts.map +1 -1
- package/typings/generated/nrfutil/device/xRead.d.ts.map +1 -1
- package/typings/generated/nrfutil/modules.d.ts.map +1 -1
- package/typings/generated/nrfutil/nrfutilLogger.d.ts.map +1 -1
- package/typings/generated/nrfutil/sandbox.d.ts +4 -5
- package/typings/generated/nrfutil/sandbox.d.ts.map +1 -1
- package/typings/generated/nrfutil/version/jlinkVersion.d.ts.map +1 -1
- package/typings/generated/nrfutil/version/moduleVersion.d.ts +1 -1
- package/typings/generated/nrfutil/version/moduleVersion.d.ts.map +1 -1
- package/typings/generated/nrfutil/version/version.d.ts.map +1 -1
- package/typings/generated/scripts/check-app-properties.d.ts.map +1 -1
- package/typings/generated/scripts/esbuild-renderer.d.ts.map +1 -1
- package/typings/generated/scripts/get-release-numbers.d.ts.map +1 -1
- package/typings/generated/scripts/latest-changelog-entry.d.ts.map +1 -1
- package/typings/generated/src/About/About.d.ts.map +1 -1
- package/typings/generated/src/About/ApplicationCard.d.ts +0 -1
- package/typings/generated/src/About/ApplicationCard.d.ts.map +1 -1
- package/typings/generated/src/About/DeviceCard.d.ts +0 -1
- package/typings/generated/src/About/DeviceCard.d.ts.map +1 -1
- package/typings/generated/src/About/DocumentationCard.d.ts.map +1 -1
- package/typings/generated/src/About/DocumentationSection.d.ts.map +1 -1
- package/typings/generated/src/About/Feedback.d.ts +1 -2
- package/typings/generated/src/About/Feedback.d.ts.map +1 -1
- package/typings/generated/src/About/Section.d.ts.map +1 -1
- package/typings/generated/src/About/SupportCard.d.ts +1 -2
- package/typings/generated/src/About/SupportCard.d.ts.map +1 -1
- package/typings/generated/src/About/sendFeedback.d.ts.map +1 -1
- package/typings/generated/src/About/shortcutSlice.d.ts +1 -1
- package/typings/generated/src/About/shortcutSlice.d.ts.map +1 -1
- package/typings/generated/src/App/App.d.ts +1 -1
- package/typings/generated/src/App/App.d.ts.map +1 -1
- package/typings/generated/src/App/ConnectedToStore.d.ts +1 -1
- package/typings/generated/src/App/ConnectedToStore.d.ts.map +1 -1
- package/typings/generated/src/App/VisibilityBar.d.ts +0 -1
- package/typings/generated/src/App/VisibilityBar.d.ts.map +1 -1
- package/typings/generated/src/App/appLayout.d.ts +1 -1
- package/typings/generated/src/App/appLayout.d.ts.map +1 -1
- package/typings/generated/src/Card/Card.d.ts.map +1 -1
- package/typings/generated/src/ConfirmBeforeClose/ConfirmCloseDialog.d.ts +0 -1
- package/typings/generated/src/ConfirmBeforeClose/ConfirmCloseDialog.d.ts.map +1 -1
- package/typings/generated/src/ConfirmBeforeClose/confirmBeforeCloseSlice.d.ts +2 -3
- package/typings/generated/src/ConfirmBeforeClose/confirmBeforeCloseSlice.d.ts.map +1 -1
- package/typings/generated/src/Device/BrokenDeviceDialog/BrokenDeviceDialog.d.ts +0 -1
- package/typings/generated/src/Device/BrokenDeviceDialog/BrokenDeviceDialog.d.ts.map +1 -1
- package/typings/generated/src/Device/BrokenDeviceDialog/brokenDeviceDialogSlice.d.ts +1 -1
- package/typings/generated/src/Device/BrokenDeviceDialog/brokenDeviceDialogSlice.d.ts.map +1 -1
- package/typings/generated/src/Device/DeviceSelector/BasicDeviceInfo.d.ts.map +1 -1
- package/typings/generated/src/Device/DeviceSelector/DeviceList/BrokenDevice.d.ts +0 -1
- package/typings/generated/src/Device/DeviceSelector/DeviceList/BrokenDevice.d.ts.map +1 -1
- package/typings/generated/src/Device/DeviceSelector/DeviceList/Device.d.ts +0 -1
- package/typings/generated/src/Device/DeviceSelector/DeviceList/Device.d.ts.map +1 -1
- package/typings/generated/src/Device/DeviceSelector/DeviceList/MoreDeviceInfo.d.ts +0 -1
- package/typings/generated/src/Device/DeviceSelector/DeviceList/MoreDeviceInfo.d.ts.map +1 -1
- package/typings/generated/src/Device/DeviceSelector/DeviceList/RenameDevice.d.ts +0 -1
- package/typings/generated/src/Device/DeviceSelector/DeviceList/RenameDevice.d.ts.map +1 -1
- package/typings/generated/src/Device/DeviceSelector/DeviceList/VirtualDevices.d.ts +0 -1
- package/typings/generated/src/Device/DeviceSelector/DeviceList/VirtualDevices.d.ts.map +1 -1
- package/typings/generated/src/Device/DeviceSelector/DeviceSelector.d.ts +0 -1
- package/typings/generated/src/Device/DeviceSelector/DeviceSelector.d.ts.map +1 -1
- package/typings/generated/src/Device/DeviceSelector/DisconnectDevice.d.ts +0 -1
- package/typings/generated/src/Device/DeviceSelector/DisconnectDevice.d.ts.map +1 -1
- package/typings/generated/src/Device/DeviceSelector/SelectDevice.d.ts +0 -1
- package/typings/generated/src/Device/DeviceSelector/SelectDevice.d.ts.map +1 -1
- package/typings/generated/src/Device/DeviceSelector/SelectedDevice.d.ts +0 -1
- package/typings/generated/src/Device/DeviceSelector/SelectedDevice.d.ts.map +1 -1
- package/typings/generated/src/Device/DeviceSelector/SelectedVirtualDevice.d.ts +0 -1
- package/typings/generated/src/Device/DeviceSelector/SelectedVirtualDevice.d.ts.map +1 -1
- package/typings/generated/src/Device/DeviceSetup/DeviceSetupView.d.ts +0 -1
- package/typings/generated/src/Device/DeviceSetup/DeviceSetupView.d.ts.map +1 -1
- package/typings/generated/src/Device/deviceAutoSelectSlice.d.ts +1 -1
- package/typings/generated/src/Device/deviceAutoSelectSlice.d.ts.map +1 -1
- package/typings/generated/src/Device/deviceInfo/deviceInfo.d.ts +0 -1
- package/typings/generated/src/Device/deviceInfo/deviceInfo.d.ts.map +1 -1
- package/typings/generated/src/Device/deviceLister.d.ts.map +1 -1
- package/typings/generated/src/Device/deviceSetup.d.ts +0 -1
- package/typings/generated/src/Device/deviceSetup.d.ts.map +1 -1
- package/typings/generated/src/Device/deviceSetupSlice.d.ts +3 -3
- package/typings/generated/src/Device/deviceSetupSlice.d.ts.map +1 -1
- package/typings/generated/src/Device/deviceSlice.d.ts +1 -1
- package/typings/generated/src/Device/deviceSlice.d.ts.map +1 -1
- package/typings/generated/src/Device/initPacket.d.ts +0 -1
- package/typings/generated/src/Device/initPacket.d.ts.map +1 -1
- package/typings/generated/src/Device/jprogOperations.d.ts.map +1 -1
- package/typings/generated/src/Device/sdfuOperations.d.ts +1 -2
- package/typings/generated/src/Device/sdfuOperations.d.ts.map +1 -1
- package/typings/generated/src/Dialog/Dialog.d.ts +3 -3
- package/typings/generated/src/Dialog/Dialog.d.ts.map +1 -1
- package/typings/generated/src/Dropdown/Dropdown.d.ts.map +1 -1
- package/typings/generated/src/Dropdown/DropdownHelpers.d.ts.map +1 -1
- package/typings/generated/src/ErrorBoundary/ErrorBoundary.d.ts.map +1 -1
- package/typings/generated/src/ErrorDialog/ErrorDialog.d.ts +0 -1
- package/typings/generated/src/ErrorDialog/ErrorDialog.d.ts.map +1 -1
- package/typings/generated/src/ErrorDialog/errorDialogSlice.d.ts +1 -1
- package/typings/generated/src/ErrorDialog/errorDialogSlice.d.ts.map +1 -1
- package/typings/generated/src/FlashMessage/FlashMessage.d.ts +0 -1
- package/typings/generated/src/FlashMessage/FlashMessage.d.ts.map +1 -1
- package/typings/generated/src/FlashMessage/FlashMessageSlice.d.ts +1 -1
- package/typings/generated/src/FlashMessage/FlashMessageSlice.d.ts.map +1 -1
- package/typings/generated/src/Group/Group.d.ts +8 -8
- package/typings/generated/src/Group/Group.d.ts.map +1 -1
- package/typings/generated/src/InlineInput/InlineInput.d.ts.map +1 -1
- package/typings/generated/src/InlineInput/NumberInlineInput.d.ts +0 -1
- package/typings/generated/src/InlineInput/NumberInlineInput.d.ts.map +1 -1
- package/typings/generated/src/InlineInput/NumberInputWithDropdown.d.ts.map +1 -1
- package/typings/generated/src/Link/ExternalLink.d.ts +1 -2
- package/typings/generated/src/Link/ExternalLink.d.ts.map +1 -1
- package/typings/generated/src/Link/FileLink.d.ts +1 -2
- package/typings/generated/src/Link/FileLink.d.ts.map +1 -1
- package/typings/generated/src/Log/LogEntry.d.ts +0 -1
- package/typings/generated/src/Log/LogEntry.d.ts.map +1 -1
- package/typings/generated/src/Log/LogViewer.d.ts +0 -1
- package/typings/generated/src/Log/LogViewer.d.ts.map +1 -1
- package/typings/generated/src/Log/logSlice.d.ts +1 -1
- package/typings/generated/src/Log/logSlice.d.ts.map +1 -1
- package/typings/generated/src/Log/syncLogToStore.d.ts.map +1 -1
- package/typings/generated/src/Main/Main.d.ts.map +1 -1
- package/typings/generated/src/MasonryLayout/MasonryLayout.d.ts.map +1 -1
- package/typings/generated/src/NavBar/NavBar.d.ts.map +1 -1
- package/typings/generated/src/NavBar/NavMenu.d.ts +0 -1
- package/typings/generated/src/NavBar/NavMenu.d.ts.map +1 -1
- package/typings/generated/src/NoticeBox/NoticeBox.d.ts.map +1 -1
- package/typings/generated/src/NumberInput/NumberInput.d.ts +8 -8
- package/typings/generated/src/NumberInput/NumberInput.d.ts.map +1 -1
- package/typings/generated/src/Overlay/Overlay.d.ts +2 -2
- package/typings/generated/src/Overlay/Overlay.d.ts.map +1 -1
- package/typings/generated/src/Parsers/shellParser.d.ts +1 -1
- package/typings/generated/src/Parsers/shellParser.d.ts.map +1 -1
- package/typings/generated/src/Parsers/shellParser.test.d.ts.map +1 -1
- package/typings/generated/src/PseudoButton/PseudoButton.d.ts +4 -4
- package/typings/generated/src/PseudoButton/PseudoButton.d.ts.map +1 -1
- package/typings/generated/src/SerialPort/ConflictingSettingsDialog.d.ts +0 -1
- package/typings/generated/src/SerialPort/ConflictingSettingsDialog.d.ts.map +1 -1
- package/typings/generated/src/SerialPort/SerialPort.d.ts +0 -1
- package/typings/generated/src/SerialPort/SerialPort.d.ts.map +1 -1
- package/typings/generated/src/SidePanel/SidePanel.d.ts +1 -1
- package/typings/generated/src/SidePanel/SidePanel.d.ts.map +1 -1
- package/typings/generated/src/Slider/factor.d.ts.map +1 -1
- package/typings/generated/src/Slider/percentage.d.ts.map +1 -1
- package/typings/generated/src/Slider/range.d.ts.map +1 -1
- package/typings/generated/src/Spinner/Spinner.d.ts +2 -3
- package/typings/generated/src/Spinner/Spinner.d.ts.map +1 -1
- package/typings/generated/src/StateSelector/StateSelector.d.ts.map +1 -1
- package/typings/generated/src/Stepper/Stepper.d.ts +0 -1
- package/typings/generated/src/Stepper/Stepper.d.ts.map +1 -1
- package/typings/generated/src/logging/describeError.d.ts.map +1 -1
- package/typings/generated/src/logging/index.d.ts.map +1 -1
- package/typings/generated/src/logging/logBuffer.d.ts.map +1 -1
- package/typings/generated/src/store.d.ts +15 -39
- package/typings/generated/src/store.d.ts.map +1 -1
- package/typings/generated/src/telemetry/TelemetrySender.d.ts.map +1 -1
- package/typings/generated/src/telemetry/TelemetrySenderInMain.d.ts.map +1 -1
- package/typings/generated/src/telemetry/TelemetrySenderInRenderer.d.ts.map +1 -1
- package/typings/generated/src/telemetry/flatObject.d.ts.map +1 -1
- package/typings/generated/src/telemetry/simplifyDevice.d.ts.map +1 -1
- package/typings/generated/src/telemetry/telemetry.d.ts +1 -1
- package/typings/generated/src/telemetry/telemetry.d.ts.map +1 -1
- package/typings/generated/src/utils/appDirs.d.ts.map +1 -1
- package/typings/generated/src/utils/classNames.d.ts.map +1 -1
- package/typings/generated/src/utils/packageJson.d.ts.map +1 -1
- package/typings/generated/src/utils/persistentStore.d.ts +1 -1
- package/typings/generated/src/utils/persistentStore.d.ts.map +1 -1
- package/typings/generated/src/utils/systemReport.d.ts.map +1 -1
- package/typings/generated/src/utils/truncateMiddle.d.ts.map +1 -1
- package/typings/generated/src/utils/useFocusedOnVisible.d.ts +0 -1
- package/typings/generated/src/utils/useFocusedOnVisible.d.ts.map +1 -1
- package/typings/generated/src/utils/useHotKey.d.ts.map +1 -1
- package/typings/generated/src/utils/useStopwatch.d.ts.map +1 -1
- package/typings/generated/test/dispatchTo.d.ts +1 -1
- package/typings/generated/test/dispatchTo.d.ts.map +1 -1
- package/typings/generated/test/testrenderer.d.ts +2 -1
- package/typings/generated/test/testrenderer.d.ts.map +1 -1
package/README.md
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
This project provides shared commodities for developing nRF Connect for Desktop
|
|
4
4
|
apps and their launcher:
|
|
5
5
|
|
|
6
|
-
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
6
|
+
- React components
|
|
7
|
+
- Build scripts
|
|
8
|
+
- Configurations
|
|
9
|
+
- Test facilities
|
|
10
10
|
|
|
11
11
|
## Developing a new feature or fixing an error
|
|
12
12
|
|
|
@@ -21,10 +21,10 @@ change as a new version right ahead, add a new section with the heading
|
|
|
21
21
|
|
|
22
22
|
To release, two files must be up-to-date:
|
|
23
23
|
|
|
24
|
-
-
|
|
25
|
-
|
|
26
|
-
-
|
|
27
|
-
|
|
24
|
+
- `package.json` contain the correct version number (one more than the last
|
|
25
|
+
release).
|
|
26
|
+
- `Changelog.md` must contain an entry, with that version number and today's
|
|
27
|
+
date.
|
|
28
28
|
|
|
29
29
|
By running `npm run prepare-shared-release` you update the version in
|
|
30
30
|
`package.json` and in `Changelog.md` a potential `## Unreleased` heading is
|
package/config/colors.js
CHANGED
|
@@ -37,7 +37,7 @@ paletteColorsKeys.forEach(color => {
|
|
|
37
37
|
});
|
|
38
38
|
|
|
39
39
|
const colors = Object.entries(flattenedColors).filter(
|
|
40
|
-
([key]) => !paletteColorsKeys.find(c => key.startsWith(c))
|
|
40
|
+
([key]) => !paletteColorsKeys.find(c => key.startsWith(c)),
|
|
41
41
|
);
|
|
42
42
|
|
|
43
43
|
module.exports = {
|
package/config/eslintrc.js
CHANGED
|
@@ -17,9 +17,10 @@ module.exports = {
|
|
|
17
17
|
extends: [
|
|
18
18
|
'eslint:recommended',
|
|
19
19
|
'airbnb',
|
|
20
|
-
'plugin:@typescript-eslint/
|
|
20
|
+
'plugin:@typescript-eslint/strict',
|
|
21
21
|
'plugin:import/recommended',
|
|
22
22
|
'plugin:import/typescript',
|
|
23
|
+
'plugin:jsonc/recommended-with-jsonc',
|
|
23
24
|
'prettier',
|
|
24
25
|
],
|
|
25
26
|
ignorePatterns: [
|
|
@@ -35,9 +36,7 @@ module.exports = {
|
|
|
35
36
|
'error',
|
|
36
37
|
{ 'ts-expect-error': 'allow-with-description' },
|
|
37
38
|
],
|
|
38
|
-
'@typescript-eslint/no-empty-function': 'off',
|
|
39
39
|
'@typescript-eslint/no-shadow': 'error',
|
|
40
|
-
'@typescript-eslint/no-var-requires': 'off',
|
|
41
40
|
'import/default': 'error',
|
|
42
41
|
'import/extensions': 'off',
|
|
43
42
|
'import/named': 'error',
|
|
@@ -64,10 +63,11 @@ module.exports = {
|
|
|
64
63
|
plugins: [
|
|
65
64
|
'preset-lint-markdown-style-guide',
|
|
66
65
|
'frontmatter',
|
|
67
|
-
['lint-no-duplicate-headings', false],
|
|
68
|
-
['lint-list-item-indent', false],
|
|
69
66
|
['lint-emphasis-marker', false],
|
|
67
|
+
['lint-list-item-content-indent', false],
|
|
68
|
+
['lint-list-item-indent', false],
|
|
70
69
|
['lint-list-item-spacing', false],
|
|
70
|
+
['lint-no-duplicate-headings', false],
|
|
71
71
|
['lint-no-literal-urls', false],
|
|
72
72
|
],
|
|
73
73
|
},
|
|
@@ -125,6 +125,10 @@ module.exports = {
|
|
|
125
125
|
},
|
|
126
126
|
],
|
|
127
127
|
'valid-jsdoc': ['error', { prefer: { return: 'returns' } }],
|
|
128
|
+
'no-empty-function': [
|
|
129
|
+
'error',
|
|
130
|
+
{ allow: ['arrowFunctions', 'constructors'] },
|
|
131
|
+
],
|
|
128
132
|
},
|
|
129
133
|
overrides: [
|
|
130
134
|
{
|
|
@@ -158,10 +162,17 @@ module.exports = {
|
|
|
158
162
|
},
|
|
159
163
|
{
|
|
160
164
|
files: ['*.json'],
|
|
165
|
+
parser: 'jsonc-eslint-parser',
|
|
161
166
|
rules: {
|
|
162
167
|
'no-template-curly-in-string': 'off',
|
|
163
168
|
},
|
|
164
169
|
},
|
|
170
|
+
{
|
|
171
|
+
files: ['*.js'],
|
|
172
|
+
rules: {
|
|
173
|
+
'@typescript-eslint/no-require-imports': 'off',
|
|
174
|
+
},
|
|
175
|
+
},
|
|
165
176
|
{
|
|
166
177
|
files: [
|
|
167
178
|
'**/__tests__/**/*.[jt]s?(x)',
|
package/config/jest.config.js
CHANGED
|
@@ -18,7 +18,7 @@ module.exports = (disabledMocks = []) => ({
|
|
|
18
18
|
'^electron-store$': `${mockDir}/electronStoreMock.ts`,
|
|
19
19
|
'@electron/remote': `${mockDir}/remoteMock.ts`,
|
|
20
20
|
'react-markdown': require.resolve(
|
|
21
|
-
'react-markdown/react-markdown.min.js'
|
|
21
|
+
'react-markdown/react-markdown.min.js',
|
|
22
22
|
),
|
|
23
23
|
...(disabledMocks.includes('packageJson')
|
|
24
24
|
? {}
|
package/ipc/MetaFiles.ts
CHANGED
|
@@ -49,7 +49,7 @@ export interface AppInfo {
|
|
|
49
49
|
export const semver = z.string().regex(
|
|
50
50
|
// From https://semver.org
|
|
51
51
|
/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,
|
|
52
|
-
'Is not a valid string for a semantic version'
|
|
52
|
+
'Is not a valid string for a semantic version',
|
|
53
53
|
);
|
|
54
54
|
|
|
55
55
|
const nrfutilModuleName = z.string();
|
|
@@ -60,7 +60,7 @@ export type NrfutilModuleVersion = z.infer<typeof nrfutilModuleVersion>;
|
|
|
60
60
|
|
|
61
61
|
export const nrfModules = z.record(
|
|
62
62
|
nrfutilModuleName,
|
|
63
|
-
z.tuple([nrfutilModuleVersion])
|
|
63
|
+
z.tuple([nrfutilModuleVersion]),
|
|
64
64
|
);
|
|
65
65
|
|
|
66
66
|
export type NrfutilModules = z.infer<typeof nrfModules>;
|
package/ipc/README.md
CHANGED
|
@@ -16,28 +16,28 @@ launcher will react in the way the apps expect it.
|
|
|
16
16
|
|
|
17
17
|
There are a few conventions we follow with the code here in `ipc/`:
|
|
18
18
|
|
|
19
|
-
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
- In each file there are pairs of functions: One to send a message over an IPC
|
|
20
|
+
channel (e.g. `openApp`) and another to register a handler for the messages on
|
|
21
|
+
that same channel (e.g. `registerOpenApp`).
|
|
22
22
|
|
|
23
23
|
Usually these two functions utilize a shared signature which is defined in a
|
|
24
24
|
type above them. Usually the functions are defined by invoking functions
|
|
25
25
|
from `infrastructure/mainToRenderer.ts` or
|
|
26
26
|
`infrastructure/rendererToMain.ts` which also use that type.
|
|
27
27
|
|
|
28
|
-
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
- The functions mentioned before are then exported in objects with the names
|
|
29
|
+
`inMain`, `forRenderer`, `inRenderer`, and `forMain` to signify how the
|
|
30
|
+
functions are supposed to be used. E.g. the mentioned `openApp` is in `inMain`
|
|
31
|
+
because it is called by code in the renderer processes to invoke code in the
|
|
32
|
+
main process to open an window. `registerOpenApp` is in `forRenderer` because
|
|
33
|
+
the handler is registered so that code in the renderer processes can invoke
|
|
34
|
+
it.
|
|
35
35
|
|
|
36
36
|
So, `inMain` and `forRenderer` are used when sending messages from the
|
|
37
37
|
renderer processes to the main process. `inRenderer` and `forMain` are used,
|
|
38
38
|
when sending messages from the main process to the renderer processes.
|
|
39
39
|
|
|
40
|
-
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
- The code here in `ipc/` must neither reference any code in `src/` (which is
|
|
41
|
+
for code of the renderer processes) nor in `main/` (which is for code in the
|
|
42
|
+
main process). Only the other way around code in those two folders can
|
|
43
|
+
reference code in `ipc/`.
|
package/ipc/appDetails.ts
CHANGED
|
@@ -30,7 +30,7 @@ type GetAppDetails = () => AppDetailsFromLauncher;
|
|
|
30
30
|
const getAppDetails = invoke<GetAppDetails>(channel.request);
|
|
31
31
|
|
|
32
32
|
const registerGetAppDetails = (
|
|
33
|
-
onGetAppDetails: (webContents: WebContents) => AppDetailsFromLauncher
|
|
33
|
+
onGetAppDetails: (webContents: WebContents) => AppDetailsFromLauncher,
|
|
34
34
|
) => {
|
|
35
35
|
handleWithSender<GetAppDetails>(channel.request)(onGetAppDetails);
|
|
36
36
|
|
package/ipc/apps.ts
CHANGED
|
@@ -119,23 +119,23 @@ export type GetDownloadableAppsResult = {
|
|
|
119
119
|
type GetDownloadableApps = () => GetDownloadableAppsResult;
|
|
120
120
|
|
|
121
121
|
const getDownloadableApps = invoke<GetDownloadableApps>(
|
|
122
|
-
channel.getDownloadableApps
|
|
122
|
+
channel.getDownloadableApps,
|
|
123
123
|
);
|
|
124
124
|
const registerGetDownloadableApps = handle<GetDownloadableApps>(
|
|
125
|
-
channel.getDownloadableApps
|
|
125
|
+
channel.getDownloadableApps,
|
|
126
126
|
);
|
|
127
127
|
|
|
128
128
|
// installDownloadableApp
|
|
129
129
|
type InstallDownloadableApp = (
|
|
130
130
|
app: DownloadableApp,
|
|
131
|
-
version?: string
|
|
131
|
+
version?: string,
|
|
132
132
|
) => DownloadableApp;
|
|
133
133
|
|
|
134
134
|
const installDownloadableApp = invoke<InstallDownloadableApp>(
|
|
135
|
-
channel.installDownloadableApp
|
|
135
|
+
channel.installDownloadableApp,
|
|
136
136
|
);
|
|
137
137
|
const registerInstallDownloadableApp = handle<InstallDownloadableApp>(
|
|
138
|
-
channel.installDownloadableApp
|
|
138
|
+
channel.installDownloadableApp,
|
|
139
139
|
);
|
|
140
140
|
|
|
141
141
|
export const forRenderer = {
|
|
@@ -25,7 +25,7 @@ export const on =
|
|
|
25
25
|
<T extends (...args: never[]) => void>(channel: string) =>
|
|
26
26
|
(handler: T) =>
|
|
27
27
|
ipcRenderer.on(channel, (_event, ...args: unknown[]) =>
|
|
28
|
-
handler(...(args as Parameters<T>))
|
|
28
|
+
handler(...(args as Parameters<T>)),
|
|
29
29
|
);
|
|
30
30
|
|
|
31
31
|
// Broadcast with a subchannel
|
|
@@ -44,10 +44,10 @@ export const broadcast =
|
|
|
44
44
|
export const onBroadcasted =
|
|
45
45
|
<T extends (...args: never[]) => void>(
|
|
46
46
|
channel: string,
|
|
47
|
-
subChannel: string
|
|
47
|
+
subChannel: string,
|
|
48
48
|
) =>
|
|
49
49
|
(handler: T) =>
|
|
50
50
|
ipcRenderer.on(
|
|
51
51
|
`${channel}_${subChannel}`,
|
|
52
|
-
(_event, ...args: unknown[]) => handler(...(args as Parameters<T>))
|
|
52
|
+
(_event, ...args: unknown[]) => handler(...(args as Parameters<T>)),
|
|
53
53
|
);
|
|
@@ -16,7 +16,7 @@ export const on =
|
|
|
16
16
|
<T extends (...args: never[]) => void>(channel: string) =>
|
|
17
17
|
(handler: T) =>
|
|
18
18
|
ipcMain.on(channel, (_event, ...args: unknown[]) =>
|
|
19
|
-
handler(...(args as Parameters<T>))
|
|
19
|
+
handler(...(args as Parameters<T>)),
|
|
20
20
|
);
|
|
21
21
|
|
|
22
22
|
// Invoke
|
|
@@ -30,10 +30,10 @@ export const handle =
|
|
|
30
30
|
(
|
|
31
31
|
handler:
|
|
32
32
|
| ((...args: Parameters<T>) => ReturnType<T>)
|
|
33
|
-
| ((...args: Parameters<T>) => Promise<ReturnType<T>>)
|
|
33
|
+
| ((...args: Parameters<T>) => Promise<ReturnType<T>>),
|
|
34
34
|
) =>
|
|
35
35
|
ipcMain.handle(channel, (_event, ...args: unknown[]) =>
|
|
36
|
-
handler(...(args as Parameters<T>))
|
|
36
|
+
handler(...(args as Parameters<T>)),
|
|
37
37
|
);
|
|
38
38
|
|
|
39
39
|
export const handleWithSender =
|
|
@@ -44,8 +44,8 @@ export const handleWithSender =
|
|
|
44
44
|
| ((
|
|
45
45
|
sender: WebContents,
|
|
46
46
|
...args: Parameters<T>
|
|
47
|
-
) => Promise<ReturnType<T>>)
|
|
47
|
+
) => Promise<ReturnType<T>>),
|
|
48
48
|
) =>
|
|
49
49
|
ipcMain.handle(channel, ({ sender }, ...args: unknown[]) =>
|
|
50
|
-
handler(sender, ...(args as Parameters<T>))
|
|
50
|
+
handler(sender, ...(args as Parameters<T>)),
|
|
51
51
|
);
|
package/ipc/open.ts
CHANGED
|
@@ -17,12 +17,12 @@ const channel = {
|
|
|
17
17
|
|
|
18
18
|
// app
|
|
19
19
|
export const isOpenAppOptionsDeviceSN = (
|
|
20
|
-
device: OpenAppOptionsDevice
|
|
20
|
+
device: OpenAppOptionsDevice,
|
|
21
21
|
): device is OpenAppOptionsDeviceSN =>
|
|
22
22
|
(device as OpenAppOptionsDeviceSN).serialNumber !== undefined;
|
|
23
23
|
|
|
24
24
|
export const isOpenAppOptionsDevicePort = (
|
|
25
|
-
device: OpenAppOptionsDevice
|
|
25
|
+
device: OpenAppOptionsDevice,
|
|
26
26
|
): device is OpenAppOptionsDevicePort =>
|
|
27
27
|
(device as OpenAppOptionsDevicePort).serialPortPath !== undefined;
|
|
28
28
|
|
package/ipc/safeStorage.ts
CHANGED
|
@@ -14,10 +14,10 @@ const channel = {
|
|
|
14
14
|
|
|
15
15
|
type EncryptionAvailable = () => boolean;
|
|
16
16
|
const isEncryptionAvailable = invoke<EncryptionAvailable>(
|
|
17
|
-
channel.encryptionAvailable
|
|
17
|
+
channel.encryptionAvailable,
|
|
18
18
|
);
|
|
19
19
|
const registerEncryptionAvailable = handle<EncryptionAvailable>(
|
|
20
|
-
channel.encryptionAvailable
|
|
20
|
+
channel.encryptionAvailable,
|
|
21
21
|
);
|
|
22
22
|
|
|
23
23
|
type EncryptString = (plainText: string) => Buffer;
|
|
@@ -39,7 +39,7 @@ const nrfConnectForDesktop = z.object({
|
|
|
39
39
|
const recordOfOptionalStrings = z.record(z.string().optional());
|
|
40
40
|
|
|
41
41
|
const engines = recordOfOptionalStrings.and(
|
|
42
|
-
z.object({ nrfconnect: z.string() })
|
|
42
|
+
z.object({ nrfconnect: z.string() }),
|
|
43
43
|
);
|
|
44
44
|
|
|
45
45
|
const packageJsonApp = packageJson.extend({
|
package/ipc/serialPort.ts
CHANGED
|
@@ -59,7 +59,7 @@ export type OverwriteOptions = {
|
|
|
59
59
|
|
|
60
60
|
type Open = (
|
|
61
61
|
options: SerialPortOpenOptions<AutoDetectTypes>,
|
|
62
|
-
overwriteOptions: OverwriteOptions
|
|
62
|
+
overwriteOptions: OverwriteOptions,
|
|
63
63
|
) => void;
|
|
64
64
|
const open = invoke<Open>(channel.open);
|
|
65
65
|
const registerOpen = handleWithSender<Open>(channel.open);
|
|
@@ -89,7 +89,7 @@ const isOpen = invoke<IsOpen>(channel.isOpen);
|
|
|
89
89
|
const registerIsOpen = handle<IsOpen>(channel.isOpen);
|
|
90
90
|
|
|
91
91
|
type GetOptions = (
|
|
92
|
-
path: string
|
|
92
|
+
path: string,
|
|
93
93
|
) => SerialPortOpenOptions<AutoDetectTypes> | undefined;
|
|
94
94
|
const getOptions = invoke<GetOptions>(channel.getOptions);
|
|
95
95
|
const registerGetOptions = handle<GetOptions>(channel.getOptions);
|
|
@@ -11,7 +11,7 @@ export default jest.fn(() => {
|
|
|
11
11
|
return {
|
|
12
12
|
get: jest.fn(
|
|
13
13
|
(key: string, defaultValue?: unknown) =>
|
|
14
|
-
cache.get(key) ?? defaultValue
|
|
14
|
+
cache.get(key) ?? defaultValue,
|
|
15
15
|
),
|
|
16
16
|
set: jest.fn(cache.set.bind(cache)),
|
|
17
17
|
clear: jest.fn(cache.clear.bind(cache)),
|
|
@@ -21,12 +21,11 @@ export default class CollectingResultParser<Result> {
|
|
|
21
21
|
private readonly info: Result[] = [];
|
|
22
22
|
private readonly taskEnd: TaskEnd<Result>[] = [];
|
|
23
23
|
|
|
24
|
-
// eslint-disable-next-line no-useless-constructor
|
|
25
24
|
constructor(
|
|
26
25
|
private onLog: OnLog,
|
|
27
26
|
private onProgress?: OnProgress,
|
|
28
27
|
private onTaskBegin?: OnTaskBegin,
|
|
29
|
-
private onTaskEnd?: OnTaskEnd<Result
|
|
28
|
+
private onTaskEnd?: OnTaskEnd<Result>,
|
|
30
29
|
) {}
|
|
31
30
|
|
|
32
31
|
public handleData = (data: Buffer, pid?: number) => {
|
|
@@ -42,7 +41,7 @@ export default class CollectingResultParser<Result> {
|
|
|
42
41
|
case 'task_progress':
|
|
43
42
|
this.onProgress?.(
|
|
44
43
|
convertNrfutilProgress(item.data.progress),
|
|
45
|
-
item.data.task
|
|
44
|
+
item.data.task,
|
|
46
45
|
);
|
|
47
46
|
break;
|
|
48
47
|
case 'task_begin':
|
|
@@ -74,7 +73,7 @@ export default class CollectingResultParser<Result> {
|
|
|
74
73
|
this.taskEnd
|
|
75
74
|
.filter(end => end.result === 'fail' && !!end.message)
|
|
76
75
|
.map(end =>
|
|
77
|
-
end.message ? `Message: ${addPunctuation(end.message)}` : ''
|
|
76
|
+
end.message ? `Message: ${addPunctuation(end.message)}` : '',
|
|
78
77
|
)
|
|
79
78
|
.join('\n');
|
|
80
79
|
|
package/nrfutil/device/batch.ts
CHANGED
|
@@ -51,7 +51,7 @@ export class Batch {
|
|
|
51
51
|
command: string,
|
|
52
52
|
core: DeviceCore,
|
|
53
53
|
callbacks?: CallbacksUnknown,
|
|
54
|
-
args: string[] = []
|
|
54
|
+
args: string[] = [],
|
|
55
55
|
) {
|
|
56
56
|
const getPromise = async () => {
|
|
57
57
|
const box = await getModule('device');
|
|
@@ -60,7 +60,7 @@ export class Batch {
|
|
|
60
60
|
await box.singleInfoOperationOptionalData<object>(
|
|
61
61
|
command,
|
|
62
62
|
undefined,
|
|
63
|
-
['--generate', ...coreArg(core), ...args]
|
|
63
|
+
['--generate', ...coreArg(core), ...args],
|
|
64
64
|
);
|
|
65
65
|
|
|
66
66
|
return {
|
|
@@ -78,7 +78,7 @@ export class Batch {
|
|
|
78
78
|
this.enqueueBatchOperationObject(
|
|
79
79
|
'device-info',
|
|
80
80
|
core,
|
|
81
|
-
callbacks as CallbacksUnknown
|
|
81
|
+
callbacks as CallbacksUnknown,
|
|
82
82
|
);
|
|
83
83
|
|
|
84
84
|
return this;
|
|
@@ -88,7 +88,7 @@ export class Batch {
|
|
|
88
88
|
this.enqueueBatchOperationObject(
|
|
89
89
|
'erase',
|
|
90
90
|
core,
|
|
91
|
-
callbacks as CallbacksUnknown
|
|
91
|
+
callbacks as CallbacksUnknown,
|
|
92
92
|
);
|
|
93
93
|
|
|
94
94
|
return this;
|
|
@@ -111,7 +111,7 @@ export class Batch {
|
|
|
111
111
|
},
|
|
112
112
|
...callbacks,
|
|
113
113
|
} as BatchOperationWrapperUnknown);
|
|
114
|
-
})
|
|
114
|
+
}),
|
|
115
115
|
);
|
|
116
116
|
|
|
117
117
|
return this;
|
|
@@ -133,7 +133,7 @@ export class Batch {
|
|
|
133
133
|
},
|
|
134
134
|
...callbacks,
|
|
135
135
|
} as BatchOperationWrapperUnknown);
|
|
136
|
-
})
|
|
136
|
+
}),
|
|
137
137
|
);
|
|
138
138
|
|
|
139
139
|
return this;
|
|
@@ -155,7 +155,7 @@ export class Batch {
|
|
|
155
155
|
},
|
|
156
156
|
...callbacks,
|
|
157
157
|
} as BatchOperationWrapperUnknown);
|
|
158
|
-
})
|
|
158
|
+
}),
|
|
159
159
|
);
|
|
160
160
|
|
|
161
161
|
return this;
|
|
@@ -164,7 +164,7 @@ export class Batch {
|
|
|
164
164
|
public xRead(
|
|
165
165
|
core: DeviceCore,
|
|
166
166
|
options: XReadOptions,
|
|
167
|
-
callbacks?: Callbacks<ReadResult
|
|
167
|
+
callbacks?: Callbacks<ReadResult>,
|
|
168
168
|
) {
|
|
169
169
|
this.enqueueBatchOperationObject(
|
|
170
170
|
'x-read',
|
|
@@ -188,7 +188,7 @@ export class Batch {
|
|
|
188
188
|
}
|
|
189
189
|
},
|
|
190
190
|
} as CallbacksUnknown,
|
|
191
|
-
xReadOptionsToArgs(options)
|
|
191
|
+
xReadOptionsToArgs(options),
|
|
192
192
|
);
|
|
193
193
|
|
|
194
194
|
return this;
|
|
@@ -196,12 +196,12 @@ export class Batch {
|
|
|
196
196
|
|
|
197
197
|
public getCoreInfo(
|
|
198
198
|
core: DeviceCore,
|
|
199
|
-
callbacks?: Callbacks<DeviceCoreInfo
|
|
199
|
+
callbacks?: Callbacks<DeviceCoreInfo>,
|
|
200
200
|
) {
|
|
201
201
|
this.enqueueBatchOperationObject(
|
|
202
202
|
'core-info',
|
|
203
203
|
core,
|
|
204
|
-
callbacks as CallbacksUnknown
|
|
204
|
+
callbacks as CallbacksUnknown,
|
|
205
205
|
);
|
|
206
206
|
|
|
207
207
|
return this;
|
|
@@ -211,7 +211,7 @@ export class Batch {
|
|
|
211
211
|
this.enqueueBatchOperationObject(
|
|
212
212
|
'fw-info',
|
|
213
213
|
core,
|
|
214
|
-
callbacks as CallbacksUnknown
|
|
214
|
+
callbacks as CallbacksUnknown,
|
|
215
215
|
);
|
|
216
216
|
|
|
217
217
|
return this;
|
|
@@ -219,12 +219,12 @@ export class Batch {
|
|
|
219
219
|
|
|
220
220
|
public getProtectionStatus(
|
|
221
221
|
core: DeviceCore,
|
|
222
|
-
callbacks?: Callbacks<GetProtectionStatusResult
|
|
222
|
+
callbacks?: Callbacks<GetProtectionStatusResult>,
|
|
223
223
|
) {
|
|
224
224
|
this.enqueueBatchOperationObject(
|
|
225
225
|
'protection-get',
|
|
226
226
|
core,
|
|
227
|
-
callbacks as CallbacksUnknown
|
|
227
|
+
callbacks as CallbacksUnknown,
|
|
228
228
|
);
|
|
229
229
|
|
|
230
230
|
return this;
|
|
@@ -235,7 +235,7 @@ export class Batch {
|
|
|
235
235
|
core: DeviceCore,
|
|
236
236
|
programmingOptions?: ProgrammingOptions,
|
|
237
237
|
deviceTraits?: DeviceTraits,
|
|
238
|
-
callbacks?: CallbacksUnknown
|
|
238
|
+
callbacks?: CallbacksUnknown,
|
|
239
239
|
) {
|
|
240
240
|
const args = [
|
|
241
241
|
...(deviceTraits ? deviceTraitsToArgs(deviceTraits) : []),
|
|
@@ -264,7 +264,7 @@ export class Batch {
|
|
|
264
264
|
this.enqueueBatchOperationObject(
|
|
265
265
|
'recover',
|
|
266
266
|
core,
|
|
267
|
-
callbacks as CallbacksUnknown
|
|
267
|
+
callbacks as CallbacksUnknown,
|
|
268
268
|
);
|
|
269
269
|
|
|
270
270
|
return this;
|
|
@@ -275,7 +275,7 @@ export class Batch {
|
|
|
275
275
|
'reset',
|
|
276
276
|
core,
|
|
277
277
|
callbacks as CallbacksUnknown,
|
|
278
|
-
reset ? ['--reset-kind', reset] : undefined
|
|
278
|
+
reset ? ['--reset-kind', reset] : undefined,
|
|
279
279
|
);
|
|
280
280
|
|
|
281
281
|
return this;
|
|
@@ -283,7 +283,7 @@ export class Batch {
|
|
|
283
283
|
|
|
284
284
|
public collect(
|
|
285
285
|
count: number,
|
|
286
|
-
callback: (completedTasks: TaskEnd<unknown>[]) => void
|
|
286
|
+
callback: (completedTasks: TaskEnd<unknown>[]) => void,
|
|
287
287
|
) {
|
|
288
288
|
this.collectOperations.push({
|
|
289
289
|
callback,
|
|
@@ -296,11 +296,11 @@ export class Batch {
|
|
|
296
296
|
|
|
297
297
|
public async run(
|
|
298
298
|
device: NrfutilDevice,
|
|
299
|
-
controller?: AbortController | undefined
|
|
299
|
+
controller?: AbortController | undefined,
|
|
300
300
|
): Promise<unknown[]> {
|
|
301
301
|
if (!device.serialNumber) {
|
|
302
302
|
throw new Error(
|
|
303
|
-
`Device does not have a serial number, no device operation is possible
|
|
303
|
+
`Device does not have a serial number, no device operation is possible`,
|
|
304
304
|
);
|
|
305
305
|
}
|
|
306
306
|
|
|
@@ -315,7 +315,7 @@ export class Batch {
|
|
|
315
315
|
|
|
316
316
|
const promiseResults =
|
|
317
317
|
await Promise.allSettled<BatchOperationWrapperUnknown>(
|
|
318
|
-
this.operationBatchGeneration
|
|
318
|
+
this.operationBatchGeneration,
|
|
319
319
|
);
|
|
320
320
|
promiseResults.forEach(r => {
|
|
321
321
|
if (r.status === 'rejected') {
|
|
@@ -345,14 +345,14 @@ export class Batch {
|
|
|
345
345
|
if (task && currentOperationIndex !== -1) {
|
|
346
346
|
operations[currentOperationIndex].onProgress?.(
|
|
347
347
|
progress,
|
|
348
|
-
task
|
|
348
|
+
task,
|
|
349
349
|
);
|
|
350
350
|
}
|
|
351
351
|
},
|
|
352
352
|
onTaskBegin => {
|
|
353
353
|
currentOperationIndex += 1;
|
|
354
354
|
operations[currentOperationIndex].onTaskBegin?.(
|
|
355
|
-
onTaskBegin
|
|
355
|
+
onTaskBegin,
|
|
356
356
|
);
|
|
357
357
|
},
|
|
358
358
|
taskEnd => {
|
|
@@ -363,20 +363,20 @@ export class Batch {
|
|
|
363
363
|
this.collectOperations
|
|
364
364
|
.filter(
|
|
365
365
|
operation =>
|
|
366
|
-
operation.operationId === currentOperationIndex
|
|
366
|
+
operation.operationId === currentOperationIndex,
|
|
367
367
|
)
|
|
368
368
|
.forEach(operation => {
|
|
369
369
|
operation.callback(
|
|
370
370
|
results.slice(
|
|
371
371
|
results.length - operation.count,
|
|
372
|
-
results.length
|
|
373
|
-
)
|
|
372
|
+
results.length,
|
|
373
|
+
),
|
|
374
374
|
);
|
|
375
375
|
});
|
|
376
376
|
|
|
377
377
|
lastCompletedOperationIndex += 1;
|
|
378
378
|
},
|
|
379
|
-
controller
|
|
379
|
+
controller,
|
|
380
380
|
);
|
|
381
381
|
|
|
382
382
|
const errors = results.filter(result => result.result === 'fail');
|
|
@@ -384,7 +384,7 @@ export class Batch {
|
|
|
384
384
|
const error = new Error(
|
|
385
385
|
`Batch failed: ${errors
|
|
386
386
|
.map(e => `error: ${e.error}, message: ${e.message}`)
|
|
387
|
-
.join('\n')}
|
|
387
|
+
.join('\n')}`,
|
|
388
388
|
);
|
|
389
389
|
if (currentOperationIndex !== -1) {
|
|
390
390
|
operations[currentOperationIndex].onException?.(error);
|
|
@@ -394,7 +394,7 @@ export class Batch {
|
|
|
394
394
|
} catch (error) {
|
|
395
395
|
if (currentOperationIndex !== lastCompletedOperationIndex) {
|
|
396
396
|
operations[currentOperationIndex]?.onException?.(
|
|
397
|
-
error as Error
|
|
397
|
+
error as Error,
|
|
398
398
|
);
|
|
399
399
|
}
|
|
400
400
|
throw error;
|
|
@@ -11,7 +11,7 @@ export default (
|
|
|
11
11
|
device: NrfutilDevice,
|
|
12
12
|
data: object,
|
|
13
13
|
onProgress?: OnProgress,
|
|
14
|
-
controller?: AbortController
|
|
14
|
+
controller?: AbortController,
|
|
15
15
|
) => {
|
|
16
16
|
// "operation: 2, command_id: 0" is the command to set the configuration for the board controller.
|
|
17
17
|
const json = {
|
|
@@ -35,6 +35,6 @@ export default (
|
|
|
35
35
|
'x-execute-batch',
|
|
36
36
|
onProgress,
|
|
37
37
|
controller,
|
|
38
|
-
['--batch-json', JSON.stringify(json)]
|
|
38
|
+
['--batch-json', JSON.stringify(json)],
|
|
39
39
|
);
|
|
40
40
|
};
|
package/nrfutil/device/common.ts
CHANGED
|
@@ -153,11 +153,11 @@ export const deviceSingleTaskEndOperation = async <T = void>(
|
|
|
153
153
|
command: string,
|
|
154
154
|
onProgress?: OnProgress,
|
|
155
155
|
controller?: AbortController,
|
|
156
|
-
args: string[] = []
|
|
156
|
+
args: string[] = [],
|
|
157
157
|
) => {
|
|
158
158
|
if (!device.serialNumber) {
|
|
159
159
|
throw new Error(
|
|
160
|
-
`Device does not have a serial number, no device operation is possible
|
|
160
|
+
`Device does not have a serial number, no device operation is possible`,
|
|
161
161
|
);
|
|
162
162
|
}
|
|
163
163
|
const box = await getModule('device');
|
|
@@ -165,7 +165,7 @@ export const deviceSingleTaskEndOperation = async <T = void>(
|
|
|
165
165
|
command,
|
|
166
166
|
onProgress,
|
|
167
167
|
controller,
|
|
168
|
-
[...args, '--serial-number', device.serialNumber]
|
|
168
|
+
[...args, '--serial-number', device.serialNumber],
|
|
169
169
|
);
|
|
170
170
|
};
|
|
171
171
|
|
|
@@ -174,11 +174,11 @@ export const deviceSingleTaskEndOperationVoid = async (
|
|
|
174
174
|
command: string,
|
|
175
175
|
onProgress?: OnProgress,
|
|
176
176
|
controller?: AbortController,
|
|
177
|
-
args: string[] = []
|
|
177
|
+
args: string[] = [],
|
|
178
178
|
) => {
|
|
179
179
|
if (!device.serialNumber) {
|
|
180
180
|
throw new Error(
|
|
181
|
-
`Device does not have a serial number, no device operation is possible
|
|
181
|
+
`Device does not have a serial number, no device operation is possible`,
|
|
182
182
|
);
|
|
183
183
|
}
|
|
184
184
|
|
|
@@ -187,7 +187,7 @@ export const deviceSingleTaskEndOperationVoid = async (
|
|
|
187
187
|
command,
|
|
188
188
|
onProgress,
|
|
189
189
|
controller,
|
|
190
|
-
[...args, '--serial-number', device.serialNumber]
|
|
190
|
+
[...args, '--serial-number', device.serialNumber],
|
|
191
191
|
);
|
|
192
192
|
};
|
|
193
193
|
|