@nordicsemiconductor/pc-nrfconnect-shared 262.0.0 → 264.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 CHANGED
@@ -7,6 +7,46 @@ This project does _not_ adhere to
7
7
  [Semantic Versioning](https://semver.org/spec/v2.0.0.html) but contrary to it
8
8
  every new version is a new major version.
9
9
 
10
+ ## 264.0.0 - 2026-11-30
11
+
12
+ ### Added
13
+
14
+ - Script `set-minimal-launcher`. Run `npx set-minimal-launcher [version]` in an
15
+ app to set `engines.nrfconnect` in `package.json` to that launcher version and
16
+ install the matching Electron version as a dev dependency. Without a version,
17
+ the version already in `engines.nrfconnect` is used, so the script only
18
+ installs the matching Electron version.
19
+
20
+ ### Changed
21
+
22
+ - Updated Nordic Thingy:91 X PCA number.
23
+ - Bumped lib in TypeScript config to `ES2023`.
24
+ - Support multiple launcher and Electron versions:
25
+
26
+ Before, shared only defined a single Electron version, while in reality apps
27
+ may run with a launcher with an older Electron version. This is now
28
+ reflected by shared.
29
+ - Apps must now have a dev dependency on Electron, matching the version of
30
+ launcher they require. This is automatically checked, so when one runs
31
+ `npm run check` and it is not set correctly, the right invocation of
32
+ `npm install` is printed to fix the situation.
33
+ - Shared now defines a minimal launcher version. It is checked, that the app
34
+ has the same or a higher minimal launcher version (in `engines.nrfconnect`
35
+ in `package.json`). Before, this was just a convention.
36
+ - When building apps, they now target the Chrome version that corresponds
37
+ with the Electron version, defined by the minimal launcher version, the
38
+ app requires.
39
+
40
+ ### Steps to upgrade when using this package
41
+
42
+ - Run `npx set-minimal-launcher` to add Electron as a dev dependency.
43
+
44
+ ## 263.0.0 - 2026-11-03
45
+
46
+ ### Changed
47
+
48
+ - Updated Electron to 43.8.6.
49
+
10
50
  ## 262.0.0 - 2026-11-02
11
51
 
12
52
  ### Changed
@@ -400,7 +440,7 @@ import { Card } from '@nordicsemiconductor/pc-nrfconnect-shared';
400
440
 
401
441
  ### Changed
402
442
 
403
- - The required lincense file was slightly changed.
443
+ - The required license file was slightly changed.
404
444
 
405
445
  ### Steps to upgrade when using this package
406
446
 
@@ -628,15 +668,15 @@ import { Card } from '@nordicsemiconductor/pc-nrfconnect-shared';
628
668
 
629
669
  ### Added
630
670
 
631
- - `nrf-probe` verison check for `nrfutil device`.
671
+ - `nrf-probe` version check for `nrfutil device`.
632
672
 
633
673
  ### Removed
634
674
 
635
- - `nrfjprog` verison check for `nrfutil device`.
675
+ - `nrfjprog` version check for `nrfutil device`.
636
676
 
637
677
  ### Changed
638
678
 
639
- - Text in the Application card of the About tab can now be highlightede and
679
+ - Text in the Application card of the About tab can now be highlighted and
640
680
  copied.
641
681
  - J-Link download URL for `JLink_MacOSX_V794i_universal.pkg` to
642
682
  `JLink_MacOSX_V818_universal.pkg`
@@ -799,11 +839,11 @@ Overrides v202 as it was released a prerelease.
799
839
 
800
840
  ### Changed
801
841
 
802
- - DeviceSelector Abort controler now aborts on the onDisconnected event
842
+ - DeviceSelector Abort controller now aborts on the onDisconnected event
803
843
 
804
844
  ### Fixed
805
845
 
806
- - Auto connecting from CLI when multple devices are connected now works as
846
+ - Auto connecting from CLI when multiple devices are connected now works as
807
847
  expected.
808
848
 
809
849
  ## 185.0.0 - 2024-09-20
@@ -817,7 +857,7 @@ Overrides v202 as it was released a prerelease.
817
857
  ### Fixed
818
858
 
819
859
  - Stop nRF Util sandbox from starting to run an aborted command.
820
- - Device setup event call order when autoreconnecting at the same time as
860
+ - Device setup event call order when auto reconnecting at the same time as
821
861
  selecting.
822
862
 
823
863
  ### Steps to upgrade when using this package
@@ -1076,7 +1116,7 @@ Overrides v202 as it was released a prerelease.
1076
1116
  - `transparentButtonBg` parameter to `Dropdown` component.
1077
1117
  - `NumberInput` component (provides text, input, optional unit, and slider).
1078
1118
  - Common way to queue ongoing pending tasks. If an app is closed, a dialog is
1079
- prompted to alert users before clo sing app. Redux states for this are:
1119
+ prompted to alert users before closing app. Redux states for this are:
1080
1120
  - `addConfirmBeforeClose`
1081
1121
  - `clearConfirmBeforeClose`
1082
1122
  - `preventAppCloseUntilComplete` can be used to wrap some promise and secure
@@ -1338,7 +1378,7 @@ Overrides v202 as it was released a prerelease.
1338
1378
 
1339
1379
  ### Added
1340
1380
 
1341
- - `jprogDeviceSetup` take in aan optional boolean to skip the device setup if
1381
+ - `jprogDeviceSetup` take in an optional boolean to skip the device setup if
1342
1382
  device is protected. Default remain to show dialog. Apps will need to opt-in
1343
1383
 
1344
1384
  ## 136.0.0 - 2023-12-01
@@ -1347,7 +1387,7 @@ Overrides v202 as it was released a prerelease.
1347
1387
 
1348
1388
  - `useStopwatch` milliseconds was not correctly calculated
1349
1389
  - External JLink devices would not connect to apps device list properly if
1350
- selected before they are connected to the debug-in heder of the device
1390
+ selected before they are connected to the debug-in header of the device
1351
1391
 
1352
1392
  ### Changed
1353
1393
 
@@ -1541,7 +1581,7 @@ render(<App panes={[]} />);
1541
1581
  information to speed up enumeration and hotplug events.
1542
1582
  - new optional property in device object named `devkit`
1543
1583
  - `.jlink` property can be obtained by calling
1544
- `NrfutilDeviceLib.deviceInfo().jlink` on a Jlink device
1584
+ `NrfutilDeviceLib.deviceInfo().jlink` on a J-Link device
1545
1585
  - `.hwInfo` property can be obtained by calling
1546
1586
  `NrfutilDeviceLib.deviceInfo().hwInfo` on a device
1547
1587
  - `.dfuTriggerVersion` property can be obtained by calling
@@ -1559,7 +1599,7 @@ render(<App panes={[]} />);
1559
1599
 
1560
1600
  ### Fixed
1561
1601
 
1562
- - Check installed JLink version against expected version given by nrfutil
1602
+ - Check installed J-Link version against expected version given by nrfutil
1563
1603
  (previously this was the version bundled by the launcher).
1564
1604
 
1565
1605
  ### Steps to upgrade when using this package
@@ -1991,7 +2031,7 @@ declare module '!!@svgr!*.svg' {
1991
2031
  - Re-added underline (mistakenly removed) on hover for `link` variant of
1992
2032
  `Button` component.
1993
2033
  - Apps now have to load themselves, i.e. there is no `ReactDOM.render` done from
1994
- the launcher anymore. The app chooses which html-page will be the entrypoint.
2034
+ the launcher anymore. The app chooses which html-page will be the entry point.
1995
2035
  - Passing devices of type nrf-device-lib-js `Device` to calls from
1996
2036
  `deviceInfo.ts` is not allowed. Passing the nrf-device-lib-js version of
1997
2037
  `Device` is now allowed.
@@ -2337,7 +2377,7 @@ module.exports = {
2337
2377
 
2338
2378
  ### Added
2339
2379
 
2340
- - Exported `getWaitForDevice` hance allowing apps to resort previous state if
2380
+ - Exported `getWaitForDevice` hence allowing apps to resort previous state if
2341
2381
  needed
2342
2382
 
2343
2383
  ### Added
@@ -2543,7 +2583,7 @@ module.exports = {
2543
2583
 
2544
2584
  ### Fixed
2545
2585
 
2546
- - Feedback pane link to Nordiv DevZone did not open in the browser.
2586
+ - Feedback pane link to Nordic DevZone did not open in the browser.
2547
2587
  - Properly update package version when running the prepare script on windows.
2548
2588
 
2549
2589
  ### Changed
@@ -2685,14 +2725,14 @@ module.exports = {
2685
2725
 
2686
2726
  ### Fixed
2687
2727
 
2688
- - Autoreconnected devices were not passed with persisted data to the
2728
+ - Auto reconnected devices were not passed with persisted data to the
2689
2729
  `onDeviceSelected`/`onDeviceIsReady` callbacks.
2690
2730
 
2691
2731
  ### Removed
2692
2732
 
2693
- - Support for buiding apps with webpack. If you want to continue to use webpack,
2694
- you now have to provide the configuration and install the needed dependencies
2695
- yourself.
2733
+ - Support for building apps with webpack. If you want to continue to use
2734
+ webpack, you now have to provide the configuration and install the needed
2735
+ dependencies yourself.
2696
2736
 
2697
2737
  ### Steps to upgrade when using this package
2698
2738
 
@@ -2777,7 +2817,7 @@ module.exports = {
2777
2817
 
2778
2818
  ### Fixed
2779
2819
 
2780
- - Devices now receive persisted data on first enumation.
2820
+ - Devices now receive persisted data on first enumeration.
2781
2821
  - Safe guard against retaining stale wait for device request if a new device is
2782
2822
  selected
2783
2823
 
@@ -3040,7 +3080,7 @@ module.exports = {
3040
3080
 
3041
3081
  ### Changed
3042
3082
 
3043
- - `PersistedSerialPort` takes app name fom json
3083
+ - `PersistedSerialPort` takes app name from json
3044
3084
  - `TerminalSettings` vCom Index is append with `vCom-` in persist store
3045
3085
 
3046
3086
  ## 6.18.4 - 2023-02-01
@@ -3333,13 +3373,13 @@ this:
3333
3373
 
3334
3374
  - `NumberInlineInput` can opt to have step defined allowing only values that are
3335
3375
  a factor of this step size.
3336
- - `NumberInlineInput` can opt to have explict ranges allowing for split ranges.
3376
+ - `NumberInlineInput` can opt to have explicit ranges allowing for split ranges.
3337
3377
  - `InlineInput` can opt to have support for up/down keyboard events to control
3338
3378
  the value.
3339
3379
  - `NumberInlineInput` support for up/down keyboard events to control the value.
3340
3380
  - `Slider` can opt to have steps defined allowing allowing to increment the
3341
3381
  value with the step size.
3342
- - `Slider` can opt to have explict ranges allowing for split ranges. Ticks are
3382
+ - `Slider` can opt to have explicit ranges allowing for split ranges. Ticks are
3343
3383
  not yet supported on this mode.
3344
3384
  - Warn in console if Min and Max are not factors of the optional step size.
3345
3385
 
@@ -3612,7 +3652,7 @@ this:
3612
3652
  ### Changed
3613
3653
 
3614
3654
  - Move all devDependencies into dependencies and remove peer dependencies. The
3615
- peer ependencies were use by all apps anyways, so moving them all into
3655
+ peer dependencies were use by all apps anyways, so moving them all into
3616
3656
  dependencies will let the apps remove their own version of them.
3617
3657
 
3618
3658
  ## 6.3.2 - 2022-06-21
@@ -5090,7 +5130,7 @@ module.exports = require('pc-nrfconnect-shared/config/jest.config')();
5090
5130
 
5091
5131
  ### Fixed
5092
5132
 
5093
- - The remote property on the electron mock was noch mocked correctly.
5133
+ - The remote property on the electron mock was not mocked correctly.
5094
5134
 
5095
5135
  ### Changed
5096
5136
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "target": "es2021",
4
- "lib": ["es2022", "dom", "dom.iterable", "dom.asynciterable"],
3
+ "target": "es2023",
4
+ "lib": ["es2023", "dom", "dom.iterable", "dom.asynciterable"],
5
5
  "moduleResolution": "node",
6
6
  "esModuleInterop": true,
7
7
  "jsx": "react",
@@ -0,0 +1,115 @@
1
+ /*
2
+ * Copyright (c) 2026 Nordic Semiconductor ASA
3
+ *
4
+ * SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
5
+ */
6
+
7
+ import semver from 'semver';
8
+
9
+ import packageJson from '../package.json';
10
+ import {
11
+ minimalLauncherVersion,
12
+ versionsByLauncherVersion,
13
+ versionsForLauncherVersion,
14
+ } from './versions';
15
+
16
+ const lowestSemver = (semvers: string[]) => semvers.toSorted(semver.compare)[0];
17
+
18
+ describe('minimalLauncherVersion', () => {
19
+ it('should have versions described for it', () => {
20
+ expect(() =>
21
+ versionsForLauncherVersion(minimalLauncherVersion),
22
+ ).not.toThrow();
23
+ });
24
+
25
+ it('must be the minimal version described in versionsByLauncherVersion', () => {
26
+ const minimalLauncherVersionInMapping = lowestSemver(
27
+ Object.keys(versionsByLauncherVersion).map(
28
+ range => semver.minVersion(range)!.version,
29
+ ),
30
+ );
31
+
32
+ expect(minimalLauncherVersion).toBe(minimalLauncherVersionInMapping);
33
+ });
34
+ });
35
+
36
+ describe('versionsByLauncherVersion', () => {
37
+ const electronVersions = Object.values(versionsByLauncherVersion).map(
38
+ ({ electron }) => electron,
39
+ );
40
+
41
+ it('does not have overlapping semver ranges', () => {
42
+ const launcherRanges = Object.keys(versionsByLauncherVersion);
43
+
44
+ const overlappingRangePairs = launcherRanges.flatMap((range, index) =>
45
+ launcherRanges
46
+ .slice(index + 1)
47
+ .filter(otherRange => semver.intersects(range, otherRange))
48
+ .map(otherRange => [range, otherRange]),
49
+ );
50
+
51
+ expect(overlappingRangePairs).toEqual([]);
52
+ });
53
+
54
+ it('has the same electron versions as in the peer dependencies', () => {
55
+ const electronPeerDependencies = packageJson.peerDependencies?.electron
56
+ ?.split('||')
57
+ .map(version => version.trim());
58
+
59
+ expect(electronVersions).toEqual(
60
+ expect.arrayContaining(electronPeerDependencies),
61
+ );
62
+ expect(electronPeerDependencies).toEqual(
63
+ expect.arrayContaining(electronVersions),
64
+ );
65
+ });
66
+
67
+ it('its lowest electron version matches the dev dependency', () => {
68
+ expect(packageJson.devDependencies.electron).toBe(
69
+ lowestSemver(electronVersions),
70
+ );
71
+ });
72
+ });
73
+
74
+ describe('versionsForLauncherVersion', () => {
75
+ const exampleVersionsByLauncher = {
76
+ '>=5.1.0 <=5.3.99': {
77
+ electron: '32',
78
+ chrome: '',
79
+ node: '',
80
+ },
81
+
82
+ '>5.3.99': {
83
+ electron: '43',
84
+ chrome: '',
85
+ node: '',
86
+ },
87
+ };
88
+
89
+ it('returns the versions for a version within the Range', () => {
90
+ expect(
91
+ versionsForLauncherVersion('5.3.0', exampleVersionsByLauncher)
92
+ .electron,
93
+ ).toEqual('32');
94
+
95
+ expect(
96
+ versionsForLauncherVersion(
97
+ semver.parse('5.3.0')!,
98
+ exampleVersionsByLauncher,
99
+ ).electron,
100
+ ).toEqual('32');
101
+ });
102
+
103
+ it('returns the right versions for pre-releases', () => {
104
+ expect(
105
+ versionsForLauncherVersion('5.4.0-pre1', exampleVersionsByLauncher)
106
+ .electron,
107
+ ).toEqual('43');
108
+ });
109
+
110
+ it('throws when no matching launcher range exists', () => {
111
+ expect(() =>
112
+ versionsForLauncherVersion('5.0.9', exampleVersionsByLauncher),
113
+ ).toThrow();
114
+ });
115
+ });
@@ -0,0 +1,53 @@
1
+ /*
2
+ * Copyright (c) 2025 Nordic Semiconductor ASA
3
+ *
4
+ * SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
5
+ */
6
+
7
+ import semver, { type SemVer } from 'semver';
8
+
9
+ export const minimalLauncherVersion = '5.2.0';
10
+
11
+ export const versionsByLauncherVersion: Record<
12
+ string,
13
+ {
14
+ electron: string;
15
+ chrome: string;
16
+ node: string;
17
+ }
18
+ > = {
19
+ '>=5.2.0 <5.4.0': {
20
+ electron: '32.1.2',
21
+ chrome: '128.0.6613',
22
+ node: '20.17.0',
23
+ },
24
+
25
+ '>=5.4.0 <5.4.1': {
26
+ electron: '43.4.0',
27
+ chrome: '150.0.7871',
28
+ node: '24.18.1',
29
+ },
30
+
31
+ '>=5.4.1': {
32
+ electron: '43.8.6',
33
+ chrome: '150.0.7871',
34
+ node: '24.22.1',
35
+ },
36
+ };
37
+
38
+ export const versionsForLauncherVersion = (
39
+ launcherVersion: string | SemVer,
40
+ versions = versionsByLauncherVersion,
41
+ ) => {
42
+ const result = Object.entries(versions).find(([range]) =>
43
+ semver.satisfies(launcherVersion, range, { includePrerelease: true }),
44
+ );
45
+
46
+ if (result == null) {
47
+ throw new Error(
48
+ `No versions found for launcher version ${launcherVersion}. Please update config/versions.ts to include this version.`,
49
+ );
50
+ }
51
+
52
+ return result[1];
53
+ };