@nordicsemiconductor/pc-nrfconnect-shared 60.0.0-pre1 → 60.0.0-pre2

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.
Files changed (232) hide show
  1. package/dist/bootstrap.css +8951 -0
  2. package/dist/index.css +1451 -0
  3. package/dist/index.js +122119 -0
  4. package/{src/Logo/nordic-logo-blue-icon-only.png → dist/nordic-logo-blue-icon-only-H7BABN6D.png} +0 -0
  5. package/{src/Logo/nordic-logo-gray-icon-only.png → dist/nordic-logo-gray-icon-only-GATOTR3L.png} +0 -0
  6. package/package.json +12 -3
  7. package/typings/generated/src/Device/deviceInfo/deviceInfo.d.ts +1 -2
  8. package/.github/ISSUE_TEMPLATE/custom.md +0 -10
  9. package/.husky/pre-push +0 -3
  10. package/.renovaterc.json +0 -10
  11. package/Changelog.md +0 -2973
  12. package/azure-pipelines.yml +0 -34
  13. package/config/eslintrc.js +0 -190
  14. package/config/jest.config.js +0 -41
  15. package/config/prettier.config.js +0 -13
  16. package/config/tsconfig.json +0 -15
  17. package/fw/bootloader/graviton_bootloader_v1.0.1-[nRF5_SDK_15.0.1-1.alpha_f76d012].zip +0 -0
  18. package/jest.config.js +0 -7
  19. package/main/index.ts +0 -32
  20. package/mocks/deviceLibMock.ts +0 -21
  21. package/mocks/electronMock.ts +0 -15
  22. package/mocks/electronStoreMock.ts +0 -19
  23. package/mocks/emptyMock.ts +0 -7
  24. package/mocks/fileMock.ts +0 -13
  25. package/mocks/gaMock.ts +0 -9
  26. package/mocks/mockTests.test.ts +0 -15
  27. package/mocks/packageJsonMock.ts +0 -10
  28. package/mocks/remoteMock.ts +0 -17
  29. package/scripts/esbuild-bootstrap.js +0 -15
  30. package/scripts/esbuild-renderer.js +0 -131
  31. package/scripts/installHusky.ts +0 -17
  32. package/scripts/prepare-shared-release.ts +0 -122
  33. package/scripts/release-shared.test.ts +0 -132
  34. package/scripts/release-shared.ts +0 -207
  35. package/src/About/About.tsx +0 -25
  36. package/src/About/AboutButton.tsx +0 -28
  37. package/src/About/ApplicationCard.tsx +0 -83
  38. package/src/About/DeviceCard.tsx +0 -74
  39. package/src/About/DocumentationCard.tsx +0 -18
  40. package/src/About/DocumentationSection.tsx +0 -24
  41. package/src/About/Section.tsx +0 -21
  42. package/src/About/ShortcutButton.tsx +0 -41
  43. package/src/About/SupportCard.tsx +0 -97
  44. package/src/About/about.scss +0 -40
  45. package/src/About/documentationSlice.ts +0 -41
  46. package/src/About/section.scss +0 -15
  47. package/src/About/shortcutSlice.ts +0 -52
  48. package/src/Alert/Alert.module.scss +0 -29
  49. package/src/Alert/Alert.tsx +0 -37
  50. package/src/App/App.test.tsx +0 -47
  51. package/src/App/App.tsx +0 -227
  52. package/src/App/ConnectedToStore.tsx +0 -19
  53. package/src/App/VisibilityBar.tsx +0 -103
  54. package/src/App/app.scss +0 -83
  55. package/src/App/appLayout.ts +0 -95
  56. package/src/App/shared.scss +0 -49
  57. package/src/App/visibility-bar.scss +0 -55
  58. package/src/Button/Button.tsx +0 -66
  59. package/src/Button/button.module.scss +0 -154
  60. package/src/Card/Card.tsx +0 -26
  61. package/src/Card/card.module.scss +0 -28
  62. package/src/Device/BrokenDeviceDialog/BrokenDeviceDialog.tsx +0 -58
  63. package/src/Device/BrokenDeviceDialog/broken-device-dialog.scss +0 -18
  64. package/src/Device/BrokenDeviceDialog/brokenDeviceDialogSlice.tsx +0 -48
  65. package/src/Device/DeviceSelector/BasicDeviceInfo.tsx +0 -115
  66. package/src/Device/DeviceSelector/DeviceIcon.tsx +0 -27
  67. package/src/Device/DeviceSelector/DeviceList/AnimatedList.tsx +0 -62
  68. package/src/Device/DeviceSelector/DeviceList/BrokenDevice.tsx +0 -34
  69. package/src/Device/DeviceSelector/DeviceList/Device.tsx +0 -84
  70. package/src/Device/DeviceSelector/DeviceList/DeviceList.tsx +0 -113
  71. package/src/Device/DeviceSelector/DeviceList/EditDeviceButtons.tsx +0 -28
  72. package/src/Device/DeviceSelector/DeviceList/MoreDeviceInfo.tsx +0 -65
  73. package/src/Device/DeviceSelector/DeviceList/RenameDevice.tsx +0 -22
  74. package/src/Device/DeviceSelector/DeviceList/broken-device.scss +0 -32
  75. package/src/Device/DeviceSelector/DeviceList/device-list.scss +0 -64
  76. package/src/Device/DeviceSelector/DeviceList/device.scss +0 -28
  77. package/src/Device/DeviceSelector/DeviceList/edit-device-buttons.scss +0 -31
  78. package/src/Device/DeviceSelector/DeviceList/more-device-info.scss +0 -33
  79. package/src/Device/DeviceSelector/DeviceList/rename-device.scss +0 -13
  80. package/src/Device/DeviceSelector/DeviceSelector.test.tsx +0 -342
  81. package/src/Device/DeviceSelector/DeviceSelector.tsx +0 -173
  82. package/src/Device/DeviceSelector/Favorite.tsx +0 -49
  83. package/src/Device/DeviceSelector/SelectDevice.tsx +0 -36
  84. package/src/Device/DeviceSelector/SelectedDevice.tsx +0 -65
  85. package/src/Device/DeviceSelector/arrow-down.svg +0 -1
  86. package/src/Device/DeviceSelector/basic-device-info.scss +0 -62
  87. package/src/Device/DeviceSelector/device-icon.scss +0 -27
  88. package/src/Device/DeviceSelector/favorite.scss +0 -17
  89. package/src/Device/DeviceSelector/select-device.scss +0 -38
  90. package/src/Device/DeviceSelector/selected-device.scss +0 -57
  91. package/src/Device/DeviceSetup/DeviceSetupView.tsx +0 -102
  92. package/src/Device/deviceAutoSelectSlice.ts +0 -144
  93. package/src/Device/deviceInfo/deviceInfo.ts +0 -254
  94. package/src/Device/deviceInfo/nRF51-Series-logo.svg +0 -1
  95. package/src/Device/deviceInfo/nRF52-Series-logo.svg +0 -1
  96. package/src/Device/deviceInfo/nRF53-Series-logo.svg +0 -1
  97. package/src/Device/deviceInfo/nRF70-Series_no-background_RGB.svg +0 -36
  98. package/src/Device/deviceInfo/nRF91-Series-logo.svg +0 -1
  99. package/src/Device/deviceInfo/ppk-logo.svg +0 -1
  100. package/src/Device/deviceInfo/unknown-logo.svg +0 -30
  101. package/src/Device/deviceInfo/unknown-nordic-logo.svg +0 -25
  102. package/src/Device/deviceLibWrapper.test.ts +0 -97
  103. package/src/Device/deviceLibWrapper.ts +0 -133
  104. package/src/Device/deviceLister.test.ts +0 -89
  105. package/src/Device/deviceLister.ts +0 -396
  106. package/src/Device/deviceSetup.ts +0 -264
  107. package/src/Device/deviceSetupSlice.ts +0 -94
  108. package/src/Device/deviceSlice.ts +0 -248
  109. package/src/Device/dfu-cc.ts +0 -162
  110. package/src/Device/initPacket.ts +0 -402
  111. package/src/Device/jprogOperations.ts +0 -206
  112. package/src/Device/sdfuOperations.ts +0 -601
  113. package/src/Dialog/Dialog.test.tsx +0 -134
  114. package/src/Dialog/Dialog.tsx +0 -236
  115. package/src/Dialog/dialog.scss +0 -60
  116. package/src/Dropdown/Dropdown.module.scss +0 -83
  117. package/src/Dropdown/Dropdown.test.tsx +0 -62
  118. package/src/Dropdown/Dropdown.tsx +0 -106
  119. package/src/ErrorBoundary/ErrorBoundary.test.tsx +0 -105
  120. package/src/ErrorBoundary/ErrorBoundary.tsx +0 -186
  121. package/src/ErrorBoundary/bug.svg +0 -1
  122. package/src/ErrorBoundary/error-boundary.scss +0 -102
  123. package/src/ErrorDialog/ErrorDialog.test.tsx +0 -70
  124. package/src/ErrorDialog/ErrorDialog.tsx +0 -94
  125. package/src/ErrorDialog/error.scss +0 -14
  126. package/src/ErrorDialog/errorDialogSlice.test.ts +0 -64
  127. package/src/ErrorDialog/errorDialogSlice.ts +0 -80
  128. package/src/FactoryReset/FactoryResetButton.test.tsx +0 -46
  129. package/src/FactoryReset/FactoryResetButton.tsx +0 -81
  130. package/src/InlineInput/InlineInput.tsx +0 -170
  131. package/src/InlineInput/NumberInlineInput.tsx +0 -107
  132. package/src/InlineInput/inline-input.scss +0 -38
  133. package/src/InlineInput/number-inline-input.scss +0 -15
  134. package/src/Log/LogEntry.tsx +0 -62
  135. package/src/Log/LogViewer.tsx +0 -54
  136. package/src/Log/log-entry.scss +0 -30
  137. package/src/Log/log-viewer.scss +0 -24
  138. package/src/Log/logSlice.ts +0 -73
  139. package/src/Log/syncLogToStore.ts +0 -36
  140. package/src/Logo/Logo.tsx +0 -48
  141. package/src/Logo/logo.scss +0 -11
  142. package/src/Main/Main.tsx +0 -13
  143. package/src/Main/main.scss +0 -13
  144. package/src/MasonryLayout/MasonryLayout.tsx +0 -234
  145. package/src/MasonryLayout/masonryLayout.module.scss +0 -46
  146. package/src/NavBar/NavBar.tsx +0 -22
  147. package/src/NavBar/NavMenu.test.tsx +0 -41
  148. package/src/NavBar/NavMenu.tsx +0 -53
  149. package/src/NavBar/NavMenuItem.tsx +0 -41
  150. package/src/NavBar/nav-bar.scss +0 -26
  151. package/src/NavBar/nav-menu-item.scss +0 -34
  152. package/src/OpenApp/openApp.ts +0 -18
  153. package/src/Panes/FeedbackPane.tsx +0 -149
  154. package/src/PseudoButton/PseudoButton.tsx +0 -56
  155. package/src/PseudoButton/pseudo-button.scss +0 -11
  156. package/src/SerialPort/ConflictingSettingsDialog.tsx +0 -242
  157. package/src/SerialPort/SerialPort.test.ts +0 -54
  158. package/src/SerialPort/SerialPort.ts +0 -202
  159. package/src/Shortcuts/Shortcut-item.scss +0 -33
  160. package/src/Shortcuts/Shortcut-modal.scss +0 -20
  161. package/src/Shortcuts/ShortcutItem.tsx +0 -48
  162. package/src/Shortcuts/ShortcutModal.tsx +0 -67
  163. package/src/SidePanel/Group.tsx +0 -106
  164. package/src/SidePanel/SidePanel.tsx +0 -19
  165. package/src/SidePanel/group.scss +0 -42
  166. package/src/SidePanel/sidepanel.scss +0 -20
  167. package/src/Slider/Bar.tsx +0 -24
  168. package/src/Slider/Factor.test.ts +0 -48
  169. package/src/Slider/Handle.tsx +0 -121
  170. package/src/Slider/Slider.test.tsx +0 -25
  171. package/src/Slider/Slider.tsx +0 -91
  172. package/src/Slider/Ticks.tsx +0 -54
  173. package/src/Slider/__snapshots__/Slider.test.tsx.snap +0 -50
  174. package/src/Slider/bar.scss +0 -24
  175. package/src/Slider/factor.ts +0 -24
  176. package/src/Slider/handle.scss +0 -32
  177. package/src/Slider/percentage.ts +0 -67
  178. package/src/Slider/range.ts +0 -92
  179. package/src/Slider/slider.scss +0 -14
  180. package/src/Slider/ticks.scss +0 -28
  181. package/src/Slider/variables.scss +0 -16
  182. package/src/StartStopButton/StartStopButton.tsx +0 -60
  183. package/src/StartStopButton/play-circle.svg +0 -1
  184. package/src/StartStopButton/start-stop-button.scss +0 -47
  185. package/src/StartStopButton/stop-circle.svg +0 -1
  186. package/src/StateSelector/StateSelector.tsx +0 -64
  187. package/src/StateSelector/state-selector.scss +0 -38
  188. package/src/Stepper/Stepper.tsx +0 -139
  189. package/src/Stepper/stepper.scss +0 -127
  190. package/src/Toggle/Toggle.tsx +0 -120
  191. package/src/Toggle/toggle.scss +0 -109
  192. package/src/bootstrap.scss +0 -14
  193. package/src/index.ts +0 -146
  194. package/src/logging/appTransport.test.ts +0 -78
  195. package/src/logging/appTransport.ts +0 -41
  196. package/src/logging/describeError.test.ts +0 -38
  197. package/src/logging/describeError.ts +0 -56
  198. package/src/logging/index.ts +0 -103
  199. package/src/logging/logBuffer.test.ts +0 -41
  200. package/src/logging/logBuffer.ts +0 -24
  201. package/src/logging/sendInitialLogMessages.ts +0 -64
  202. package/src/store.ts +0 -60
  203. package/src/svg.d.ts +0 -15
  204. package/src/utils/AppTypes.ts +0 -60
  205. package/src/utils/appDirs.ts +0 -78
  206. package/src/utils/bleChannels.ts +0 -16
  207. package/src/utils/classNames.test.ts +0 -29
  208. package/src/utils/classNames.ts +0 -25
  209. package/src/utils/colors.scss +0 -46
  210. package/src/utils/colors.ts +0 -38
  211. package/src/utils/describeVersion.ts +0 -21
  212. package/src/utils/environment.ts +0 -6
  213. package/src/utils/logLibVersions.ts +0 -103
  214. package/src/utils/open.ts +0 -46
  215. package/src/utils/packageJson.ts +0 -60
  216. package/src/utils/persistentStore.ts +0 -144
  217. package/src/utils/systemReport.ts +0 -160
  218. package/src/utils/truncateMiddle.test.ts +0 -21
  219. package/src/utils/truncateMiddle.ts +0 -20
  220. package/src/utils/usageData.ts +0 -189
  221. package/src/utils/useHotKey.ts +0 -62
  222. package/src/utils/useStopwatch.test.tsx +0 -311
  223. package/src/utils/useStopwatch.ts +0 -140
  224. package/src/variables.scss +0 -820
  225. package/styles.scss +0 -88
  226. package/test/dispatchTo.ts +0 -23
  227. package/test/index.ts +0 -7
  228. package/test/jestResolver.js +0 -28
  229. package/test/setupTests.ts +0 -27
  230. package/test/testUtil.ts +0 -20
  231. package/test/testrenderer.tsx +0 -39
  232. /package/{src/Logo/nordic-logo-white-icon-only.png → dist/nordic-logo-white-icon-only-XIZBW537.png} +0 -0
@@ -1,34 +0,0 @@
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'
@@ -1,190 +0,0 @@
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
- };
@@ -1,41 +0,0 @@
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
- });
@@ -1,13 +0,0 @@
1
- /*
2
- * Copyright (c) 2021 Nordic Semiconductor ASA
3
- *
4
- * SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
5
- */
6
-
7
- module.exports = {
8
- singleQuote: true,
9
- tabWidth: 4,
10
- arrowParens: 'avoid',
11
- endOfLine: 'auto',
12
- proseWrap: 'always',
13
- };
@@ -1,15 +0,0 @@
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
- }
package/jest.config.js DELETED
@@ -1,7 +0,0 @@
1
- /*
2
- * Copyright (c) 2021 Nordic Semiconductor ASA
3
- *
4
- * SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
5
- */
6
-
7
- module.exports = require('./config/jest.config')(['react-ga']);
package/main/index.ts DELETED
@@ -1,32 +0,0 @@
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
- };
@@ -1,21 +0,0 @@
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
- };
@@ -1,15 +0,0 @@
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
- };
@@ -1,19 +0,0 @@
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
- });
@@ -1,7 +0,0 @@
1
- /*
2
- * Copyright (c) 2021 Nordic Semiconductor ASA
3
- *
4
- * SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
5
- */
6
-
7
- export default {};
package/mocks/fileMock.ts DELETED
@@ -1,13 +0,0 @@
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 DELETED
@@ -1,9 +0,0 @@
1
- /*
2
- * Copyright (c) 2021 Nordic Semiconductor ASA
3
- *
4
- * SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
5
- */
6
-
7
- export default jest.fn(() => ({
8
- initialize: jest.fn(),
9
- }));
@@ -1,15 +0,0 @@
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
- });
@@ -1,10 +0,0 @@
1
- /*
2
- * Copyright (c) 2021 Nordic Semiconductor ASA
3
- *
4
- * SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
5
- */
6
-
7
- export default () => ({
8
- name: 'mocked-test-app',
9
- version: '27.6.72',
10
- });
@@ -1,17 +0,0 @@
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
- };
@@ -1,15 +0,0 @@
1
- #!/usr/bin/env node
2
- /*
3
- * Copyright (c) 2015 Nordic Semiconductor ASA
4
- *
5
- * SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
6
- */
7
-
8
- const { build } = require('./esbuild-renderer');
9
-
10
- build({
11
- logLevel: 'warning',
12
- entryPoints: ['./src/bootstrap.scss'],
13
- outfile: 'dist/bootstrap.css',
14
- sourcemap: false,
15
- });
@@ -1,131 +0,0 @@
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
- const join = require('path').join;
9
- const { sassPlugin, postcssModules } = require('esbuild-sass-plugin');
10
- const esbuild = require('esbuild');
11
- const svgr = require('@svgr/core').transform;
12
-
13
- function options(additionalOptions) {
14
- const { dependencies } = JSON.parse(
15
- fs.readFileSync('package.json', 'utf8')
16
- );
17
-
18
- const outfile =
19
- additionalOptions.entryPoints.length === 1
20
- ? './dist/bundle.js'
21
- : undefined;
22
- const outdir = outfile ? undefined : './dist';
23
-
24
- return {
25
- format: 'cjs',
26
- outfile,
27
- outdir,
28
- target: 'chrome89',
29
- sourcemap: true,
30
- metafile: false,
31
- minify: process.argv.includes('--prod'),
32
- bundle: true,
33
- logLevel: 'info',
34
- external: [
35
- // node
36
- 'fs',
37
- 'zlib',
38
- 'os',
39
- 'http',
40
- 'child_process',
41
- 'crypto',
42
- 'path',
43
- 'https',
44
- 'net',
45
- 'stream',
46
- 'url',
47
- 'module',
48
- 'constants',
49
- 'buffer',
50
-
51
- // launcher includes
52
- 'electron',
53
- 'serialport',
54
- '@electron/remote',
55
- 'react',
56
- '@nordicsemiconductor/nrf-device-lib-js',
57
-
58
- // App dependencies
59
- ...Object.keys(dependencies ?? {}),
60
- ],
61
- loader: {
62
- '.json': 'json',
63
- '.gif': 'file',
64
- '.svg': 'file',
65
- '.png': 'file',
66
- '.woff': 'file',
67
- '.woff2': 'file',
68
- '.eot': 'file',
69
- '.ttf': 'file',
70
- },
71
- plugins: [
72
- sassPlugin({
73
- filter: /\.(module|icss)\.scss/,
74
- cssImports: true,
75
- quietDeps: false,
76
-
77
- transform: postcssModules({}),
78
- }),
79
- sassPlugin({
80
- filter: /\.scss$/,
81
- cssImports: true,
82
- quietDeps: false,
83
- }),
84
- {
85
- name: 'svgr',
86
- setup(builder) {
87
- const filter = /^!!@svgr!(.*\.svg)$/;
88
-
89
- builder.onResolve({ filter }, args => {
90
- // Rename file to .svgr to let this plugin handle it.
91
- const [, shortpath] = filter.exec(args.path);
92
- const path = `${join(args.resolveDir, shortpath)}r`;
93
- return { path };
94
- });
95
-
96
- builder.onLoad({ filter: /\.svgr$/ }, async args => {
97
- const filePath = args.path.replace('.svgr', '.svg');
98
- const svg = await fs.promises.readFile(
99
- filePath,
100
- 'utf8'
101
- );
102
- const plugins = ['@svgr/plugin-jsx'];
103
- const contents = await svgr(svg, { filePath, plugins });
104
- return {
105
- contents,
106
- loader: 'jsx',
107
- };
108
- });
109
- },
110
- },
111
- ],
112
- ...additionalOptions,
113
- };
114
- }
115
-
116
- const build = additionalOptions => esbuild.build(options(additionalOptions));
117
-
118
- const watch = async additionalOptions => {
119
- const context = await esbuild.context(options(additionalOptions));
120
-
121
- await context.rebuild();
122
- await context.watch();
123
- };
124
-
125
- module.exports.build = additionalOptions => {
126
- if (process.argv.includes('--watch')) {
127
- watch(additionalOptions);
128
- } else {
129
- build(additionalOptions);
130
- }
131
- };
@@ -1,17 +0,0 @@
1
- #!/usr/bin/env ts-node
2
-
3
- /*
4
- * Copyright (c) 2022 Nordic Semiconductor ASA
5
- *
6
- * SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
7
- */
8
-
9
- import { existsSync } from 'fs';
10
- import { install as installHusky } from 'husky';
11
- import { cwd } from 'process';
12
-
13
- if (existsSync('.git')) {
14
- installHusky();
15
- } else {
16
- console.log(`Not installing husky, because ${cwd()} is no git repo.`);
17
- }