@nordicsemiconductor/pc-nrfconnect-shared 117.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 +17 -1
- package/coverage/cobertura-coverage.xml +100 -100
- 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/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/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,22 @@ 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
|
+
|
|
10
26
|
## 117 - 2023-10-04
|
|
11
27
|
|
|
12
28
|
### Fixed
|
|
@@ -394,7 +410,7 @@ declare module '!!@svgr!*.svg' {
|
|
|
394
410
|
### Steps to upgrade when using this package
|
|
395
411
|
|
|
396
412
|
- Following this step will make the app incompatible with the currently
|
|
397
|
-
released launcher (v4.1.2): Add an `
|
|
413
|
+
released launcher (v4.1.2): Add an `html`-property to package.json. The
|
|
398
414
|
following example will use the index bundled with shared that works with our
|
|
399
415
|
apps, but apps can also make their own instead if needed.
|
|
400
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="3210" lines-covered="1788" line-rate="0.557" branches-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>
|
|
@@ -4816,37 +4816,36 @@
|
|
|
4816
4816
|
<methods>
|
|
4817
4817
|
<method name="(anonymous_9)" hits="56" signature="()V">
|
|
4818
4818
|
<lines>
|
|
4819
|
-
<line number="
|
|
4819
|
+
<line number="219" hits="56"/>
|
|
4820
4820
|
</lines>
|
|
4821
4821
|
</method>
|
|
4822
4822
|
<method name="(anonymous_11)" hits="56" signature="()V">
|
|
4823
4823
|
<lines>
|
|
4824
|
-
<line number="
|
|
4824
|
+
<line number="237" hits="56"/>
|
|
4825
4825
|
</lines>
|
|
4826
4826
|
</method>
|
|
4827
4827
|
<method name="(anonymous_12)" hits="28" signature="()V">
|
|
4828
4828
|
<lines>
|
|
4829
|
-
<line number="
|
|
4829
|
+
<line number="240" hits="28"/>
|
|
4830
4830
|
</lines>
|
|
4831
4831
|
</method>
|
|
4832
4832
|
<method name="(anonymous_13)" hits="28" signature="()V">
|
|
4833
4833
|
<lines>
|
|
4834
|
-
<line number="
|
|
4834
|
+
<line number="247" hits="28"/>
|
|
4835
4835
|
</lines>
|
|
4836
4836
|
</method>
|
|
4837
4837
|
<method name="(anonymous_14)" hits="0" signature="()V">
|
|
4838
4838
|
<lines>
|
|
4839
|
-
<line number="
|
|
4839
|
+
<line number="258" hits="0"/>
|
|
4840
4840
|
</lines>
|
|
4841
4841
|
</method>
|
|
4842
4842
|
<method name="(anonymous_15)" hits="0" signature="()V">
|
|
4843
4843
|
<lines>
|
|
4844
|
-
<line number="
|
|
4844
|
+
<line number="262" hits="0"/>
|
|
4845
4845
|
</lines>
|
|
4846
4846
|
</method>
|
|
4847
4847
|
</methods>
|
|
4848
4848
|
<lines>
|
|
4849
|
-
<line number="34" hits="3" branch="false"/>
|
|
4850
4849
|
<line number="35" hits="3" branch="false"/>
|
|
4851
4850
|
<line number="36" hits="3" branch="false"/>
|
|
4852
4851
|
<line number="37" hits="3" branch="false"/>
|
|
@@ -4855,31 +4854,32 @@
|
|
|
4855
4854
|
<line number="40" hits="3" branch="false"/>
|
|
4856
4855
|
<line number="41" hits="3" branch="false"/>
|
|
4857
4856
|
<line number="42" hits="3" branch="false"/>
|
|
4858
|
-
<line number="
|
|
4859
|
-
<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"/>
|
|
4860
4863
|
<line number="219" hits="3" branch="false"/>
|
|
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="
|
|
4880
|
-
<line number="273" hits="0" branch="true" condition-coverage="0% (0/2)"/>
|
|
4881
|
-
<line number="276" hits="3" branch="false"/>
|
|
4882
|
-
<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)"/>
|
|
4883
4883
|
</lines>
|
|
4884
4884
|
</class>
|
|
4885
4885
|
</classes>
|
|
@@ -7402,9 +7402,9 @@
|
|
|
7402
7402
|
</class>
|
|
7403
7403
|
</classes>
|
|
7404
7404
|
</package>
|
|
7405
|
-
<package name="src.utils" line-rate="0.6344" branch-rate="0.
|
|
7405
|
+
<package name="src.utils" line-rate="0.6344" branch-rate="0.17350000000000002">
|
|
7406
7406
|
<classes>
|
|
7407
|
-
<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">
|
|
7408
7408
|
<methods>
|
|
7409
7409
|
<method name="(anonymous_7)" hits="0" signature="()V">
|
|
7410
7410
|
<lines>
|
|
@@ -7438,7 +7438,7 @@
|
|
|
7438
7438
|
<line number="10" hits="13" branch="false"/>
|
|
7439
7439
|
<line number="12" hits="13" branch="false"/>
|
|
7440
7440
|
<line number="19" hits="13" branch="false"/>
|
|
7441
|
-
<line number="20" hits="0" branch="
|
|
7441
|
+
<line number="20" hits="0" branch="false"/>
|
|
7442
7442
|
<line number="21" hits="0" branch="false"/>
|
|
7443
7443
|
<line number="22" hits="0" branch="false"/>
|
|
7444
7444
|
<line number="31" hits="13" branch="false"/>
|
|
@@ -7773,134 +7773,134 @@
|
|
|
7773
7773
|
<methods>
|
|
7774
7774
|
<method name="(anonymous_13)" hits="3" signature="()V">
|
|
7775
7775
|
<lines>
|
|
7776
|
-
<line number="
|
|
7776
|
+
<line number="35" hits="3"/>
|
|
7777
7777
|
</lines>
|
|
7778
7778
|
</method>
|
|
7779
7779
|
<method name="(anonymous_14)" hits="0" signature="()V">
|
|
7780
7780
|
<lines>
|
|
7781
|
-
<line number="
|
|
7781
|
+
<line number="56" hits="0"/>
|
|
7782
7782
|
</lines>
|
|
7783
7783
|
</method>
|
|
7784
7784
|
<method name="(anonymous_15)" hits="0" signature="()V">
|
|
7785
7785
|
<lines>
|
|
7786
|
-
<line number="
|
|
7786
|
+
<line number="74" hits="0"/>
|
|
7787
7787
|
</lines>
|
|
7788
7788
|
</method>
|
|
7789
7789
|
<method name="(anonymous_16)" hits="3" signature="()V">
|
|
7790
7790
|
<lines>
|
|
7791
|
-
<line number="
|
|
7791
|
+
<line number="86" hits="3"/>
|
|
7792
7792
|
</lines>
|
|
7793
7793
|
</method>
|
|
7794
7794
|
<method name="(anonymous_17)" hits="0" signature="()V">
|
|
7795
7795
|
<lines>
|
|
7796
|
-
<line number="
|
|
7796
|
+
<line number="100" hits="0"/>
|
|
7797
7797
|
</lines>
|
|
7798
7798
|
</method>
|
|
7799
7799
|
<method name="(anonymous_18)" hits="0" signature="()V">
|
|
7800
7800
|
<lines>
|
|
7801
|
-
<line number="
|
|
7801
|
+
<line number="111" hits="0"/>
|
|
7802
7802
|
</lines>
|
|
7803
7803
|
</method>
|
|
7804
7804
|
<method name="(anonymous_19)" hits="0" signature="()V">
|
|
7805
7805
|
<lines>
|
|
7806
|
-
<line number="
|
|
7806
|
+
<line number="121" hits="0"/>
|
|
7807
7807
|
</lines>
|
|
7808
7808
|
</method>
|
|
7809
7809
|
<method name="(anonymous_20)" hits="0" signature="()V">
|
|
7810
7810
|
<lines>
|
|
7811
|
-
<line number="
|
|
7811
|
+
<line number="132" hits="0"/>
|
|
7812
7812
|
</lines>
|
|
7813
7813
|
</method>
|
|
7814
7814
|
<method name="(anonymous_21)" hits="0" signature="()V">
|
|
7815
7815
|
<lines>
|
|
7816
|
-
<line number="
|
|
7816
|
+
<line number="143" hits="0"/>
|
|
7817
7817
|
</lines>
|
|
7818
7818
|
</method>
|
|
7819
7819
|
<method name="(anonymous_22)" hits="0" signature="()V">
|
|
7820
7820
|
<lines>
|
|
7821
|
-
<line number="
|
|
7821
|
+
<line number="161" hits="0"/>
|
|
7822
7822
|
</lines>
|
|
7823
7823
|
</method>
|
|
7824
7824
|
<method name="(anonymous_23)" hits="0" signature="()V">
|
|
7825
7825
|
<lines>
|
|
7826
|
-
<line number="
|
|
7826
|
+
<line number="170" hits="0"/>
|
|
7827
7827
|
</lines>
|
|
7828
7828
|
</method>
|
|
7829
7829
|
<method name="(anonymous_24)" hits="0" signature="()V">
|
|
7830
7830
|
<lines>
|
|
7831
|
-
<line number="
|
|
7831
|
+
<line number="177" hits="0"/>
|
|
7832
7832
|
</lines>
|
|
7833
7833
|
</method>
|
|
7834
7834
|
<method name="(anonymous_25)" hits="0" signature="()V">
|
|
7835
7835
|
<lines>
|
|
7836
|
-
<line number="
|
|
7836
|
+
<line number="188" hits="0"/>
|
|
7837
7837
|
</lines>
|
|
7838
7838
|
</method>
|
|
7839
7839
|
<method name="(anonymous_26)" hits="1" signature="()V">
|
|
7840
7840
|
<lines>
|
|
7841
|
-
<line number="
|
|
7841
|
+
<line number="196" hits="1"/>
|
|
7842
7842
|
</lines>
|
|
7843
7843
|
</method>
|
|
7844
7844
|
</methods>
|
|
7845
7845
|
<lines>
|
|
7846
7846
|
<line number="7" hits="4" branch="false"/>
|
|
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="
|
|
7856
|
-
<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"/>
|
|
7857
7858
|
<line number="53" hits="0" branch="false"/>
|
|
7858
|
-
<line number="
|
|
7859
|
+
<line number="56" hits="0" branch="false"/>
|
|
7859
7860
|
<line number="57" hits="0" branch="false"/>
|
|
7860
|
-
<line number="
|
|
7861
|
+
<line number="61" hits="0" branch="false"/>
|
|
7861
7862
|
<line number="62" hits="0" branch="false"/>
|
|
7862
|
-
<line number="
|
|
7863
|
-
<line number="
|
|
7864
|
-
<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"/>
|
|
7865
7866
|
<line number="77" hits="0" branch="false"/>
|
|
7866
|
-
<line number="
|
|
7867
|
-
<line number="87" hits="
|
|
7868
|
-
<line number="
|
|
7869
|
-
<line number="
|
|
7870
|
-
<line number="101" hits="
|
|
7871
|
-
<line number="102" hits="0" branch="
|
|
7872
|
-
<line number="103" hits="0" branch="
|
|
7873
|
-
<line number="
|
|
7874
|
-
<line number="112" hits="
|
|
7875
|
-
<line number="113" hits="0" branch="
|
|
7876
|
-
<line number="
|
|
7877
|
-
<line number="122" hits="
|
|
7878
|
-
<line number="123" hits="0" branch="
|
|
7879
|
-
<line number="
|
|
7880
|
-
<line number="133" hits="
|
|
7881
|
-
<line number="134" hits="0" branch="
|
|
7882
|
-
<line number="
|
|
7883
|
-
<line number="144" hits="
|
|
7884
|
-
<line number="
|
|
7885
|
-
<line number="147" hits="0" branch="true" condition-coverage="0% (0/
|
|
7886
|
-
<line number="148" hits="0" branch="
|
|
7887
|
-
<line number="
|
|
7888
|
-
<line number="162" hits="
|
|
7889
|
-
<line number="163" hits="0" branch="
|
|
7890
|
-
<line number="164" hits="0" branch="
|
|
7891
|
-
<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"/>
|
|
7892
7893
|
<line number="167" hits="0" branch="false"/>
|
|
7893
|
-
<line number="
|
|
7894
|
-
<line number="171" hits="
|
|
7895
|
-
<line number="
|
|
7896
|
-
<line number="178" hits="
|
|
7897
|
-
<line number="
|
|
7898
|
-
<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)"/>
|
|
7899
7900
|
<line number="190" hits="0" branch="true" condition-coverage="0% (0/4)"/>
|
|
7900
|
-
<line number="
|
|
7901
|
-
<line number="197" hits="
|
|
7902
|
-
<line number="
|
|
7903
|
-
<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"/>
|
|
7904
7904
|
</lines>
|
|
7905
7905
|
</class>
|
|
7906
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';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nordicsemiconductor/pc-nrfconnect-shared",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "118.0.0",
|
|
4
4
|
"description": "Shared commodities for developing pc-nrfconnect-* packages",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"check-for-typescript": "./scripts/check-for-typescript.ts",
|
|
13
13
|
"check-app-properties": "./scripts/check-app-properties.ts",
|
|
14
14
|
"nrfconnect-license": "./scripts/nrfconnect-license.ts",
|
|
15
|
-
"run-esbuild": "./scripts/esbuild.
|
|
15
|
+
"run-esbuild": "./scripts/esbuild.ts"
|
|
16
16
|
},
|
|
17
17
|
"main": "src",
|
|
18
18
|
"scripts": {
|
|
@@ -119,7 +119,9 @@
|
|
|
119
119
|
"util": "0.12.5",
|
|
120
120
|
"uuid": "8.3.2",
|
|
121
121
|
"winston": "3.8.2",
|
|
122
|
-
"xterm-headless": "^5.3.0"
|
|
122
|
+
"xterm-headless": "^5.3.0",
|
|
123
|
+
"zod": "^3.22.2",
|
|
124
|
+
"zod-validation-error": "^1.5.0"
|
|
123
125
|
},
|
|
124
126
|
"typings": "./typings/generated/src/index.d.ts",
|
|
125
127
|
"eslintConfig": {
|