@nordicsemiconductor/pc-nrfconnect-shared 60.0.0-pre1
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/.github/ISSUE_TEMPLATE/custom.md +10 -0
- package/.husky/pre-push +3 -0
- package/.renovaterc.json +10 -0
- package/Changelog.md +2973 -0
- package/LICENSE +35 -0
- package/README.md +11 -0
- package/azure-pipelines.yml +34 -0
- package/config/eslintrc.js +190 -0
- package/config/jest.config.js +41 -0
- package/config/prettier.config.js +13 -0
- package/config/tsconfig.json +15 -0
- package/fw/bootloader/graviton_bootloader_v1.0.1-[nRF5_SDK_15.0.1-1.alpha_f76d012].zip +0 -0
- package/jest.config.js +7 -0
- package/main/index.ts +32 -0
- package/mocks/deviceLibMock.ts +21 -0
- package/mocks/electronMock.ts +15 -0
- package/mocks/electronStoreMock.ts +19 -0
- package/mocks/emptyMock.ts +7 -0
- package/mocks/fileMock.ts +13 -0
- package/mocks/gaMock.ts +9 -0
- package/mocks/mockTests.test.ts +15 -0
- package/mocks/packageJsonMock.ts +10 -0
- package/mocks/remoteMock.ts +17 -0
- package/package.json +132 -0
- package/scripts/check-app-properties.ts +197 -0
- package/scripts/check-for-typescript.ts +41 -0
- package/scripts/esbuild-bootstrap.js +15 -0
- package/scripts/esbuild-renderer.js +131 -0
- package/scripts/esbuild.js +57 -0
- package/scripts/installHusky.ts +17 -0
- package/scripts/nordic-publish.ts +485 -0
- package/scripts/nrfconnect-license.ts +277 -0
- package/scripts/prepare-shared-release.ts +122 -0
- package/scripts/release-shared.test.ts +132 -0
- package/scripts/release-shared.ts +207 -0
- package/src/About/About.tsx +25 -0
- package/src/About/AboutButton.tsx +28 -0
- package/src/About/ApplicationCard.tsx +83 -0
- package/src/About/DeviceCard.tsx +74 -0
- package/src/About/DocumentationCard.tsx +18 -0
- package/src/About/DocumentationSection.tsx +24 -0
- package/src/About/Section.tsx +21 -0
- package/src/About/ShortcutButton.tsx +41 -0
- package/src/About/SupportCard.tsx +97 -0
- package/src/About/about.scss +40 -0
- package/src/About/documentationSlice.ts +41 -0
- package/src/About/section.scss +15 -0
- package/src/About/shortcutSlice.ts +52 -0
- package/src/Alert/Alert.module.scss +29 -0
- package/src/Alert/Alert.tsx +37 -0
- package/src/App/App.test.tsx +47 -0
- package/src/App/App.tsx +227 -0
- package/src/App/ConnectedToStore.tsx +19 -0
- package/src/App/VisibilityBar.tsx +103 -0
- package/src/App/app.scss +83 -0
- package/src/App/appLayout.ts +95 -0
- package/src/App/shared.scss +49 -0
- package/src/App/visibility-bar.scss +55 -0
- package/src/Button/Button.tsx +66 -0
- package/src/Button/button.module.scss +154 -0
- package/src/Card/Card.tsx +26 -0
- package/src/Card/card.module.scss +28 -0
- package/src/Device/BrokenDeviceDialog/BrokenDeviceDialog.tsx +58 -0
- package/src/Device/BrokenDeviceDialog/broken-device-dialog.scss +18 -0
- package/src/Device/BrokenDeviceDialog/brokenDeviceDialogSlice.tsx +48 -0
- package/src/Device/DeviceSelector/BasicDeviceInfo.tsx +115 -0
- package/src/Device/DeviceSelector/DeviceIcon.tsx +27 -0
- package/src/Device/DeviceSelector/DeviceList/AnimatedList.tsx +62 -0
- package/src/Device/DeviceSelector/DeviceList/BrokenDevice.tsx +34 -0
- package/src/Device/DeviceSelector/DeviceList/Device.tsx +84 -0
- package/src/Device/DeviceSelector/DeviceList/DeviceList.tsx +113 -0
- package/src/Device/DeviceSelector/DeviceList/EditDeviceButtons.tsx +28 -0
- package/src/Device/DeviceSelector/DeviceList/MoreDeviceInfo.tsx +65 -0
- package/src/Device/DeviceSelector/DeviceList/RenameDevice.tsx +22 -0
- package/src/Device/DeviceSelector/DeviceList/broken-device.scss +32 -0
- package/src/Device/DeviceSelector/DeviceList/device-list.scss +64 -0
- package/src/Device/DeviceSelector/DeviceList/device.scss +28 -0
- package/src/Device/DeviceSelector/DeviceList/edit-device-buttons.scss +31 -0
- package/src/Device/DeviceSelector/DeviceList/more-device-info.scss +33 -0
- package/src/Device/DeviceSelector/DeviceList/rename-device.scss +13 -0
- package/src/Device/DeviceSelector/DeviceSelector.test.tsx +342 -0
- package/src/Device/DeviceSelector/DeviceSelector.tsx +173 -0
- package/src/Device/DeviceSelector/Favorite.tsx +49 -0
- package/src/Device/DeviceSelector/SelectDevice.tsx +36 -0
- package/src/Device/DeviceSelector/SelectedDevice.tsx +65 -0
- package/src/Device/DeviceSelector/arrow-down.svg +1 -0
- package/src/Device/DeviceSelector/basic-device-info.scss +62 -0
- package/src/Device/DeviceSelector/device-icon.scss +27 -0
- package/src/Device/DeviceSelector/favorite.scss +17 -0
- package/src/Device/DeviceSelector/select-device.scss +38 -0
- package/src/Device/DeviceSelector/selected-device.scss +57 -0
- package/src/Device/DeviceSetup/DeviceSetupView.tsx +102 -0
- package/src/Device/deviceAutoSelectSlice.ts +144 -0
- package/src/Device/deviceInfo/deviceInfo.ts +254 -0
- package/src/Device/deviceInfo/nRF51-Series-logo.svg +1 -0
- package/src/Device/deviceInfo/nRF52-Series-logo.svg +1 -0
- package/src/Device/deviceInfo/nRF53-Series-logo.svg +1 -0
- package/src/Device/deviceInfo/nRF70-Series_no-background_RGB.svg +36 -0
- package/src/Device/deviceInfo/nRF91-Series-logo.svg +1 -0
- package/src/Device/deviceInfo/ppk-logo.svg +1 -0
- package/src/Device/deviceInfo/unknown-logo.svg +30 -0
- package/src/Device/deviceInfo/unknown-nordic-logo.svg +25 -0
- package/src/Device/deviceLibWrapper.test.ts +97 -0
- package/src/Device/deviceLibWrapper.ts +133 -0
- package/src/Device/deviceLister.test.ts +89 -0
- package/src/Device/deviceLister.ts +396 -0
- package/src/Device/deviceSetup.ts +264 -0
- package/src/Device/deviceSetupSlice.ts +94 -0
- package/src/Device/deviceSlice.ts +248 -0
- package/src/Device/dfu-cc.ts +162 -0
- package/src/Device/initPacket.ts +402 -0
- package/src/Device/jprogOperations.ts +206 -0
- package/src/Device/sdfuOperations.ts +601 -0
- package/src/Dialog/Dialog.test.tsx +134 -0
- package/src/Dialog/Dialog.tsx +236 -0
- package/src/Dialog/dialog.scss +60 -0
- package/src/Dropdown/Dropdown.module.scss +83 -0
- package/src/Dropdown/Dropdown.test.tsx +62 -0
- package/src/Dropdown/Dropdown.tsx +106 -0
- package/src/ErrorBoundary/ErrorBoundary.test.tsx +105 -0
- package/src/ErrorBoundary/ErrorBoundary.tsx +186 -0
- package/src/ErrorBoundary/bug.svg +1 -0
- package/src/ErrorBoundary/error-boundary.scss +102 -0
- package/src/ErrorDialog/ErrorDialog.test.tsx +70 -0
- package/src/ErrorDialog/ErrorDialog.tsx +94 -0
- package/src/ErrorDialog/error.scss +14 -0
- package/src/ErrorDialog/errorDialogSlice.test.ts +64 -0
- package/src/ErrorDialog/errorDialogSlice.ts +80 -0
- package/src/FactoryReset/FactoryResetButton.test.tsx +46 -0
- package/src/FactoryReset/FactoryResetButton.tsx +81 -0
- package/src/InlineInput/InlineInput.tsx +170 -0
- package/src/InlineInput/NumberInlineInput.tsx +107 -0
- package/src/InlineInput/inline-input.scss +38 -0
- package/src/InlineInput/number-inline-input.scss +15 -0
- package/src/Log/LogEntry.tsx +62 -0
- package/src/Log/LogViewer.tsx +54 -0
- package/src/Log/log-entry.scss +30 -0
- package/src/Log/log-viewer.scss +24 -0
- package/src/Log/logSlice.ts +73 -0
- package/src/Log/syncLogToStore.ts +36 -0
- package/src/Logo/Logo.tsx +48 -0
- package/src/Logo/logo.scss +11 -0
- package/src/Logo/nordic-logo-blue-icon-only.png +0 -0
- package/src/Logo/nordic-logo-gray-icon-only.png +0 -0
- package/src/Logo/nordic-logo-white-icon-only.png +0 -0
- package/src/Main/Main.tsx +13 -0
- package/src/Main/main.scss +13 -0
- package/src/MasonryLayout/MasonryLayout.tsx +234 -0
- package/src/MasonryLayout/masonryLayout.module.scss +46 -0
- package/src/NavBar/NavBar.tsx +22 -0
- package/src/NavBar/NavMenu.test.tsx +41 -0
- package/src/NavBar/NavMenu.tsx +53 -0
- package/src/NavBar/NavMenuItem.tsx +41 -0
- package/src/NavBar/nav-bar.scss +26 -0
- package/src/NavBar/nav-menu-item.scss +34 -0
- package/src/OpenApp/openApp.ts +18 -0
- package/src/Panes/FeedbackPane.tsx +149 -0
- package/src/PseudoButton/PseudoButton.tsx +56 -0
- package/src/PseudoButton/pseudo-button.scss +11 -0
- package/src/SerialPort/ConflictingSettingsDialog.tsx +242 -0
- package/src/SerialPort/SerialPort.test.ts +54 -0
- package/src/SerialPort/SerialPort.ts +202 -0
- package/src/Shortcuts/Shortcut-item.scss +33 -0
- package/src/Shortcuts/Shortcut-modal.scss +20 -0
- package/src/Shortcuts/ShortcutItem.tsx +48 -0
- package/src/Shortcuts/ShortcutModal.tsx +67 -0
- package/src/SidePanel/Group.tsx +106 -0
- package/src/SidePanel/SidePanel.tsx +19 -0
- package/src/SidePanel/group.scss +42 -0
- package/src/SidePanel/sidepanel.scss +20 -0
- package/src/Slider/Bar.tsx +24 -0
- package/src/Slider/Factor.test.ts +48 -0
- package/src/Slider/Handle.tsx +121 -0
- package/src/Slider/Slider.test.tsx +25 -0
- package/src/Slider/Slider.tsx +91 -0
- package/src/Slider/Ticks.tsx +54 -0
- package/src/Slider/__snapshots__/Slider.test.tsx.snap +50 -0
- package/src/Slider/bar.scss +24 -0
- package/src/Slider/factor.ts +24 -0
- package/src/Slider/handle.scss +32 -0
- package/src/Slider/percentage.ts +67 -0
- package/src/Slider/range.ts +92 -0
- package/src/Slider/slider.scss +14 -0
- package/src/Slider/ticks.scss +28 -0
- package/src/Slider/variables.scss +16 -0
- package/src/StartStopButton/StartStopButton.tsx +60 -0
- package/src/StartStopButton/play-circle.svg +1 -0
- package/src/StartStopButton/start-stop-button.scss +47 -0
- package/src/StartStopButton/stop-circle.svg +1 -0
- package/src/StateSelector/StateSelector.tsx +64 -0
- package/src/StateSelector/state-selector.scss +38 -0
- package/src/Stepper/Stepper.tsx +139 -0
- package/src/Stepper/stepper.scss +127 -0
- package/src/Toggle/Toggle.tsx +120 -0
- package/src/Toggle/toggle.scss +109 -0
- package/src/bootstrap.scss +14 -0
- package/src/index.ts +146 -0
- package/src/logging/appTransport.test.ts +78 -0
- package/src/logging/appTransport.ts +41 -0
- package/src/logging/describeError.test.ts +38 -0
- package/src/logging/describeError.ts +56 -0
- package/src/logging/index.ts +103 -0
- package/src/logging/logBuffer.test.ts +41 -0
- package/src/logging/logBuffer.ts +24 -0
- package/src/logging/sendInitialLogMessages.ts +64 -0
- package/src/store.ts +60 -0
- package/src/svg.d.ts +15 -0
- package/src/utils/AppTypes.ts +60 -0
- package/src/utils/appDirs.ts +78 -0
- package/src/utils/bleChannels.ts +16 -0
- package/src/utils/classNames.test.ts +29 -0
- package/src/utils/classNames.ts +25 -0
- package/src/utils/colors.scss +46 -0
- package/src/utils/colors.ts +38 -0
- package/src/utils/describeVersion.ts +21 -0
- package/src/utils/environment.ts +6 -0
- package/src/utils/logLibVersions.ts +103 -0
- package/src/utils/open.ts +46 -0
- package/src/utils/packageJson.ts +60 -0
- package/src/utils/persistentStore.ts +144 -0
- package/src/utils/systemReport.ts +160 -0
- package/src/utils/truncateMiddle.test.ts +21 -0
- package/src/utils/truncateMiddle.ts +20 -0
- package/src/utils/usageData.ts +189 -0
- package/src/utils/useHotKey.ts +62 -0
- package/src/utils/useStopwatch.test.tsx +311 -0
- package/src/utils/useStopwatch.ts +140 -0
- package/src/variables.scss +820 -0
- package/styles.scss +88 -0
- package/test/dispatchTo.ts +23 -0
- package/test/index.ts +7 -0
- package/test/jestResolver.js +28 -0
- package/test/setupTests.ts +27 -0
- package/test/testUtil.ts +20 -0
- package/test/testrenderer.tsx +39 -0
- package/tsconfig.json +9 -0
- package/typings/externals.d.ts +31 -0
- package/typings/generated/main/index.d.ts +25 -0
- package/typings/generated/src/About/About.d.ts +4 -0
- package/typings/generated/src/About/AboutButton.d.ts +8 -0
- package/typings/generated/src/About/ApplicationCard.d.ts +3 -0
- package/typings/generated/src/About/DeviceCard.d.ts +3 -0
- package/typings/generated/src/About/DocumentationCard.d.ts +3 -0
- package/typings/generated/src/About/DocumentationSection.d.ts +9 -0
- package/typings/generated/src/About/Section.d.ts +8 -0
- package/typings/generated/src/About/ShortcutButton.d.ts +6 -0
- package/typings/generated/src/About/SupportCard.d.ts +3 -0
- package/typings/generated/src/About/documentationSlice.d.ts +12 -0
- package/typings/generated/src/About/shortcutSlice.d.ts +11 -0
- package/typings/generated/src/Alert/Alert.d.ts +10 -0
- package/typings/generated/src/App/App.d.ts +27 -0
- package/typings/generated/src/App/App.test.d.ts +1 -0
- package/typings/generated/src/App/ConnectedToStore.d.ts +7 -0
- package/typings/generated/src/App/VisibilityBar.d.ts +6 -0
- package/typings/generated/src/App/appLayout.d.ts +17 -0
- package/typings/generated/src/Button/Button.d.ts +13 -0
- package/typings/generated/src/Card/Card.d.ts +7 -0
- package/typings/generated/src/Device/BrokenDeviceDialog/BrokenDeviceDialog.d.ts +4 -0
- package/typings/generated/src/Device/BrokenDeviceDialog/brokenDeviceDialogSlice.d.ts +12 -0
- package/typings/generated/src/Device/DeviceSelector/BasicDeviceInfo.d.ts +11 -0
- package/typings/generated/src/Device/DeviceSelector/DeviceIcon.d.ts +7 -0
- package/typings/generated/src/Device/DeviceSelector/DeviceList/AnimatedList.d.ts +10 -0
- package/typings/generated/src/Device/DeviceSelector/DeviceList/BrokenDevice.d.ts +7 -0
- package/typings/generated/src/Device/DeviceSelector/DeviceList/Device.d.ts +10 -0
- package/typings/generated/src/Device/DeviceSelector/DeviceList/DeviceList.d.ts +10 -0
- package/typings/generated/src/Device/DeviceSelector/DeviceList/EditDeviceButtons.d.ts +9 -0
- package/typings/generated/src/Device/DeviceSelector/DeviceList/MoreDeviceInfo.d.ts +7 -0
- package/typings/generated/src/Device/DeviceSelector/DeviceList/RenameDevice.d.ts +6 -0
- package/typings/generated/src/Device/DeviceSelector/DeviceSelector.d.ts +20 -0
- package/typings/generated/src/Device/DeviceSelector/DeviceSelector.test.d.ts +1 -0
- package/typings/generated/src/Device/DeviceSelector/Favorite.d.ts +9 -0
- package/typings/generated/src/Device/DeviceSelector/SelectDevice.d.ts +8 -0
- package/typings/generated/src/Device/DeviceSelector/SelectedDevice.d.ts +7 -0
- package/typings/generated/src/Device/DeviceSetup/DeviceSetupView.d.ts +3 -0
- package/typings/generated/src/Device/deviceAutoSelectSlice.d.ts +28 -0
- package/typings/generated/src/Device/deviceInfo/deviceInfo.d.ts +18 -0
- package/typings/generated/src/Device/deviceLibWrapper.d.ts +8 -0
- package/typings/generated/src/Device/deviceLibWrapper.test.d.ts +1 -0
- package/typings/generated/src/Device/deviceLister.d.ts +25 -0
- package/typings/generated/src/Device/deviceLister.test.d.ts +2 -0
- package/typings/generated/src/Device/deviceSetup.d.ts +40 -0
- package/typings/generated/src/Device/deviceSetupSlice.d.ts +20 -0
- package/typings/generated/src/Device/deviceSlice.d.ts +30 -0
- package/typings/generated/src/Device/dfu-cc.d.ts +3 -0
- package/typings/generated/src/Device/initPacket.d.ts +109 -0
- package/typings/generated/src/Device/jprogOperations.d.ts +2 -0
- package/typings/generated/src/Device/sdfuOperations.d.ts +14 -0
- package/typings/generated/src/Dialog/Dialog.d.ts +64 -0
- package/typings/generated/src/Dialog/Dialog.test.d.ts +1 -0
- package/typings/generated/src/Dropdown/Dropdown.d.ts +16 -0
- package/typings/generated/src/Dropdown/Dropdown.test.d.ts +1 -0
- package/typings/generated/src/ErrorBoundary/ErrorBoundary.d.ts +26 -0
- package/typings/generated/src/ErrorBoundary/ErrorBoundary.test.d.ts +1 -0
- package/typings/generated/src/ErrorDialog/ErrorDialog.d.ts +4 -0
- package/typings/generated/src/ErrorDialog/ErrorDialog.test.d.ts +1 -0
- package/typings/generated/src/ErrorDialog/errorDialogSlice.d.ts +23 -0
- package/typings/generated/src/ErrorDialog/errorDialogSlice.test.d.ts +1 -0
- package/typings/generated/src/FactoryReset/FactoryResetButton.d.ts +12 -0
- package/typings/generated/src/FactoryReset/FactoryResetButton.test.d.ts +1 -0
- package/typings/generated/src/InlineInput/InlineInput.d.ts +14 -0
- package/typings/generated/src/InlineInput/NumberInlineInput.d.ts +12 -0
- package/typings/generated/src/Log/LogEntry.d.ts +7 -0
- package/typings/generated/src/Log/LogViewer.d.ts +5 -0
- package/typings/generated/src/Log/logSlice.d.ts +12 -0
- package/typings/generated/src/Log/syncLogToStore.d.ts +11 -0
- package/typings/generated/src/Logo/Logo.d.ts +6 -0
- package/typings/generated/src/Main/Main.d.ts +6 -0
- package/typings/generated/src/MasonryLayout/MasonryLayout.d.ts +14 -0
- package/typings/generated/src/NavBar/NavBar.d.ts +6 -0
- package/typings/generated/src/NavBar/NavMenu.d.ts +3 -0
- package/typings/generated/src/NavBar/NavMenu.test.d.ts +1 -0
- package/typings/generated/src/NavBar/NavMenuItem.d.ts +10 -0
- package/typings/generated/src/OpenApp/openApp.d.ts +7 -0
- package/typings/generated/src/Panes/FeedbackPane.d.ts +3 -0
- package/typings/generated/src/PseudoButton/PseudoButton.d.ts +10 -0
- package/typings/generated/src/SerialPort/ConflictingSettingsDialog.d.ts +13 -0
- package/typings/generated/src/SerialPort/SerialPort.d.ts +21 -0
- package/typings/generated/src/SerialPort/SerialPort.test.d.ts +1 -0
- package/typings/generated/src/Shortcuts/ShortcutItem.d.ts +8 -0
- package/typings/generated/src/Shortcuts/ShortcutModal.d.ts +8 -0
- package/typings/generated/src/SidePanel/Group.d.ts +16 -0
- package/typings/generated/src/SidePanel/SidePanel.d.ts +7 -0
- package/typings/generated/src/Slider/Bar.d.ts +7 -0
- package/typings/generated/src/Slider/Factor.test.d.ts +1 -0
- package/typings/generated/src/Slider/Handle.d.ts +13 -0
- package/typings/generated/src/Slider/Slider.d.ts +15 -0
- package/typings/generated/src/Slider/Slider.test.d.ts +1 -0
- package/typings/generated/src/Slider/Ticks.d.ts +12 -0
- package/typings/generated/src/Slider/factor.d.ts +1 -0
- package/typings/generated/src/Slider/percentage.d.ts +4 -0
- package/typings/generated/src/Slider/range.d.ts +13 -0
- package/typings/generated/src/StartStopButton/StartStopButton.d.ts +16 -0
- package/typings/generated/src/StateSelector/StateSelector.d.ts +15 -0
- package/typings/generated/src/Stepper/Stepper.d.ts +26 -0
- package/typings/generated/src/Toggle/Toggle.d.ts +19 -0
- package/typings/generated/src/index.d.ts +69 -0
- package/typings/generated/src/logging/appTransport.d.ts +12 -0
- package/typings/generated/src/logging/appTransport.test.d.ts +1 -0
- package/typings/generated/src/logging/describeError.d.ts +2 -0
- package/typings/generated/src/logging/describeError.test.d.ts +1 -0
- package/typings/generated/src/logging/index.d.ts +9 -0
- package/typings/generated/src/logging/logBuffer.d.ts +9 -0
- package/typings/generated/src/logging/logBuffer.test.d.ts +1 -0
- package/typings/generated/src/logging/sendInitialLogMessages.d.ts +2 -0
- package/typings/generated/src/store.d.ts +65 -0
- package/typings/generated/src/utils/AppTypes.d.ts +49 -0
- package/typings/generated/src/utils/appDirs.d.ts +35 -0
- package/typings/generated/src/utils/bleChannels.d.ts +6 -0
- package/typings/generated/src/utils/classNames.d.ts +17 -0
- package/typings/generated/src/utils/classNames.test.d.ts +1 -0
- package/typings/generated/src/utils/colors.d.ts +31 -0
- package/typings/generated/src/utils/describeVersion.d.ts +3 -0
- package/typings/generated/src/utils/environment.d.ts +1 -0
- package/typings/generated/src/utils/logLibVersions.d.ts +2 -0
- package/typings/generated/src/utils/open.d.ts +15 -0
- package/typings/generated/src/utils/packageJson.d.ts +4 -0
- package/typings/generated/src/utils/persistentStore.d.ts +35 -0
- package/typings/generated/src/utils/systemReport.d.ts +4 -0
- package/typings/generated/src/utils/truncateMiddle.d.ts +2 -0
- package/typings/generated/src/utils/truncateMiddle.test.d.ts +1 -0
- package/typings/generated/src/utils/usageData.d.ts +63 -0
- package/typings/generated/src/utils/useHotKey.d.ts +6 -0
- package/typings/generated/src/utils/useStopwatch.d.ts +22 -0
- package/typings/generated/src/utils/useStopwatch.test.d.ts +1 -0
- package/typings/generated/test/dispatchTo.d.ts +3 -0
- package/typings/generated/test/testrenderer.d.ts +5 -0
- package/typings/nrf-intel-hex.d.ts +58 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
Copyright (c) 2017 Nordic Semiconductor ASA
|
|
2
|
+
All rights reserved.
|
|
3
|
+
|
|
4
|
+
SPDX-License-Identifier: Nordic-4-Clause
|
|
5
|
+
|
|
6
|
+
Use in source and binary forms, redistribution in binary form only, with
|
|
7
|
+
or without modification, are permitted provided that the following conditions
|
|
8
|
+
are met:
|
|
9
|
+
|
|
10
|
+
1. Redistributions in binary form, except as embedded into a Nordic
|
|
11
|
+
Semiconductor ASA integrated circuit in a product or a software update for
|
|
12
|
+
such product, must reproduce the above copyright notice, this list of
|
|
13
|
+
conditions and the following disclaimer in the documentation and/or other
|
|
14
|
+
materials provided with the distribution.
|
|
15
|
+
|
|
16
|
+
2. Neither the name of Nordic Semiconductor ASA nor the names of its
|
|
17
|
+
contributors may be used to endorse or promote products derived from this
|
|
18
|
+
software without specific prior written permission.
|
|
19
|
+
|
|
20
|
+
3. This software, with or without modification, must only be used with a Nordic
|
|
21
|
+
Semiconductor ASA integrated circuit.
|
|
22
|
+
|
|
23
|
+
4. Any software provided in binary form under this license must not be reverse
|
|
24
|
+
engineered, decompiled, modified and/or disassembled.
|
|
25
|
+
|
|
26
|
+
THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS OR
|
|
27
|
+
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
28
|
+
MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
29
|
+
DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE LIABLE
|
|
30
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
31
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
32
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
33
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
|
34
|
+
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
35
|
+
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/README.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Shared commodities for developing nRF Connect for Desktop
|
|
2
|
+
|
|
3
|
+
[](https://dev.azure.com/NordicSemiconductor/Wayland/_build/latest?definitionId=31&branchName=master)
|
|
4
|
+
|
|
5
|
+
This project provides shared commodities for developing nRF Connect for Desktop
|
|
6
|
+
apps and their launcher:
|
|
7
|
+
|
|
8
|
+
- React components
|
|
9
|
+
- Build scripts
|
|
10
|
+
- Configurations
|
|
11
|
+
- Test facilities
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
trigger:
|
|
2
|
+
- main
|
|
3
|
+
pool:
|
|
4
|
+
vmImage: 'ubuntu-latest'
|
|
5
|
+
variables:
|
|
6
|
+
- group: wayland
|
|
7
|
+
steps:
|
|
8
|
+
- task: NodeTool@0
|
|
9
|
+
inputs:
|
|
10
|
+
versionSpec: 18
|
|
11
|
+
- script: |
|
|
12
|
+
set -o errexit -o pipefail
|
|
13
|
+
npm ci
|
|
14
|
+
npm run check
|
|
15
|
+
npm run generate-types
|
|
16
|
+
npm test -- --coverage --coverageReporters=cobertura
|
|
17
|
+
npm pack
|
|
18
|
+
displayName: 'Build, Test and Pack'
|
|
19
|
+
- bash: |
|
|
20
|
+
set -o errexit -o pipefail
|
|
21
|
+
cp *.tgz "$(Build.ArtifactStagingDirectory)"
|
|
22
|
+
#Leave for now, testing purposes.
|
|
23
|
+
#condition: ne(variables['Build.Reason'], 'PullRequest')
|
|
24
|
+
displayName: 'Copy Artifacts'
|
|
25
|
+
- task: PublishCodeCoverageResults@1
|
|
26
|
+
displayName: Publish code coverage
|
|
27
|
+
inputs:
|
|
28
|
+
codeCoverageTool: Cobertura
|
|
29
|
+
summaryFileLocation: $(System.DefaultWorkingDirectory)/coverage/cobertura-coverage.xml
|
|
30
|
+
- task: PublishPipelineArtifact@1
|
|
31
|
+
inputs:
|
|
32
|
+
targetPath: $(Build.ArtifactStagingDirectory)
|
|
33
|
+
publishLocation: 'pipeline'
|
|
34
|
+
displayName: 'Publish artifacts to artifact storage'
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2022 Nordic Semiconductor ASA
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
const fs = require('fs');
|
|
8
|
+
|
|
9
|
+
const entriesInGitignore = fs
|
|
10
|
+
.readFileSync('.gitignore', 'utf8')
|
|
11
|
+
.split('\n')
|
|
12
|
+
.filter(Boolean);
|
|
13
|
+
|
|
14
|
+
module.exports = {
|
|
15
|
+
reportUnusedDisableDirectives: true,
|
|
16
|
+
parser: '@typescript-eslint/parser',
|
|
17
|
+
extends: [
|
|
18
|
+
'eslint:recommended',
|
|
19
|
+
'airbnb',
|
|
20
|
+
'plugin:@typescript-eslint/recommended',
|
|
21
|
+
'plugin:import/recommended',
|
|
22
|
+
'plugin:import/typescript',
|
|
23
|
+
'prettier',
|
|
24
|
+
],
|
|
25
|
+
ignorePatterns: [
|
|
26
|
+
'package-lock.json',
|
|
27
|
+
'scripts/nordic-publish.js',
|
|
28
|
+
'typings/generated',
|
|
29
|
+
...entriesInGitignore,
|
|
30
|
+
],
|
|
31
|
+
rules: {
|
|
32
|
+
'prefer-destructuring': 'off',
|
|
33
|
+
'@typescript-eslint/ban-ts-comment': [
|
|
34
|
+
'error',
|
|
35
|
+
{ 'ts-expect-error': 'allow-with-description' },
|
|
36
|
+
],
|
|
37
|
+
'@typescript-eslint/no-empty-function': 'off',
|
|
38
|
+
'@typescript-eslint/no-shadow': 'error',
|
|
39
|
+
'@typescript-eslint/no-var-requires': 'off',
|
|
40
|
+
'import/default': 'error',
|
|
41
|
+
'import/extensions': 'off',
|
|
42
|
+
'import/named': 'error',
|
|
43
|
+
'import/no-extraneous-dependencies': 'off',
|
|
44
|
+
'import/no-unresolved': [
|
|
45
|
+
'error',
|
|
46
|
+
{
|
|
47
|
+
ignore: [
|
|
48
|
+
'serialport',
|
|
49
|
+
'electron',
|
|
50
|
+
'pc-nrfconnect-shared',
|
|
51
|
+
'@electron/remote',
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
'import/prefer-default-export': 'off',
|
|
56
|
+
'jsx-a11y/control-has-associated-label': 'off',
|
|
57
|
+
'linebreak-style': 'off',
|
|
58
|
+
'lines-between-class-members': 'off',
|
|
59
|
+
'md/remark': [
|
|
60
|
+
'error',
|
|
61
|
+
{
|
|
62
|
+
plugins: [
|
|
63
|
+
'preset-lint-markdown-style-guide',
|
|
64
|
+
'frontmatter',
|
|
65
|
+
['lint-no-duplicate-headings', false],
|
|
66
|
+
['lint-list-item-indent', false],
|
|
67
|
+
['lint-emphasis-marker', false],
|
|
68
|
+
['lint-list-item-spacing', false],
|
|
69
|
+
['lint-no-literal-urls', false],
|
|
70
|
+
],
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
'no-console': 'off',
|
|
74
|
+
'no-param-reassign': 'off',
|
|
75
|
+
'no-shadow': 'off',
|
|
76
|
+
'no-undef': 'error',
|
|
77
|
+
'no-unused-expressions': 'off',
|
|
78
|
+
'no-use-before-define': 'off',
|
|
79
|
+
'prettier/prettier': 'error',
|
|
80
|
+
'react-hooks/exhaustive-deps': 'error',
|
|
81
|
+
'react-hooks/rules-of-hooks': 'error',
|
|
82
|
+
'react/function-component-definition': [
|
|
83
|
+
'error',
|
|
84
|
+
{
|
|
85
|
+
namedComponents: 'arrow-function',
|
|
86
|
+
unnamedComponents: 'arrow-function',
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
'react/jsx-filename-extension': [
|
|
90
|
+
'error',
|
|
91
|
+
{ extensions: ['.jsx', '.tsx'] },
|
|
92
|
+
],
|
|
93
|
+
'react/jsx-key': ['error', { checkFragmentShorthand: true }],
|
|
94
|
+
'react/jsx-no-useless-fragment': ['error', { allowExpression: true }],
|
|
95
|
+
'react/jsx-one-expression-per-line': 'off',
|
|
96
|
+
'react/jsx-props-no-spreading': 'off',
|
|
97
|
+
'react/require-default-props': 'off',
|
|
98
|
+
'require-await': 'error',
|
|
99
|
+
'simple-import-sort/imports': [
|
|
100
|
+
'error',
|
|
101
|
+
{
|
|
102
|
+
/* This configures the order of the imports.
|
|
103
|
+
The obscure format using regexps is described at
|
|
104
|
+
https://github.com/lydell/eslint-plugin-simple-import-sort#custom-grouping
|
|
105
|
+
and there are examples at
|
|
106
|
+
https://github.com/lydell/eslint-plugin-simple-import-sort/blob/main/examples/.eslintrc.js
|
|
107
|
+
*/
|
|
108
|
+
groups: [
|
|
109
|
+
// First all side effect imports. That strange token is
|
|
110
|
+
// described in the eslint-plugin-simple-import-sort docs
|
|
111
|
+
['^\\u0000'],
|
|
112
|
+
|
|
113
|
+
// All package imports (starting with a letter, optionally
|
|
114
|
+
// prepended by an '@'), with React packages coming first.
|
|
115
|
+
['^react', '^@?\\w'],
|
|
116
|
+
|
|
117
|
+
// All relative imports (starting with a '.')
|
|
118
|
+
['^\\.'],
|
|
119
|
+
|
|
120
|
+
// All styles imports (ending with '.css' or '.scss')
|
|
121
|
+
['^.+\\.s?css$'],
|
|
122
|
+
],
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
'valid-jsdoc': ['error', { prefer: { return: 'returns' } }],
|
|
126
|
+
},
|
|
127
|
+
overrides: [
|
|
128
|
+
{
|
|
129
|
+
files: ['*.d.ts'],
|
|
130
|
+
rules: {
|
|
131
|
+
'max-classes-per-file': 'off',
|
|
132
|
+
'react/prefer-stateless-function': 'off',
|
|
133
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
files: ['*.ts', '*.tsx'],
|
|
138
|
+
rules: {
|
|
139
|
+
'default-case': 'off',
|
|
140
|
+
'consistent-return': 'off',
|
|
141
|
+
'react/prop-types': 'off',
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
files: ['*.md'],
|
|
146
|
+
parser: 'markdown-eslint-parser',
|
|
147
|
+
rules: {
|
|
148
|
+
'prettier/prettier': ['error', { parser: 'markdown' }],
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
files: ['*.test.*'],
|
|
153
|
+
rules: {
|
|
154
|
+
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
files: ['*.json'],
|
|
159
|
+
rules: {
|
|
160
|
+
'no-template-curly-in-string': 'off',
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
files: [
|
|
165
|
+
'**/__tests__/**/*.[jt]s?(x)',
|
|
166
|
+
'**/?(*.)+(spec|test).[jt]s?(x)',
|
|
167
|
+
],
|
|
168
|
+
extends: ['plugin:testing-library/react'],
|
|
169
|
+
},
|
|
170
|
+
],
|
|
171
|
+
plugins: [
|
|
172
|
+
'react',
|
|
173
|
+
'import',
|
|
174
|
+
'react-hooks',
|
|
175
|
+
'prettier',
|
|
176
|
+
'simple-import-sort',
|
|
177
|
+
'md',
|
|
178
|
+
],
|
|
179
|
+
env: {
|
|
180
|
+
es6: true,
|
|
181
|
+
browser: true,
|
|
182
|
+
node: true,
|
|
183
|
+
jasmine: true,
|
|
184
|
+
jest: true,
|
|
185
|
+
},
|
|
186
|
+
globals: {
|
|
187
|
+
NodeJS: true,
|
|
188
|
+
React: true,
|
|
189
|
+
},
|
|
190
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2022 Nordic Semiconductor ASA
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
const path = require('path');
|
|
8
|
+
|
|
9
|
+
const mockDir = path.join(__dirname, '..', 'mocks');
|
|
10
|
+
|
|
11
|
+
module.exports = (disabledMocks = []) => ({
|
|
12
|
+
testEnvironment: 'jsdom',
|
|
13
|
+
moduleNameMapper: {
|
|
14
|
+
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2)$': `${mockDir}/fileMock.ts`,
|
|
15
|
+
'\\.(css|scss)$': `${mockDir}/emptyMock.ts`,
|
|
16
|
+
'pc-nrfjprog-js|nrf-device-setup|usb': `${mockDir}/emptyMock.ts`,
|
|
17
|
+
'^electron$': `${mockDir}/electronMock.ts`,
|
|
18
|
+
'^electron-store$': `${mockDir}/electronStoreMock.ts`,
|
|
19
|
+
'@nordicsemiconductor/nrf-device-lib-js': `${mockDir}/deviceLibMock.ts`,
|
|
20
|
+
'@electron/remote': `${mockDir}/remoteMock.ts`,
|
|
21
|
+
...(disabledMocks.includes('packageJson')
|
|
22
|
+
? {}
|
|
23
|
+
: {
|
|
24
|
+
packageJson$: `${mockDir}/packageJsonMock.ts`,
|
|
25
|
+
}),
|
|
26
|
+
...(disabledMocks.includes('react-ga')
|
|
27
|
+
? {}
|
|
28
|
+
: { '^react-ga$': `${mockDir}/gaMock.ts` }),
|
|
29
|
+
...(disabledMocks.includes('serialport')
|
|
30
|
+
? {}
|
|
31
|
+
: { serialport: `${mockDir}/emptyMock.ts` }),
|
|
32
|
+
},
|
|
33
|
+
transform: {
|
|
34
|
+
'^.+\\.[jt]sx?$': '@swc/jest',
|
|
35
|
+
},
|
|
36
|
+
transformIgnorePatterns: ['node_modules/(?!(pc-nrfconnect-shared)/)'],
|
|
37
|
+
setupFilesAfterEnv: [`${__dirname}/../test/setupTests.ts`],
|
|
38
|
+
snapshotSerializers: ['enzyme-to-json/serializer'],
|
|
39
|
+
resolver: `${__dirname}/../test/jestResolver.js`,
|
|
40
|
+
modulePathIgnorePatterns: ['dist'],
|
|
41
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"ts-node": { "swc": true },
|
|
3
|
+
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"target": "ES2020",
|
|
6
|
+
"moduleResolution": "node",
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"jsx": "react",
|
|
9
|
+
|
|
10
|
+
"strict": true,
|
|
11
|
+
"isolatedModules": true,
|
|
12
|
+
"forceConsistentCasingInFileNames": true,
|
|
13
|
+
"resolveJsonModule": true
|
|
14
|
+
}
|
|
15
|
+
}
|
|
Binary file
|
package/jest.config.js
ADDED
package/main/index.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2022 Nordic Semiconductor ASA
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export const SERIALPORT_CHANNEL = {
|
|
8
|
+
OPEN: 'serialport:open',
|
|
9
|
+
CLOSE: 'serialport:close',
|
|
10
|
+
WRITE: 'serialport:write',
|
|
11
|
+
UPDATE: 'serialport:update',
|
|
12
|
+
SET: 'serialport:set',
|
|
13
|
+
|
|
14
|
+
ON_CLOSED: 'serialport:on-close',
|
|
15
|
+
ON_DATA: 'serialport:on-data',
|
|
16
|
+
ON_UPDATE: 'serialport:on-update',
|
|
17
|
+
ON_SET: 'serialport:on-set',
|
|
18
|
+
ON_CHANGED: 'serialport:on-changed',
|
|
19
|
+
ON_WRITE: 'serialport:on-write',
|
|
20
|
+
|
|
21
|
+
IS_OPEN: 'serialport:is-open',
|
|
22
|
+
GET_OPTIONS: 'serialport:get-options',
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export type OverwriteOptions = {
|
|
26
|
+
overwrite?: boolean;
|
|
27
|
+
settingsLocked?: boolean;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export type OpenAppOptions = {
|
|
31
|
+
device?: { serialNumber: string; serialPortPath?: string };
|
|
32
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021 Nordic Semiconductor ASA
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export const createContext = jest.fn().mockReturnValue(1);
|
|
8
|
+
export const setTimeoutConfig = jest.fn();
|
|
9
|
+
export const startLogEvents = jest.fn();
|
|
10
|
+
export const stopLogEvents = jest.fn();
|
|
11
|
+
export const setLogLevel = jest.fn();
|
|
12
|
+
export const setLogPattern = jest.fn();
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
createContext,
|
|
16
|
+
setTimeoutConfig,
|
|
17
|
+
startLogEvents,
|
|
18
|
+
stopLogEvents,
|
|
19
|
+
setLogLevel,
|
|
20
|
+
setLogPattern,
|
|
21
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021 Nordic Semiconductor ASA
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
// Allows jest to test files that import the electron package.
|
|
8
|
+
|
|
9
|
+
export const match = jest.fn();
|
|
10
|
+
export const app = jest.fn();
|
|
11
|
+
export const dialog = jest.fn();
|
|
12
|
+
export const ipcRenderer = {
|
|
13
|
+
once: jest.fn(),
|
|
14
|
+
send: jest.fn(),
|
|
15
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021 Nordic Semiconductor ASA
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
// Allows jest to test files that import the electron-store package.
|
|
8
|
+
|
|
9
|
+
export default jest.fn(() => {
|
|
10
|
+
const cache = new Map();
|
|
11
|
+
return {
|
|
12
|
+
get: jest.fn(
|
|
13
|
+
(key: string, defaultValue?: unknown) =>
|
|
14
|
+
cache.get(key) ?? defaultValue
|
|
15
|
+
),
|
|
16
|
+
set: jest.fn(cache.set.bind(cache)),
|
|
17
|
+
clear: jest.fn(cache.clear.bind(cache)),
|
|
18
|
+
};
|
|
19
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021 Nordic Semiconductor ASA
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
// Allows jest to test files that import images, fonts, etc. Jest cannot
|
|
8
|
+
// parse things like this, so we have to mock them. This mock just returns
|
|
9
|
+
// 'test-file-stub' for files that match the moduleNameMapper expression
|
|
10
|
+
// in package.json.
|
|
11
|
+
// Ref: https://facebook.github.io/jest/docs/tutorial-webpack.html
|
|
12
|
+
|
|
13
|
+
export default 'test-file-stub';
|
package/mocks/gaMock.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023 Nordic Semiconductor ASA
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
test('electron-store', () => {
|
|
8
|
+
const Store = jest.requireMock('electron-store').default;
|
|
9
|
+
const store = new Store();
|
|
10
|
+
expect(store.get('test', 'default')).toEqual('default');
|
|
11
|
+
store.set('test', 'newValue');
|
|
12
|
+
expect(store.get('test', 'default')).toEqual('newValue');
|
|
13
|
+
store.clear();
|
|
14
|
+
expect(store.get('test', 'default')).toEqual('default');
|
|
15
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021 Nordic Semiconductor ASA
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
// Allows jest to test files that import the electron package.
|
|
8
|
+
|
|
9
|
+
export const dialog = jest.fn();
|
|
10
|
+
export const getCurrentWindow = () => ({
|
|
11
|
+
reload: jest.fn(),
|
|
12
|
+
|
|
13
|
+
getTitle: () => 'Not launcher',
|
|
14
|
+
});
|
|
15
|
+
export const app = {
|
|
16
|
+
getAppPath: () => process.cwd(),
|
|
17
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nordicsemiconductor/pc-nrfconnect-shared",
|
|
3
|
+
"version": "60.0.0-pre1",
|
|
4
|
+
"description": "Shared commodities for developing pc-nrfconnect-* packages",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/NordicSemiconductor/pc-nrfconnect-shared.git"
|
|
8
|
+
},
|
|
9
|
+
"author": "Nordic Semiconductor ASA",
|
|
10
|
+
"license": "ISC",
|
|
11
|
+
"bin": {
|
|
12
|
+
"check-for-typescript": "./scripts/check-for-typescript.ts",
|
|
13
|
+
"check-app-properties": "./scripts/check-app-properties.ts",
|
|
14
|
+
"nordic-publish": "./scripts/nordic-publish.ts",
|
|
15
|
+
"nrfconnect-license": "./scripts/nrfconnect-license.ts",
|
|
16
|
+
"run-esbuild": "./scripts/esbuild.js"
|
|
17
|
+
},
|
|
18
|
+
"main": "src",
|
|
19
|
+
"scripts": {
|
|
20
|
+
"test": "jest",
|
|
21
|
+
"check": "run-p --silent --continue-on-error --print-label check:*",
|
|
22
|
+
"check:lint": "eslint --color .",
|
|
23
|
+
"check:types": "tsc --noEmit",
|
|
24
|
+
"check:license": "ts-node scripts/nrfconnect-license.ts check",
|
|
25
|
+
"generate-types": "tsc --emitDeclarationOnly --declaration --outDir ./typings/generated",
|
|
26
|
+
"prepare": "ts-node scripts/installHusky.ts",
|
|
27
|
+
"compile:publish": "esbuild scripts/nordic-publish.ts --bundle --outfile=scripts/nordic-publish.js --platform=node --log-level=warning --minify",
|
|
28
|
+
"compile:bootstrap": "node scripts/esbuild-bootstrap.js",
|
|
29
|
+
"release-shared": "ts-node scripts/release-shared.ts",
|
|
30
|
+
"prepare-shared-release": "ts-node scripts/prepare-shared-release.ts",
|
|
31
|
+
"postinstall": "run-p compile:*"
|
|
32
|
+
},
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"@nordicsemiconductor/nrf-device-lib-js": "*"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@electron/remote": "^2.0.4",
|
|
38
|
+
"@mdi/font": "7.2.96",
|
|
39
|
+
"@reduxjs/toolkit": "1.9.3",
|
|
40
|
+
"@svgr/core": "^7.0.0",
|
|
41
|
+
"@svgr/plugin-jsx": "7.0.0",
|
|
42
|
+
"@swc/core": "1.3.56",
|
|
43
|
+
"@swc/jest": "0.2.24",
|
|
44
|
+
"@testing-library/jest-dom": "5.16.5",
|
|
45
|
+
"@testing-library/react": "10.4.9",
|
|
46
|
+
"@types/adm-zip": "^0.5.0",
|
|
47
|
+
"@types/date-fns": "^2.6.0",
|
|
48
|
+
"@types/enzyme": "3.10.12",
|
|
49
|
+
"@types/enzyme-adapter-react-16": "1.0.6",
|
|
50
|
+
"@types/ftp": "0.3.33",
|
|
51
|
+
"@types/klaw": "3.0.3",
|
|
52
|
+
"@types/lodash.range": "3.2.7",
|
|
53
|
+
"@types/mousetrap": "1.6.11",
|
|
54
|
+
"@types/react": "17.0.55",
|
|
55
|
+
"@types/react-dom": "17.0.19",
|
|
56
|
+
"@types/react-redux": "7.1.25",
|
|
57
|
+
"@types/semver": "7.3.13",
|
|
58
|
+
"@types/shasum": "1.0.0",
|
|
59
|
+
"@types/triple-beam": "1.3.2",
|
|
60
|
+
"@types/uuid": "8.3.4",
|
|
61
|
+
"@typescript-eslint/eslint-plugin": "5.57.1",
|
|
62
|
+
"@typescript-eslint/parser": "5.57.1",
|
|
63
|
+
"adm-zip": "^0.5.5",
|
|
64
|
+
"assert": "2.0.0",
|
|
65
|
+
"bootstrap": "4.6.2",
|
|
66
|
+
"commander": "10.0.0",
|
|
67
|
+
"date-fns": "2.29.3",
|
|
68
|
+
"electron": "22.3.5",
|
|
69
|
+
"electron-store": "8.1.0",
|
|
70
|
+
"enzyme": "3.11.0",
|
|
71
|
+
"enzyme-adapter-react-16": "1.15.7",
|
|
72
|
+
"enzyme-to-json": "3.6.2",
|
|
73
|
+
"esbuild": "^0.17.18",
|
|
74
|
+
"esbuild-sass-plugin": "^2.9.0",
|
|
75
|
+
"eslint": "8.37.0",
|
|
76
|
+
"eslint-config-airbnb": "19.0.4",
|
|
77
|
+
"eslint-config-prettier": "8.8.0",
|
|
78
|
+
"eslint-import-resolver-typescript": "3.5.5",
|
|
79
|
+
"eslint-plugin-import": "2.27.5",
|
|
80
|
+
"eslint-plugin-jsx-a11y": "6.7.1",
|
|
81
|
+
"eslint-plugin-md": "^1.0.19",
|
|
82
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
83
|
+
"eslint-plugin-react": "7.32.2",
|
|
84
|
+
"eslint-plugin-react-hooks": "4.6.0",
|
|
85
|
+
"eslint-plugin-simple-import-sort": "10.0.0",
|
|
86
|
+
"eslint-plugin-testing-library": "^5.6.0",
|
|
87
|
+
"events": "3.3.0",
|
|
88
|
+
"fast-glob": "3.2.12",
|
|
89
|
+
"focus-visible": "5.2.0",
|
|
90
|
+
"ftp": "0.3.10",
|
|
91
|
+
"husky": "8.0.3",
|
|
92
|
+
"jest": "29.5.0",
|
|
93
|
+
"jest-environment-jsdom": "29.5.0",
|
|
94
|
+
"klaw": "4.1.0",
|
|
95
|
+
"lodash.range": "3.2.0",
|
|
96
|
+
"mousetrap": "1.6.5",
|
|
97
|
+
"npm-run-all2": "6.0.5",
|
|
98
|
+
"nrf-intel-hex": "^1.3.0",
|
|
99
|
+
"postcss-modules": "^6.0.0",
|
|
100
|
+
"prettier": "2.8.8",
|
|
101
|
+
"prettysize": "2.0.0",
|
|
102
|
+
"protobufjs": "^7.0.0",
|
|
103
|
+
"react": "16.14.0",
|
|
104
|
+
"react-bootstrap": "1.6.6",
|
|
105
|
+
"react-dom": "16.14.0",
|
|
106
|
+
"react-flip-toolkit": "7.0.17",
|
|
107
|
+
"react-ga": "2.7.0",
|
|
108
|
+
"react-markdown": "4.3.1",
|
|
109
|
+
"react-redux": "7.2.9",
|
|
110
|
+
"react-resize-detector": "6.7.8",
|
|
111
|
+
"react-test-renderer": "16.14.0",
|
|
112
|
+
"redux": "4.2.1",
|
|
113
|
+
"redux-devtools-extension": "2.13.9",
|
|
114
|
+
"redux-thunk": "2.4.2",
|
|
115
|
+
"rimraf": "3.0.2",
|
|
116
|
+
"roboto-fontface": "0.10.0",
|
|
117
|
+
"semver": "7.3.8",
|
|
118
|
+
"serialport": "^10.5.0",
|
|
119
|
+
"shasum": "1.0.2",
|
|
120
|
+
"systeminformation": "5.17.12",
|
|
121
|
+
"ts-node": "10.9.1",
|
|
122
|
+
"typescript": "4.9.5",
|
|
123
|
+
"util": "0.12.5",
|
|
124
|
+
"uuid": "8.3.2",
|
|
125
|
+
"winston": "3.8.2"
|
|
126
|
+
},
|
|
127
|
+
"typings": "./typings/generated/src/index.d.ts",
|
|
128
|
+
"eslintConfig": {
|
|
129
|
+
"extends": "./config/eslintrc"
|
|
130
|
+
},
|
|
131
|
+
"prettier": "./config/prettier.config.js"
|
|
132
|
+
}
|