@nordicsemiconductor/pc-nrfconnect-shared 116.0.0 → 118.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 +23 -1
- package/coverage/cobertura-coverage.xml +108 -107
- package/ipc/MetaFiles.ts +15 -43
- package/ipc/device.ts +25 -0
- package/ipc/schema/packageJson.ts +69 -0
- package/ipc/schema/parseJson.ts +27 -0
- package/main/index.ts +14 -1
- package/nrfutil/device/program.ts +1 -0
- package/package.json +5 -3
- package/scripts/check-app-properties.ts +20 -52
- package/scripts/{esbuild-renderer.js → esbuild-renderer.ts} +42 -52
- package/scripts/esbuild.ts +79 -0
- package/scripts/nordic-publish.js +28 -26
- package/scripts/nordic-publish.ts +2 -1
- package/scripts/postinstall.ts +5 -5
- package/scripts/prepare-shared-release.ts +1 -1
- package/scripts/release-shared.ts +2 -2
- package/src/Device/deviceInfo/deviceInfo.ts +5 -19
- package/src/utils/appDirs.ts +1 -1
- package/src/utils/packageJson.ts +9 -5
- package/src/utils/usageData.ts +1 -2
- package/tsconfig.json +1 -0
- package/typings/generated/ipc/MetaFiles.d.ts +8 -40
- package/typings/generated/ipc/MetaFiles.d.ts.map +1 -1
- package/typings/generated/ipc/device.d.ts +3 -0
- package/typings/generated/ipc/device.d.ts.map +1 -0
- package/typings/generated/ipc/schema/packageJson.d.ts +267 -0
- package/typings/generated/ipc/schema/packageJson.d.ts.map +1 -0
- package/typings/generated/ipc/schema/parseJson.d.ts +6 -0
- package/typings/generated/ipc/schema/parseJson.d.ts.map +1 -0
- package/typings/generated/main/index.d.ts +2 -1
- package/typings/generated/main/index.d.ts.map +1 -1
- package/typings/generated/nrfutil/device/program.d.ts.map +1 -1
- package/typings/generated/nrfutil/sandbox.d.ts +8 -0
- package/typings/generated/nrfutil/sandbox.d.ts.map +1 -1
- package/typings/generated/scripts/check-app-properties.d.ts +6 -0
- package/typings/generated/scripts/check-app-properties.d.ts.map +1 -0
- package/typings/generated/scripts/check-for-typescript.d.ts +3 -0
- package/typings/generated/scripts/check-for-typescript.d.ts.map +1 -0
- package/typings/generated/scripts/esbuild-renderer.d.ts +7 -0
- package/typings/generated/scripts/esbuild-renderer.d.ts.map +1 -0
- package/typings/generated/scripts/esbuild.d.ts +3 -0
- package/typings/generated/scripts/esbuild.d.ts.map +1 -0
- package/typings/generated/scripts/installHusky.d.ts +3 -0
- package/typings/generated/scripts/installHusky.d.ts.map +1 -0
- package/typings/generated/scripts/nordic-publish.d.ts +3 -0
- package/typings/generated/scripts/nordic-publish.d.ts.map +1 -0
- package/typings/generated/scripts/nrfconnect-license.d.ts +3 -0
- package/typings/generated/scripts/nrfconnect-license.d.ts.map +1 -0
- package/typings/generated/scripts/postinstall.d.ts +3 -0
- package/typings/generated/scripts/postinstall.d.ts.map +1 -0
- package/typings/generated/scripts/prepare-shared-release.d.ts +3 -0
- package/typings/generated/scripts/prepare-shared-release.d.ts.map +1 -0
- package/typings/generated/scripts/release-shared.d.ts +30 -0
- package/typings/generated/scripts/release-shared.d.ts.map +1 -0
- package/typings/generated/scripts/release-shared.test.d.ts +2 -0
- package/typings/generated/scripts/release-shared.test.d.ts.map +1 -0
- 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/utils/packageJson.d.ts +28 -2
- package/typings/generated/src/utils/packageJson.d.ts.map +1 -1
- package/typings/generated/src/utils/usageData.d.ts +8 -3
- package/typings/generated/src/utils/usageData.d.ts.map +1 -1
- package/scripts/esbuild.js +0 -53
package/Changelog.md
CHANGED
|
@@ -7,6 +7,28 @@ 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
|
+
## 118 - 2023-10-13
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Option to configure external React to support legacy apps in the launcher.
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- Checking whether the `package.json` contains all required fields is now also
|
|
19
|
+
down before building.
|
|
20
|
+
- Use `zod` for the `package.json` schema for apps. This is used verify that
|
|
21
|
+
apps have the right fields in `package.json` and also generates the right
|
|
22
|
+
TypeScript type for it.
|
|
23
|
+
- `nrfConnectForDesktop.html` is not optional anymore, it must always be
|
|
24
|
+
specified in `package.json`.
|
|
25
|
+
|
|
26
|
+
## 117 - 2023-10-04
|
|
27
|
+
|
|
28
|
+
### Fixed
|
|
29
|
+
|
|
30
|
+
- `nrfutil device program` did now throw error when files buffers where used
|
|
31
|
+
|
|
10
32
|
## 116 - 2023-10-03
|
|
11
33
|
|
|
12
34
|
### Fixed
|
|
@@ -388,7 +410,7 @@ declare module '!!@svgr!*.svg' {
|
|
|
388
410
|
### Steps to upgrade when using this package
|
|
389
411
|
|
|
390
412
|
- Following this step will make the app incompatible with the currently
|
|
391
|
-
released launcher (v4.1.2): Add an `
|
|
413
|
+
released launcher (v4.1.2): Add an `html`-property to package.json. The
|
|
392
414
|
following example will use the index bundled with shared that works with our
|
|
393
415
|
apps, but apps can also make their own instead if needed.
|
|
394
416
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<?xml version="1.0" ?>
|
|
2
2
|
<!DOCTYPE coverage SYSTEM "http://cobertura.sourceforge.net/xml/coverage-04.dtd">
|
|
3
|
-
<coverage lines-valid="
|
|
3
|
+
<coverage lines-valid="3210" lines-covered="1788" line-rate="0.557" branches-valid="1531" branches-covered="448" branch-rate="0.2926" timestamp="1697198852924" complexity="0" version="0.1">
|
|
4
4
|
<sources>
|
|
5
5
|
<source>/home/vsts/work/1/s</source>
|
|
6
6
|
</sources>
|
|
@@ -932,7 +932,7 @@
|
|
|
932
932
|
</class>
|
|
933
933
|
</classes>
|
|
934
934
|
</package>
|
|
935
|
-
<package name="nrfutil.device" line-rate="0.
|
|
935
|
+
<package name="nrfutil.device" line-rate="0.24539999999999998" branch-rate="0">
|
|
936
936
|
<classes>
|
|
937
937
|
<class name="batch.ts" filename="nrfutil/device/batch.ts" line-rate="0.07139999999999999" branch-rate="0">
|
|
938
938
|
<methods>
|
|
@@ -1437,7 +1437,7 @@
|
|
|
1437
1437
|
<line number="95" hits="0" branch="false"/>
|
|
1438
1438
|
</lines>
|
|
1439
1439
|
</class>
|
|
1440
|
-
<class name="program.ts" filename="nrfutil/device/program.ts" line-rate="0.
|
|
1440
|
+
<class name="program.ts" filename="nrfutil/device/program.ts" line-rate="0.2407" branch-rate="0">
|
|
1441
1441
|
<methods>
|
|
1442
1442
|
<method name="(anonymous_7)" hits="0" signature="()V">
|
|
1443
1443
|
<lines>
|
|
@@ -1491,7 +1491,7 @@
|
|
|
1491
1491
|
</method>
|
|
1492
1492
|
<method name="(anonymous_17)" hits="0" signature="()V">
|
|
1493
1493
|
<lines>
|
|
1494
|
-
<line number="
|
|
1494
|
+
<line number="159" hits="0"/>
|
|
1495
1495
|
</lines>
|
|
1496
1496
|
</method>
|
|
1497
1497
|
</methods>
|
|
@@ -1545,10 +1545,11 @@
|
|
|
1545
1545
|
<line number="144" hits="0" branch="false"/>
|
|
1546
1546
|
<line number="145" hits="0" branch="false"/>
|
|
1547
1547
|
<line number="154" hits="0" branch="false"/>
|
|
1548
|
-
<line number="
|
|
1549
|
-
<line number="
|
|
1550
|
-
<line number="167" hits="0" branch="
|
|
1551
|
-
<line number="
|
|
1548
|
+
<line number="155" hits="0" branch="false"/>
|
|
1549
|
+
<line number="159" hits="3" branch="false"/>
|
|
1550
|
+
<line number="167" hits="0" branch="true" condition-coverage="0% (0/2)"/>
|
|
1551
|
+
<line number="168" hits="0" branch="false"/>
|
|
1552
|
+
<line number="177" hits="0" branch="false"/>
|
|
1552
1553
|
</lines>
|
|
1553
1554
|
</class>
|
|
1554
1555
|
<class name="recover.ts" filename="nrfutil/device/recover.ts" line-rate="0.6666" branch-rate="0">
|
|
@@ -4815,37 +4816,36 @@
|
|
|
4815
4816
|
<methods>
|
|
4816
4817
|
<method name="(anonymous_9)" hits="56" signature="()V">
|
|
4817
4818
|
<lines>
|
|
4818
|
-
<line number="
|
|
4819
|
+
<line number="219" hits="56"/>
|
|
4819
4820
|
</lines>
|
|
4820
4821
|
</method>
|
|
4821
4822
|
<method name="(anonymous_11)" hits="56" signature="()V">
|
|
4822
4823
|
<lines>
|
|
4823
|
-
<line number="
|
|
4824
|
+
<line number="237" hits="56"/>
|
|
4824
4825
|
</lines>
|
|
4825
4826
|
</method>
|
|
4826
4827
|
<method name="(anonymous_12)" hits="28" signature="()V">
|
|
4827
4828
|
<lines>
|
|
4828
|
-
<line number="
|
|
4829
|
+
<line number="240" hits="28"/>
|
|
4829
4830
|
</lines>
|
|
4830
4831
|
</method>
|
|
4831
4832
|
<method name="(anonymous_13)" hits="28" signature="()V">
|
|
4832
4833
|
<lines>
|
|
4833
|
-
<line number="
|
|
4834
|
+
<line number="247" hits="28"/>
|
|
4834
4835
|
</lines>
|
|
4835
4836
|
</method>
|
|
4836
4837
|
<method name="(anonymous_14)" hits="0" signature="()V">
|
|
4837
4838
|
<lines>
|
|
4838
|
-
<line number="
|
|
4839
|
+
<line number="258" hits="0"/>
|
|
4839
4840
|
</lines>
|
|
4840
4841
|
</method>
|
|
4841
4842
|
<method name="(anonymous_15)" hits="0" signature="()V">
|
|
4842
4843
|
<lines>
|
|
4843
|
-
<line number="
|
|
4844
|
+
<line number="262" hits="0"/>
|
|
4844
4845
|
</lines>
|
|
4845
4846
|
</method>
|
|
4846
4847
|
</methods>
|
|
4847
4848
|
<lines>
|
|
4848
|
-
<line number="34" hits="3" branch="false"/>
|
|
4849
4849
|
<line number="35" hits="3" branch="false"/>
|
|
4850
4850
|
<line number="36" hits="3" branch="false"/>
|
|
4851
4851
|
<line number="37" hits="3" branch="false"/>
|
|
@@ -4854,31 +4854,32 @@
|
|
|
4854
4854
|
<line number="40" hits="3" branch="false"/>
|
|
4855
4855
|
<line number="41" hits="3" branch="false"/>
|
|
4856
4856
|
<line number="42" hits="3" branch="false"/>
|
|
4857
|
-
<line number="
|
|
4858
|
-
<line number="
|
|
4857
|
+
<line number="43" hits="3" branch="false"/>
|
|
4858
|
+
<line number="57" hits="3" branch="false"/>
|
|
4859
|
+
<line number="201" hits="56" branch="false"/>
|
|
4860
|
+
<line number="205" hits="3" branch="false"/>
|
|
4861
|
+
<line number="207" hits="112" branch="true" condition-coverage="83.33333333333334% (5/6)"/>
|
|
4862
|
+
<line number="209" hits="0" branch="false"/>
|
|
4859
4863
|
<line number="219" hits="3" branch="false"/>
|
|
4860
|
-
<line number="
|
|
4861
|
-
<line number="
|
|
4862
|
-
<line number="
|
|
4863
|
-
<line number="
|
|
4864
|
-
<line number="
|
|
4865
|
-
<line number="
|
|
4866
|
-
<line number="
|
|
4867
|
-
<line number="
|
|
4868
|
-
<line number="
|
|
4869
|
-
<line number="
|
|
4870
|
-
<line number="
|
|
4871
|
-
<line number="
|
|
4872
|
-
<line number="
|
|
4873
|
-
<line number="
|
|
4874
|
-
<line number="
|
|
4875
|
-
<line number="
|
|
4876
|
-
<line number="
|
|
4877
|
-
<line number="
|
|
4878
|
-
<line number="
|
|
4879
|
-
<line number="273" hits="0" branch="true" condition-coverage="0% (0/2)"/>
|
|
4880
|
-
<line number="276" hits="3" branch="false"/>
|
|
4881
|
-
<line number="277" hits="0" branch="true" condition-coverage="0% (0/2)"/>
|
|
4864
|
+
<line number="220" hits="56" branch="true" condition-coverage="0% (0/1)"/>
|
|
4865
|
+
<line number="221" hits="0" branch="true" condition-coverage="0% (0/7)"/>
|
|
4866
|
+
<line number="222" hits="0" branch="false"/>
|
|
4867
|
+
<line number="224" hits="0" branch="true" condition-coverage="0% (0/5)"/>
|
|
4868
|
+
<line number="225" hits="0" branch="false"/>
|
|
4869
|
+
<line number="228" hits="56" branch="false"/>
|
|
4870
|
+
<line number="231" hits="56" branch="false"/>
|
|
4871
|
+
<line number="237" hits="28" branch="false"/>
|
|
4872
|
+
<line number="238" hits="56" branch="true" condition-coverage="100% (3/3)"/>
|
|
4873
|
+
<line number="240" hits="3" branch="false"/>
|
|
4874
|
+
<line number="243" hits="28" branch="true" condition-coverage="100% (3/3)"/>
|
|
4875
|
+
<line number="247" hits="28" branch="false"/>
|
|
4876
|
+
<line number="251" hits="28" branch="true" condition-coverage="66.66666666666666% (2/3)"/>
|
|
4877
|
+
<line number="252" hits="0" branch="false"/>
|
|
4878
|
+
<line number="255" hits="28" branch="true" condition-coverage="14.285714285714285% (1/7)"/>
|
|
4879
|
+
<line number="258" hits="3" branch="false"/>
|
|
4880
|
+
<line number="259" hits="0" branch="true" condition-coverage="0% (0/2)"/>
|
|
4881
|
+
<line number="262" hits="3" branch="false"/>
|
|
4882
|
+
<line number="263" hits="0" branch="true" condition-coverage="0% (0/2)"/>
|
|
4882
4883
|
</lines>
|
|
4883
4884
|
</class>
|
|
4884
4885
|
</classes>
|
|
@@ -7401,9 +7402,9 @@
|
|
|
7401
7402
|
</class>
|
|
7402
7403
|
</classes>
|
|
7403
7404
|
</package>
|
|
7404
|
-
<package name="src.utils" line-rate="0.6344" branch-rate="0.
|
|
7405
|
+
<package name="src.utils" line-rate="0.6344" branch-rate="0.17350000000000002">
|
|
7405
7406
|
<classes>
|
|
7406
|
-
<class name="appDirs.ts" filename="src/utils/appDirs.ts" line-rate="0.6153" branch-rate="
|
|
7407
|
+
<class name="appDirs.ts" filename="src/utils/appDirs.ts" line-rate="0.6153" branch-rate="1">
|
|
7407
7408
|
<methods>
|
|
7408
7409
|
<method name="(anonymous_7)" hits="0" signature="()V">
|
|
7409
7410
|
<lines>
|
|
@@ -7437,7 +7438,7 @@
|
|
|
7437
7438
|
<line number="10" hits="13" branch="false"/>
|
|
7438
7439
|
<line number="12" hits="13" branch="false"/>
|
|
7439
7440
|
<line number="19" hits="13" branch="false"/>
|
|
7440
|
-
<line number="20" hits="0" branch="
|
|
7441
|
+
<line number="20" hits="0" branch="false"/>
|
|
7441
7442
|
<line number="21" hits="0" branch="false"/>
|
|
7442
7443
|
<line number="22" hits="0" branch="false"/>
|
|
7443
7444
|
<line number="31" hits="13" branch="false"/>
|
|
@@ -7772,134 +7773,134 @@
|
|
|
7772
7773
|
<methods>
|
|
7773
7774
|
<method name="(anonymous_13)" hits="3" signature="()V">
|
|
7774
7775
|
<lines>
|
|
7775
|
-
<line number="
|
|
7776
|
+
<line number="35" hits="3"/>
|
|
7776
7777
|
</lines>
|
|
7777
7778
|
</method>
|
|
7778
7779
|
<method name="(anonymous_14)" hits="0" signature="()V">
|
|
7779
7780
|
<lines>
|
|
7780
|
-
<line number="
|
|
7781
|
+
<line number="56" hits="0"/>
|
|
7781
7782
|
</lines>
|
|
7782
7783
|
</method>
|
|
7783
7784
|
<method name="(anonymous_15)" hits="0" signature="()V">
|
|
7784
7785
|
<lines>
|
|
7785
|
-
<line number="
|
|
7786
|
+
<line number="74" hits="0"/>
|
|
7786
7787
|
</lines>
|
|
7787
7788
|
</method>
|
|
7788
7789
|
<method name="(anonymous_16)" hits="3" signature="()V">
|
|
7789
7790
|
<lines>
|
|
7790
|
-
<line number="
|
|
7791
|
+
<line number="86" hits="3"/>
|
|
7791
7792
|
</lines>
|
|
7792
7793
|
</method>
|
|
7793
7794
|
<method name="(anonymous_17)" hits="0" signature="()V">
|
|
7794
7795
|
<lines>
|
|
7795
|
-
<line number="
|
|
7796
|
+
<line number="100" hits="0"/>
|
|
7796
7797
|
</lines>
|
|
7797
7798
|
</method>
|
|
7798
7799
|
<method name="(anonymous_18)" hits="0" signature="()V">
|
|
7799
7800
|
<lines>
|
|
7800
|
-
<line number="
|
|
7801
|
+
<line number="111" hits="0"/>
|
|
7801
7802
|
</lines>
|
|
7802
7803
|
</method>
|
|
7803
7804
|
<method name="(anonymous_19)" hits="0" signature="()V">
|
|
7804
7805
|
<lines>
|
|
7805
|
-
<line number="
|
|
7806
|
+
<line number="121" hits="0"/>
|
|
7806
7807
|
</lines>
|
|
7807
7808
|
</method>
|
|
7808
7809
|
<method name="(anonymous_20)" hits="0" signature="()V">
|
|
7809
7810
|
<lines>
|
|
7810
|
-
<line number="
|
|
7811
|
+
<line number="132" hits="0"/>
|
|
7811
7812
|
</lines>
|
|
7812
7813
|
</method>
|
|
7813
7814
|
<method name="(anonymous_21)" hits="0" signature="()V">
|
|
7814
7815
|
<lines>
|
|
7815
|
-
<line number="
|
|
7816
|
+
<line number="143" hits="0"/>
|
|
7816
7817
|
</lines>
|
|
7817
7818
|
</method>
|
|
7818
7819
|
<method name="(anonymous_22)" hits="0" signature="()V">
|
|
7819
7820
|
<lines>
|
|
7820
|
-
<line number="
|
|
7821
|
+
<line number="161" hits="0"/>
|
|
7821
7822
|
</lines>
|
|
7822
7823
|
</method>
|
|
7823
7824
|
<method name="(anonymous_23)" hits="0" signature="()V">
|
|
7824
7825
|
<lines>
|
|
7825
|
-
<line number="
|
|
7826
|
+
<line number="170" hits="0"/>
|
|
7826
7827
|
</lines>
|
|
7827
7828
|
</method>
|
|
7828
7829
|
<method name="(anonymous_24)" hits="0" signature="()V">
|
|
7829
7830
|
<lines>
|
|
7830
|
-
<line number="
|
|
7831
|
+
<line number="177" hits="0"/>
|
|
7831
7832
|
</lines>
|
|
7832
7833
|
</method>
|
|
7833
7834
|
<method name="(anonymous_25)" hits="0" signature="()V">
|
|
7834
7835
|
<lines>
|
|
7835
|
-
<line number="
|
|
7836
|
+
<line number="188" hits="0"/>
|
|
7836
7837
|
</lines>
|
|
7837
7838
|
</method>
|
|
7838
7839
|
<method name="(anonymous_26)" hits="1" signature="()V">
|
|
7839
7840
|
<lines>
|
|
7840
|
-
<line number="
|
|
7841
|
+
<line number="196" hits="1"/>
|
|
7841
7842
|
</lines>
|
|
7842
7843
|
</method>
|
|
7843
7844
|
</methods>
|
|
7844
7845
|
<lines>
|
|
7845
7846
|
<line number="7" hits="4" branch="false"/>
|
|
7846
|
-
<line number="
|
|
7847
|
-
<line number="
|
|
7848
|
-
<line number="
|
|
7849
|
-
<line number="
|
|
7850
|
-
<line number="
|
|
7851
|
-
<line number="
|
|
7852
|
-
<line number="
|
|
7853
|
-
<line number="
|
|
7854
|
-
<line number="
|
|
7855
|
-
<line number="
|
|
7847
|
+
<line number="11" hits="4" branch="false"/>
|
|
7848
|
+
<line number="17" hits="4" branch="false"/>
|
|
7849
|
+
<line number="19" hits="4" branch="false"/>
|
|
7850
|
+
<line number="26" hits="4" branch="false"/>
|
|
7851
|
+
<line number="35" hits="4" branch="false"/>
|
|
7852
|
+
<line number="36" hits="3" branch="true" condition-coverage="50% (1/2)"/>
|
|
7853
|
+
<line number="39" hits="3" branch="false"/>
|
|
7854
|
+
<line number="41" hits="3" branch="true" condition-coverage="100% (1/1)"/>
|
|
7855
|
+
<line number="43" hits="0" branch="false"/>
|
|
7856
|
+
<line number="45" hits="0" branch="false"/>
|
|
7857
|
+
<line number="52" hits="0" branch="false"/>
|
|
7856
7858
|
<line number="53" hits="0" branch="false"/>
|
|
7857
|
-
<line number="
|
|
7859
|
+
<line number="56" hits="0" branch="false"/>
|
|
7858
7860
|
<line number="57" hits="0" branch="false"/>
|
|
7859
|
-
<line number="
|
|
7861
|
+
<line number="61" hits="0" branch="false"/>
|
|
7860
7862
|
<line number="62" hits="0" branch="false"/>
|
|
7861
|
-
<line number="
|
|
7862
|
-
<line number="
|
|
7863
|
-
<line number="
|
|
7863
|
+
<line number="69" hits="0" branch="true" condition-coverage="0% (0/4)"/>
|
|
7864
|
+
<line number="74" hits="0" branch="false"/>
|
|
7865
|
+
<line number="76" hits="0" branch="false"/>
|
|
7864
7866
|
<line number="77" hits="0" branch="false"/>
|
|
7865
|
-
<line number="
|
|
7866
|
-
<line number="87" hits="
|
|
7867
|
-
<line number="
|
|
7868
|
-
<line number="
|
|
7869
|
-
<line number="101" hits="
|
|
7870
|
-
<line number="102" hits="0" branch="
|
|
7871
|
-
<line number="103" hits="0" branch="
|
|
7872
|
-
<line number="
|
|
7873
|
-
<line number="112" hits="
|
|
7874
|
-
<line number="113" hits="0" branch="
|
|
7875
|
-
<line number="
|
|
7876
|
-
<line number="122" hits="
|
|
7877
|
-
<line number="123" hits="0" branch="
|
|
7878
|
-
<line number="
|
|
7879
|
-
<line number="133" hits="
|
|
7880
|
-
<line number="134" hits="0" branch="
|
|
7881
|
-
<line number="
|
|
7882
|
-
<line number="144" hits="
|
|
7883
|
-
<line number="
|
|
7884
|
-
<line number="147" hits="0" branch="true" condition-coverage="0% (0/
|
|
7885
|
-
<line number="148" hits="0" branch="
|
|
7886
|
-
<line number="
|
|
7887
|
-
<line number="162" hits="
|
|
7888
|
-
<line number="163" hits="0" branch="
|
|
7889
|
-
<line number="164" hits="0" branch="
|
|
7890
|
-
<line number="
|
|
7867
|
+
<line number="86" hits="4" branch="false"/>
|
|
7868
|
+
<line number="87" hits="3" branch="true" condition-coverage="75% (3/4)"/>
|
|
7869
|
+
<line number="92" hits="3" branch="false"/>
|
|
7870
|
+
<line number="100" hits="4" branch="false"/>
|
|
7871
|
+
<line number="101" hits="0" branch="false"/>
|
|
7872
|
+
<line number="102" hits="0" branch="true" condition-coverage="0% (0/4)"/>
|
|
7873
|
+
<line number="103" hits="0" branch="false"/>
|
|
7874
|
+
<line number="111" hits="4" branch="false"/>
|
|
7875
|
+
<line number="112" hits="0" branch="false"/>
|
|
7876
|
+
<line number="113" hits="0" branch="true" condition-coverage="0% (0/4)"/>
|
|
7877
|
+
<line number="121" hits="4" branch="false"/>
|
|
7878
|
+
<line number="122" hits="0" branch="false"/>
|
|
7879
|
+
<line number="123" hits="0" branch="true" condition-coverage="0% (0/4)"/>
|
|
7880
|
+
<line number="132" hits="4" branch="false"/>
|
|
7881
|
+
<line number="133" hits="0" branch="false"/>
|
|
7882
|
+
<line number="134" hits="0" branch="true" condition-coverage="0% (0/4)"/>
|
|
7883
|
+
<line number="143" hits="4" branch="false"/>
|
|
7884
|
+
<line number="144" hits="0" branch="false"/>
|
|
7885
|
+
<line number="146" hits="0" branch="true" condition-coverage="0% (0/3)"/>
|
|
7886
|
+
<line number="147" hits="0" branch="true" condition-coverage="0% (0/4)"/>
|
|
7887
|
+
<line number="148" hits="0" branch="false"/>
|
|
7888
|
+
<line number="161" hits="4" branch="false"/>
|
|
7889
|
+
<line number="162" hits="0" branch="false"/>
|
|
7890
|
+
<line number="163" hits="0" branch="true" condition-coverage="0% (0/1)"/>
|
|
7891
|
+
<line number="164" hits="0" branch="false"/>
|
|
7892
|
+
<line number="166" hits="0" branch="false"/>
|
|
7891
7893
|
<line number="167" hits="0" branch="false"/>
|
|
7892
|
-
<line number="
|
|
7893
|
-
<line number="171" hits="
|
|
7894
|
-
<line number="
|
|
7895
|
-
<line number="178" hits="
|
|
7896
|
-
<line number="
|
|
7897
|
-
<line number="189" hits="
|
|
7894
|
+
<line number="170" hits="4" branch="false"/>
|
|
7895
|
+
<line number="171" hits="0" branch="true" condition-coverage="0% (0/4)"/>
|
|
7896
|
+
<line number="177" hits="4" branch="false"/>
|
|
7897
|
+
<line number="178" hits="0" branch="true" condition-coverage="0% (0/4)"/>
|
|
7898
|
+
<line number="188" hits="4" branch="false"/>
|
|
7899
|
+
<line number="189" hits="0" branch="true" condition-coverage="0% (0/4)"/>
|
|
7898
7900
|
<line number="190" hits="0" branch="true" condition-coverage="0% (0/4)"/>
|
|
7899
|
-
<line number="
|
|
7900
|
-
<line number="197" hits="
|
|
7901
|
-
<line number="
|
|
7902
|
-
<line number="201" hits="4" branch="false"/>
|
|
7901
|
+
<line number="196" hits="4" branch="false"/>
|
|
7902
|
+
<line number="197" hits="1" branch="false"/>
|
|
7903
|
+
<line number="200" hits="4" branch="false"/>
|
|
7903
7904
|
</lines>
|
|
7904
7905
|
</class>
|
|
7905
7906
|
<class name="useHotKey.ts" filename="src/utils/useHotKey.ts" line-rate="0.7916" branch-rate="0.6">
|
package/ipc/MetaFiles.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { z } from 'zod';
|
|
8
8
|
|
|
9
9
|
export type UrlString = string;
|
|
10
10
|
|
|
@@ -40,49 +40,21 @@ export interface AppInfo {
|
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
export const semver = z.string().regex(
|
|
44
|
+
// From https://semver.org
|
|
45
|
+
/^(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-]+)*))?$/,
|
|
46
|
+
'Is not a valid string for a semantic version'
|
|
47
|
+
);
|
|
46
48
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
nrfutil?: NrfutilModules;
|
|
50
|
-
html?: string;
|
|
51
|
-
}
|
|
49
|
+
const nrfutilModuleName = z.string();
|
|
50
|
+
const nrfutilModuleVersion = semver;
|
|
52
51
|
|
|
53
|
-
type
|
|
52
|
+
export type NrfutilModuleName = z.infer<typeof nrfutilModuleName>;
|
|
53
|
+
export type NrfutilModuleVersion = z.infer<typeof nrfutilModuleVersion>;
|
|
54
54
|
|
|
55
|
-
export
|
|
56
|
-
|
|
55
|
+
export const nrfModules = z.record(
|
|
56
|
+
nrfutilModuleName,
|
|
57
|
+
nrfutilModuleVersion.array().nonempty()
|
|
58
|
+
);
|
|
57
59
|
|
|
58
|
-
export
|
|
59
|
-
[name: NrfutilModuleName]: [
|
|
60
|
-
NrfutilModuleVersion,
|
|
61
|
-
...NrfutilModuleVersion[]
|
|
62
|
-
];
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export interface PackageJson {
|
|
66
|
-
name: string;
|
|
67
|
-
version: SemverString;
|
|
68
|
-
|
|
69
|
-
// Several optional properties
|
|
70
|
-
author?: string;
|
|
71
|
-
bin?: ObjectContainingOptionalStrings | string;
|
|
72
|
-
dependencies?: ObjectContainingOptionalStrings;
|
|
73
|
-
description?: string;
|
|
74
|
-
homepage?: UrlString;
|
|
75
|
-
devDependencies?: ObjectContainingOptionalStrings;
|
|
76
|
-
displayName?: string;
|
|
77
|
-
engines?: ObjectContainingOptionalStrings;
|
|
78
|
-
nrfConnectForDesktop?: NrfConnectForDesktop;
|
|
79
|
-
files?: readonly string[];
|
|
80
|
-
license?: string;
|
|
81
|
-
main?: string;
|
|
82
|
-
peerDependencies?: ObjectContainingOptionalStrings;
|
|
83
|
-
repository?: {
|
|
84
|
-
type: string;
|
|
85
|
-
url: UrlString;
|
|
86
|
-
};
|
|
87
|
-
scripts?: ObjectContainingOptionalStrings;
|
|
88
|
-
}
|
|
60
|
+
export type NrfutilModules = z.infer<typeof nrfModules>;
|
package/ipc/device.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023 Nordic Semiconductor ASA
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export const knownDevicePcas = [
|
|
8
|
+
'PCA10028',
|
|
9
|
+
'PCA10031',
|
|
10
|
+
'PCA10040',
|
|
11
|
+
'PCA10056',
|
|
12
|
+
'PCA10059',
|
|
13
|
+
'PCA10090',
|
|
14
|
+
'PCA10095',
|
|
15
|
+
'PCA10100',
|
|
16
|
+
'PCA10121',
|
|
17
|
+
'PCA20020',
|
|
18
|
+
'PCA20035',
|
|
19
|
+
'PCA10143',
|
|
20
|
+
'PCA10152',
|
|
21
|
+
'PCA10153',
|
|
22
|
+
'PCA20049',
|
|
23
|
+
] as const;
|
|
24
|
+
|
|
25
|
+
export type KnownDevicePCA = (typeof knownDevicePcas)[number];
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023 Nordic Semiconductor ASA
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
|
|
9
|
+
import { knownDevicePcas } from '../device';
|
|
10
|
+
import { nrfModules, semver } from '../MetaFiles';
|
|
11
|
+
import { parseWithPrettifiedErrorMessage } from './parseJson';
|
|
12
|
+
|
|
13
|
+
const nrfConnectForDesktop = z.object({
|
|
14
|
+
supportedDevices: z.enum(knownDevicePcas).array().nonempty().optional(),
|
|
15
|
+
nrfutil: nrfModules.optional(),
|
|
16
|
+
html: z.string(),
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const recordOfOptionalStrings = z.record(z.string().optional());
|
|
20
|
+
|
|
21
|
+
const engines = recordOfOptionalStrings.and(
|
|
22
|
+
z.object({ nrfconnect: z.string() })
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
const packageJson = z.object({
|
|
26
|
+
name: z.string(),
|
|
27
|
+
version: semver,
|
|
28
|
+
|
|
29
|
+
author: z.string().optional(),
|
|
30
|
+
bin: z.string().or(recordOfOptionalStrings).optional(),
|
|
31
|
+
dependencies: recordOfOptionalStrings.optional(),
|
|
32
|
+
description: z.string(),
|
|
33
|
+
homepage: z.string().url().optional(),
|
|
34
|
+
devDependencies: recordOfOptionalStrings.optional(),
|
|
35
|
+
displayName: z.string(),
|
|
36
|
+
engines,
|
|
37
|
+
nrfConnectForDesktop,
|
|
38
|
+
files: z.string().array().optional(),
|
|
39
|
+
license: z.string().optional(),
|
|
40
|
+
main: z.string().optional(),
|
|
41
|
+
peerDependencies: recordOfOptionalStrings.optional(),
|
|
42
|
+
repository: z
|
|
43
|
+
.object({
|
|
44
|
+
type: z.string(),
|
|
45
|
+
url: z.string().url(),
|
|
46
|
+
})
|
|
47
|
+
.optional(),
|
|
48
|
+
scripts: recordOfOptionalStrings.optional(),
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
export type PackageJson = z.infer<typeof packageJson>;
|
|
52
|
+
|
|
53
|
+
export const parsePackageJson =
|
|
54
|
+
parseWithPrettifiedErrorMessage<PackageJson>(packageJson);
|
|
55
|
+
|
|
56
|
+
// In the launcher we want to handle that the whole nrfConnectForDesktop may be missing
|
|
57
|
+
// and the html in it can also be undefined, so there we need to use this legacy variant
|
|
58
|
+
const legacyPackageJson = packageJson.merge(
|
|
59
|
+
z.object({
|
|
60
|
+
nrfConnectForDesktop: nrfConnectForDesktop
|
|
61
|
+
.partial({ html: true })
|
|
62
|
+
.optional(),
|
|
63
|
+
})
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
export type LegacyPackageJson = z.infer<typeof legacyPackageJson>;
|
|
67
|
+
|
|
68
|
+
export const parseLegacyPackageJson =
|
|
69
|
+
parseWithPrettifiedErrorMessage<LegacyPackageJson>(legacyPackageJson);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023 Nordic Semiconductor ASA
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
import { fromZodError } from 'zod-validation-error';
|
|
9
|
+
|
|
10
|
+
export const parseWithPrettifiedErrorMessage =
|
|
11
|
+
<Out, T extends z.ZodType<Out> = z.ZodTypeAny>(schema: T) =>
|
|
12
|
+
(content: string) => {
|
|
13
|
+
const result = schema.safeParse(JSON.parse(content));
|
|
14
|
+
|
|
15
|
+
if (result.success) {
|
|
16
|
+
return result;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return {
|
|
20
|
+
...result,
|
|
21
|
+
error: fromZodError(result.error, {
|
|
22
|
+
prefix: 'Error in package.json',
|
|
23
|
+
prefixSeparator: ':\n- ',
|
|
24
|
+
issueSeparator: '\n- ',
|
|
25
|
+
}),
|
|
26
|
+
};
|
|
27
|
+
};
|
package/main/index.ts
CHANGED
|
@@ -28,7 +28,20 @@ export const serialPort = {
|
|
|
28
28
|
forRenderer: forRendererSerialPort,
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
export
|
|
31
|
+
export {
|
|
32
|
+
type AppInfo,
|
|
33
|
+
type NrfutilModuleName,
|
|
34
|
+
type NrfutilModules,
|
|
35
|
+
type NrfutilModuleVersion,
|
|
36
|
+
type SourceJson,
|
|
37
|
+
type WithdrawnJson,
|
|
38
|
+
} from '../ipc/MetaFiles';
|
|
39
|
+
export {
|
|
40
|
+
type LegacyPackageJson,
|
|
41
|
+
type PackageJson,
|
|
42
|
+
parseLegacyPackageJson,
|
|
43
|
+
parsePackageJson,
|
|
44
|
+
} from '../ipc/schema/packageJson';
|
|
32
45
|
|
|
33
46
|
export { type OverwriteOptions } from '../ipc/serialPort';
|
|
34
47
|
export { type OpenAppOptions } from '../ipc/openWindow';
|