@nordicsemiconductor/pc-nrfconnect-shared 115.0.0 → 116.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 +8 -0
- package/config/jest.config.js +3 -2
- package/coverage/cobertura-coverage.xml +106 -105
- package/nrfutil/device/batch.ts +24 -12
- package/nrfutil/sandbox.ts +3 -1
- package/package.json +1 -1
- package/scripts/esbuild-renderer.js +7 -0
- package/scripts/esbuild.js +7 -8
- package/src/utils/packageJson.ts +15 -42
- package/typings/generated/nrfutil/device/batch.d.ts.map +1 -1
- package/typings/generated/nrfutil/sandbox.d.ts.map +1 -1
- package/typings/generated/src/utils/packageJson.d.ts.map +1 -1
package/Changelog.md
CHANGED
|
@@ -7,6 +7,14 @@ 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
|
+
## 116 - 2023-10-03
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- `nrfutil` abort log messages is now more descriptive
|
|
15
|
+
- `nrfutil device batch` could previously call the `onException` when task was
|
|
16
|
+
complete.
|
|
17
|
+
|
|
10
18
|
## 115 - 2023-09-28
|
|
11
19
|
|
|
12
20
|
### Fixed
|
package/config/jest.config.js
CHANGED
|
@@ -17,8 +17,9 @@ module.exports = (disabledMocks = []) => ({
|
|
|
17
17
|
'^electron$': `${mockDir}/electronMock.ts`,
|
|
18
18
|
'^electron-store$': `${mockDir}/electronStoreMock.ts`,
|
|
19
19
|
'@electron/remote': `${mockDir}/remoteMock.ts`,
|
|
20
|
-
'react-markdown':
|
|
21
|
-
'
|
|
20
|
+
'react-markdown': require.resolve(
|
|
21
|
+
'react-markdown/react-markdown.min.js'
|
|
22
|
+
),
|
|
22
23
|
...(disabledMocks.includes('packageJson')
|
|
23
24
|
? {}
|
|
24
25
|
: {
|
|
@@ -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="3209" lines-covered="1788" line-rate="0.5571" branches-valid="1541" branches-covered="448" branch-rate="0.2907" timestamp="1696334939734" complexity="0" version="0.1">
|
|
4
4
|
<sources>
|
|
5
5
|
<source>/home/vsts/work/1/s</source>
|
|
6
6
|
</sources>
|
|
@@ -614,102 +614,102 @@
|
|
|
614
614
|
</method>
|
|
615
615
|
<method name="(anonymous_33)" hits="0" signature="()V">
|
|
616
616
|
<lines>
|
|
617
|
-
<line number="
|
|
617
|
+
<line number="355" hits="0"/>
|
|
618
618
|
</lines>
|
|
619
619
|
</method>
|
|
620
620
|
<method name="(anonymous_34)" hits="0" signature="()V">
|
|
621
621
|
<lines>
|
|
622
|
-
<line number="
|
|
622
|
+
<line number="367" hits="0"/>
|
|
623
623
|
</lines>
|
|
624
624
|
</method>
|
|
625
625
|
<method name="(anonymous_35)" hits="0" signature="()V">
|
|
626
626
|
<lines>
|
|
627
|
-
<line number="
|
|
627
|
+
<line number="375" hits="0"/>
|
|
628
628
|
</lines>
|
|
629
629
|
</method>
|
|
630
630
|
<method name="(anonymous_36)" hits="0" signature="()V">
|
|
631
631
|
<lines>
|
|
632
|
-
<line number="
|
|
632
|
+
<line number="383" hits="0"/>
|
|
633
633
|
</lines>
|
|
634
634
|
</method>
|
|
635
635
|
<method name="(anonymous_37)" hits="0" signature="()V">
|
|
636
636
|
<lines>
|
|
637
|
-
<line number="
|
|
637
|
+
<line number="390" hits="0"/>
|
|
638
638
|
</lines>
|
|
639
639
|
</method>
|
|
640
640
|
<method name="(anonymous_38)" hits="0" signature="()V">
|
|
641
641
|
<lines>
|
|
642
|
-
<line number="
|
|
642
|
+
<line number="392" hits="0"/>
|
|
643
643
|
</lines>
|
|
644
644
|
</method>
|
|
645
645
|
<method name="(anonymous_39)" hits="0" signature="()V">
|
|
646
646
|
<lines>
|
|
647
|
-
<line number="
|
|
647
|
+
<line number="394" hits="0"/>
|
|
648
648
|
</lines>
|
|
649
649
|
</method>
|
|
650
650
|
<method name="(anonymous_40)" hits="0" signature="()V">
|
|
651
651
|
<lines>
|
|
652
|
-
<line number="
|
|
652
|
+
<line number="396" hits="0"/>
|
|
653
653
|
</lines>
|
|
654
654
|
</method>
|
|
655
655
|
<method name="(anonymous_41)" hits="0" signature="()V">
|
|
656
656
|
<lines>
|
|
657
|
-
<line number="
|
|
657
|
+
<line number="400" hits="0"/>
|
|
658
658
|
</lines>
|
|
659
659
|
</method>
|
|
660
660
|
<method name="(anonymous_42)" hits="0" signature="()V">
|
|
661
661
|
<lines>
|
|
662
|
-
<line number="
|
|
662
|
+
<line number="404" hits="0"/>
|
|
663
663
|
</lines>
|
|
664
664
|
</method>
|
|
665
665
|
<method name="(anonymous_43)" hits="0" signature="()V">
|
|
666
666
|
<lines>
|
|
667
|
-
<line number="
|
|
667
|
+
<line number="405" hits="0"/>
|
|
668
668
|
</lines>
|
|
669
669
|
</method>
|
|
670
670
|
<method name="(anonymous_44)" hits="0" signature="()V">
|
|
671
671
|
<lines>
|
|
672
|
-
<line number="
|
|
672
|
+
<line number="408" hits="0"/>
|
|
673
673
|
</lines>
|
|
674
674
|
</method>
|
|
675
675
|
<method name="(anonymous_45)" hits="0" signature="()V">
|
|
676
676
|
<lines>
|
|
677
|
-
<line number="
|
|
677
|
+
<line number="414" hits="0"/>
|
|
678
678
|
</lines>
|
|
679
679
|
</method>
|
|
680
680
|
<method name="(anonymous_46)" hits="0" signature="()V">
|
|
681
681
|
<lines>
|
|
682
|
-
<line number="
|
|
682
|
+
<line number="433" hits="0"/>
|
|
683
683
|
</lines>
|
|
684
684
|
</method>
|
|
685
685
|
<method name="(anonymous_47)" hits="0" signature="()V">
|
|
686
686
|
<lines>
|
|
687
|
-
<line number="
|
|
687
|
+
<line number="454" hits="0"/>
|
|
688
688
|
</lines>
|
|
689
689
|
</method>
|
|
690
690
|
<method name="(anonymous_48)" hits="0" signature="()V">
|
|
691
691
|
<lines>
|
|
692
|
-
<line number="
|
|
692
|
+
<line number="474" hits="0"/>
|
|
693
693
|
</lines>
|
|
694
694
|
</method>
|
|
695
695
|
<method name="(anonymous_49)" hits="0" signature="()V">
|
|
696
696
|
<lines>
|
|
697
|
-
<line number="
|
|
697
|
+
<line number="477" hits="0"/>
|
|
698
698
|
</lines>
|
|
699
699
|
</method>
|
|
700
700
|
<method name="(anonymous_50)" hits="0" signature="()V">
|
|
701
701
|
<lines>
|
|
702
|
-
<line number="
|
|
702
|
+
<line number="484" hits="0"/>
|
|
703
703
|
</lines>
|
|
704
704
|
</method>
|
|
705
705
|
<method name="(anonymous_51)" hits="0" signature="()V">
|
|
706
706
|
<lines>
|
|
707
|
-
<line number="
|
|
707
|
+
<line number="489" hits="0"/>
|
|
708
708
|
</lines>
|
|
709
709
|
</method>
|
|
710
710
|
<method name="(anonymous_52)" hits="0" signature="()V">
|
|
711
711
|
<lines>
|
|
712
|
-
<line number="
|
|
712
|
+
<line number="532" hits="0"/>
|
|
713
713
|
</lines>
|
|
714
714
|
</method>
|
|
715
715
|
</methods>
|
|
@@ -846,76 +846,76 @@
|
|
|
846
846
|
<line number="335" hits="0" branch="true" condition-coverage="0% (0/4)"/>
|
|
847
847
|
<line number="336" hits="0" branch="true" condition-coverage="0% (0/1)"/>
|
|
848
848
|
<line number="337" hits="0" branch="false"/>
|
|
849
|
-
<line number="
|
|
850
|
-
<line number="
|
|
851
|
-
<line number="346" hits="0" branch="false"/>
|
|
849
|
+
<line number="344" hits="0" branch="false"/>
|
|
850
|
+
<line number="347" hits="0" branch="true" condition-coverage="0% (0/2)"/>
|
|
852
851
|
<line number="348" hits="0" branch="false"/>
|
|
853
|
-
<line number="
|
|
854
|
-
<line number="
|
|
855
|
-
<line number="359" hits="0" branch="false"/>
|
|
852
|
+
<line number="350" hits="0" branch="false"/>
|
|
853
|
+
<line number="355" hits="0" branch="false"/>
|
|
856
854
|
<line number="360" hits="0" branch="false"/>
|
|
855
|
+
<line number="361" hits="0" branch="false"/>
|
|
857
856
|
<line number="362" hits="0" branch="false"/>
|
|
858
|
-
<line number="
|
|
859
|
-
<line number="369" hits="0" branch="
|
|
860
|
-
<line number="
|
|
861
|
-
<line number="
|
|
862
|
-
<line number="
|
|
863
|
-
<line number="
|
|
864
|
-
<line number="
|
|
865
|
-
<line number="
|
|
866
|
-
<line number="
|
|
857
|
+
<line number="364" hits="0" branch="false"/>
|
|
858
|
+
<line number="369" hits="0" branch="false"/>
|
|
859
|
+
<line number="371" hits="0" branch="true" condition-coverage="0% (0/1)"/>
|
|
860
|
+
<line number="372" hits="0" branch="false"/>
|
|
861
|
+
<line number="375" hits="0" branch="false"/>
|
|
862
|
+
<line number="376" hits="0" branch="true" condition-coverage="0% (0/1)"/>
|
|
863
|
+
<line number="377" hits="0" branch="true" condition-coverage="0% (0/1)"/>
|
|
864
|
+
<line number="378" hits="0" branch="false"/>
|
|
865
|
+
<line number="384" hits="0" branch="false"/>
|
|
867
866
|
<line number="389" hits="0" branch="false"/>
|
|
868
|
-
<line number="
|
|
869
|
-
<line number="
|
|
870
|
-
<line number="
|
|
871
|
-
<line number="
|
|
872
|
-
<line number="399" hits="0" branch="
|
|
873
|
-
<line number="
|
|
867
|
+
<line number="391" hits="0" branch="false"/>
|
|
868
|
+
<line number="392" hits="0" branch="false"/>
|
|
869
|
+
<line number="395" hits="0" branch="false"/>
|
|
870
|
+
<line number="396" hits="0" branch="false"/>
|
|
871
|
+
<line number="399" hits="0" branch="false"/>
|
|
872
|
+
<line number="401" hits="0" branch="true" condition-coverage="0% (0/1)"/>
|
|
874
873
|
<line number="402" hits="0" branch="false"/>
|
|
875
874
|
<line number="404" hits="0" branch="false"/>
|
|
876
875
|
<line number="406" hits="0" branch="false"/>
|
|
877
|
-
<line number="
|
|
878
|
-
<line number="
|
|
879
|
-
<line number="
|
|
880
|
-
<line number="
|
|
881
|
-
<line number="
|
|
876
|
+
<line number="408" hits="0" branch="false"/>
|
|
877
|
+
<line number="409" hits="0" branch="false"/>
|
|
878
|
+
<line number="414" hits="0" branch="false"/>
|
|
879
|
+
<line number="420" hits="0" branch="false"/>
|
|
880
|
+
<line number="427" hits="0" branch="true" condition-coverage="0% (0/1)"/>
|
|
882
881
|
<line number="428" hits="0" branch="false"/>
|
|
883
|
-
<line number="
|
|
884
|
-
<line number="
|
|
885
|
-
<line number="
|
|
886
|
-
<line number="
|
|
882
|
+
<line number="430" hits="0" branch="false"/>
|
|
883
|
+
<line number="433" hits="0" branch="false"/>
|
|
884
|
+
<line number="439" hits="0" branch="false"/>
|
|
885
|
+
<line number="448" hits="0" branch="true" condition-coverage="0% (0/1)"/>
|
|
887
886
|
<line number="449" hits="0" branch="false"/>
|
|
888
|
-
<line number="
|
|
889
|
-
<line number="
|
|
890
|
-
<line number="
|
|
891
|
-
<line number="
|
|
887
|
+
<line number="451" hits="0" branch="false"/>
|
|
888
|
+
<line number="454" hits="0" branch="false"/>
|
|
889
|
+
<line number="459" hits="0" branch="false"/>
|
|
890
|
+
<line number="468" hits="0" branch="true" condition-coverage="0% (0/1)"/>
|
|
892
891
|
<line number="469" hits="0" branch="false"/>
|
|
893
|
-
<line number="
|
|
894
|
-
<line number="
|
|
892
|
+
<line number="471" hits="0" branch="false"/>
|
|
893
|
+
<line number="474" hits="0" branch="false"/>
|
|
895
894
|
<line number="475" hits="0" branch="false"/>
|
|
896
|
-
<line number="
|
|
897
|
-
<line number="
|
|
898
|
-
<line number="
|
|
899
|
-
<line number="
|
|
900
|
-
<line number="
|
|
901
|
-
<line number="495" hits="0" branch="
|
|
902
|
-
<line number="
|
|
903
|
-
<line number="
|
|
904
|
-
<line number="
|
|
905
|
-
<line number="
|
|
906
|
-
<line number="
|
|
907
|
-
<line number="
|
|
908
|
-
<line number="
|
|
909
|
-
<line number="522" hits="0" branch="
|
|
910
|
-
<line number="
|
|
911
|
-
<line number="
|
|
912
|
-
<line number="
|
|
913
|
-
<line number="
|
|
914
|
-
<line number="
|
|
915
|
-
<line number="
|
|
916
|
-
<line number="534" hits="0" branch="
|
|
917
|
-
<line number="
|
|
918
|
-
<line number="
|
|
895
|
+
<line number="477" hits="0" branch="false"/>
|
|
896
|
+
<line number="478" hits="0" branch="false"/>
|
|
897
|
+
<line number="484" hits="0" branch="false"/>
|
|
898
|
+
<line number="485" hits="0" branch="false"/>
|
|
899
|
+
<line number="489" hits="3" branch="false"/>
|
|
900
|
+
<line number="495" hits="0" branch="false"/>
|
|
901
|
+
<line number="497" hits="0" branch="true" condition-coverage="0% (0/1)"/>
|
|
902
|
+
<line number="502" hits="0" branch="false"/>
|
|
903
|
+
<line number="507" hits="0" branch="true" condition-coverage="0% (0/2)"/>
|
|
904
|
+
<line number="511" hits="0" branch="true" condition-coverage="0% (0/4)"/>
|
|
905
|
+
<line number="512" hits="0" branch="false"/>
|
|
906
|
+
<line number="515" hits="0" branch="false"/>
|
|
907
|
+
<line number="521" hits="0" branch="true" condition-coverage="0% (0/4)"/>
|
|
908
|
+
<line number="522" hits="0" branch="false"/>
|
|
909
|
+
<line number="524" hits="0" branch="true" condition-coverage="0% (0/1)"/>
|
|
910
|
+
<line number="525" hits="0" branch="false"/>
|
|
911
|
+
<line number="528" hits="0" branch="true" condition-coverage="0% (0/4)"/>
|
|
912
|
+
<line number="529" hits="0" branch="false"/>
|
|
913
|
+
<line number="532" hits="3" branch="false"/>
|
|
914
|
+
<line number="533" hits="0" branch="true" condition-coverage="0% (0/4)"/>
|
|
915
|
+
<line number="534" hits="0" branch="true" condition-coverage="0% (0/4)"/>
|
|
916
|
+
<line number="536" hits="0" branch="false"/>
|
|
917
|
+
<line number="539" hits="0" branch="false"/>
|
|
918
|
+
<line number="542" hits="0" branch="false"/>
|
|
919
919
|
</lines>
|
|
920
920
|
</class>
|
|
921
921
|
<class name="sandboxTypes.ts" filename="nrfutil/sandboxTypes.ts" line-rate="0" branch-rate="0">
|
|
@@ -932,9 +932,9 @@
|
|
|
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.2463" branch-rate="0">
|
|
936
936
|
<classes>
|
|
937
|
-
<class name="batch.ts" filename="nrfutil/device/batch.ts" line-rate="0.
|
|
937
|
+
<class name="batch.ts" filename="nrfutil/device/batch.ts" line-rate="0.07139999999999999" branch-rate="0">
|
|
938
938
|
<methods>
|
|
939
939
|
<method name="(anonymous_3)" hits="0" signature="()V">
|
|
940
940
|
<lines>
|
|
@@ -1028,37 +1028,37 @@
|
|
|
1028
1028
|
</method>
|
|
1029
1029
|
<method name="(anonymous_21)" hits="0" signature="()V">
|
|
1030
1030
|
<lines>
|
|
1031
|
-
<line number="
|
|
1031
|
+
<line number="272" hits="0"/>
|
|
1032
1032
|
</lines>
|
|
1033
1033
|
</method>
|
|
1034
1034
|
<method name="(anonymous_22)" hits="0" signature="()V">
|
|
1035
1035
|
<lines>
|
|
1036
|
-
<line number="
|
|
1036
|
+
<line number="278" hits="0"/>
|
|
1037
1037
|
</lines>
|
|
1038
1038
|
</method>
|
|
1039
1039
|
<method name="(anonymous_23)" hits="0" signature="()V">
|
|
1040
1040
|
<lines>
|
|
1041
|
-
<line number="
|
|
1041
|
+
<line number="285" hits="0"/>
|
|
1042
1042
|
</lines>
|
|
1043
1043
|
</method>
|
|
1044
1044
|
<method name="(anonymous_24)" hits="0" signature="()V">
|
|
1045
1045
|
<lines>
|
|
1046
|
-
<line number="
|
|
1046
|
+
<line number="288" hits="0"/>
|
|
1047
1047
|
</lines>
|
|
1048
1048
|
</method>
|
|
1049
1049
|
<method name="(anonymous_25)" hits="0" signature="()V">
|
|
1050
1050
|
<lines>
|
|
1051
|
-
<line number="
|
|
1051
|
+
<line number="302" hits="0"/>
|
|
1052
1052
|
</lines>
|
|
1053
1053
|
</method>
|
|
1054
1054
|
<method name="(anonymous_26)" hits="0" signature="()V">
|
|
1055
1055
|
<lines>
|
|
1056
|
-
<line number="
|
|
1056
|
+
<line number="306" hits="0"/>
|
|
1057
1057
|
</lines>
|
|
1058
1058
|
</method>
|
|
1059
1059
|
<method name="(anonymous_27)" hits="0" signature="()V">
|
|
1060
1060
|
<lines>
|
|
1061
|
-
<line number="
|
|
1061
|
+
<line number="323" hits="0"/>
|
|
1062
1062
|
</lines>
|
|
1063
1063
|
</method>
|
|
1064
1064
|
</methods>
|
|
@@ -1126,26 +1126,27 @@
|
|
|
1126
1126
|
<line number="254" hits="0" branch="false"/>
|
|
1127
1127
|
<line number="255" hits="0" branch="false"/>
|
|
1128
1128
|
<line number="256" hits="0" branch="false"/>
|
|
1129
|
-
<line number="265" hits="0" branch="true" condition-coverage="0% (0/
|
|
1129
|
+
<line number="265" hits="0" branch="true" condition-coverage="0% (0/3)"/>
|
|
1130
1130
|
<line number="266" hits="0" branch="true" condition-coverage="0% (0/4)"/>
|
|
1131
|
-
<line number="
|
|
1132
|
-
<line number="
|
|
1133
|
-
<line number="274" hits="0" branch="false"/>
|
|
1134
|
-
<line number="276" hits="0" branch="true" condition-coverage="0% (0/4)"/>
|
|
1135
|
-
<line number="278" hits="0" branch="false"/>
|
|
1131
|
+
<line number="273" hits="0" branch="false"/>
|
|
1132
|
+
<line number="274" hits="0" branch="true" condition-coverage="0% (0/4)"/>
|
|
1136
1133
|
<line number="279" hits="0" branch="false"/>
|
|
1137
|
-
<line number="281" hits="0" branch="
|
|
1134
|
+
<line number="281" hits="0" branch="true" condition-coverage="0% (0/4)"/>
|
|
1135
|
+
<line number="283" hits="0" branch="false"/>
|
|
1136
|
+
<line number="286" hits="0" branch="false"/>
|
|
1138
1137
|
<line number="289" hits="0" branch="false"/>
|
|
1139
|
-
<line number="
|
|
1140
|
-
<line number="295" hits="0" branch="true" condition-coverage="0% (0/1)"/>
|
|
1141
|
-
<line number="296" hits="0" branch="false"/>
|
|
1142
|
-
<line number="298" hits="0" branch="false"/>
|
|
1143
|
-
<line number="301" hits="0" branch="true" condition-coverage="0% (0/4)"/>
|
|
1138
|
+
<line number="297" hits="0" branch="false"/>
|
|
1144
1139
|
<line number="302" hits="0" branch="false"/>
|
|
1145
|
-
<line number="
|
|
1146
|
-
<line number="
|
|
1147
|
-
<line number="
|
|
1148
|
-
<line number="
|
|
1140
|
+
<line number="303" hits="0" branch="true" condition-coverage="0% (0/1)"/>
|
|
1141
|
+
<line number="304" hits="0" branch="false"/>
|
|
1142
|
+
<line number="306" hits="0" branch="false"/>
|
|
1143
|
+
<line number="309" hits="0" branch="true" condition-coverage="0% (0/1)"/>
|
|
1144
|
+
<line number="310" hits="0" branch="true" condition-coverage="0% (0/4)"/>
|
|
1145
|
+
<line number="312" hits="0" branch="false"/>
|
|
1146
|
+
<line number="315" hits="0" branch="true" condition-coverage="0% (0/1)"/>
|
|
1147
|
+
<line number="316" hits="0" branch="true" condition-coverage="0% (0/6)"/>
|
|
1148
|
+
<line number="320" hits="0" branch="false"/>
|
|
1149
|
+
<line number="323" hits="0" branch="false"/>
|
|
1149
1150
|
</lines>
|
|
1150
1151
|
</class>
|
|
1151
1152
|
<class name="common.ts" filename="nrfutil/device/common.ts" line-rate="0.1739" branch-rate="0">
|
package/nrfutil/device/batch.ts
CHANGED
|
@@ -228,8 +228,8 @@ export class Batch {
|
|
|
228
228
|
device: NrfutilDeviceWithSerialnumber,
|
|
229
229
|
controller?: AbortController | undefined
|
|
230
230
|
): Promise<unknown[]> {
|
|
231
|
-
let
|
|
232
|
-
let
|
|
231
|
+
let currentOperationIndex = -1;
|
|
232
|
+
let lastCompletedOperationIndex = -1;
|
|
233
233
|
const results: TaskEnd<unknown>[] = [];
|
|
234
234
|
const operations: BatchOperationWrapperUnknown[] = [];
|
|
235
235
|
|
|
@@ -262,21 +262,29 @@ export class Batch {
|
|
|
262
262
|
JSON.stringify(batchOperation),
|
|
263
263
|
],
|
|
264
264
|
(progress, task) => {
|
|
265
|
-
if (task) {
|
|
266
|
-
operations[
|
|
265
|
+
if (task && currentOperationIndex !== -1) {
|
|
266
|
+
operations[currentOperationIndex].onProgress?.(
|
|
267
|
+
progress,
|
|
268
|
+
task
|
|
269
|
+
);
|
|
267
270
|
}
|
|
268
271
|
},
|
|
269
272
|
onTaskBegin => {
|
|
270
|
-
|
|
271
|
-
operations[
|
|
273
|
+
currentOperationIndex += 1;
|
|
274
|
+
operations[currentOperationIndex].onTaskBegin?.(
|
|
275
|
+
onTaskBegin
|
|
276
|
+
);
|
|
272
277
|
},
|
|
273
278
|
taskEnd => {
|
|
274
279
|
results.push(taskEnd);
|
|
275
280
|
|
|
276
|
-
operations[
|
|
281
|
+
operations[currentOperationIndex].onTaskEnd?.(taskEnd);
|
|
277
282
|
|
|
278
283
|
this.collectOperations
|
|
279
|
-
.filter(
|
|
284
|
+
.filter(
|
|
285
|
+
operation =>
|
|
286
|
+
operation.operationId === currentOperationIndex
|
|
287
|
+
)
|
|
280
288
|
.forEach(operation => {
|
|
281
289
|
operation.callback(
|
|
282
290
|
results.slice(
|
|
@@ -286,7 +294,7 @@ export class Batch {
|
|
|
286
294
|
);
|
|
287
295
|
});
|
|
288
296
|
|
|
289
|
-
|
|
297
|
+
lastCompletedOperationIndex += 1;
|
|
290
298
|
},
|
|
291
299
|
controller
|
|
292
300
|
);
|
|
@@ -298,12 +306,16 @@ export class Batch {
|
|
|
298
306
|
.map(e => `error: ${e.error}, message: ${e.message}`)
|
|
299
307
|
.join('\n')}`
|
|
300
308
|
);
|
|
301
|
-
|
|
309
|
+
if (currentOperationIndex !== -1) {
|
|
310
|
+
operations[currentOperationIndex].onException?.(error);
|
|
311
|
+
}
|
|
302
312
|
throw error;
|
|
303
313
|
}
|
|
304
314
|
} catch (error) {
|
|
305
|
-
if (
|
|
306
|
-
operations[
|
|
315
|
+
if (currentOperationIndex !== lastCompletedOperationIndex) {
|
|
316
|
+
operations[currentOperationIndex]?.onException?.(
|
|
317
|
+
error as Error
|
|
318
|
+
);
|
|
307
319
|
}
|
|
308
320
|
throw error;
|
|
309
321
|
}
|
package/nrfutil/sandbox.ts
CHANGED
package/package.json
CHANGED
|
@@ -15,6 +15,10 @@ const tailwindcss = require('tailwindcss');
|
|
|
15
15
|
const autoprefixer = require('autoprefixer');
|
|
16
16
|
const path = require('path');
|
|
17
17
|
|
|
18
|
+
const packageJsonOfApp = fs.readFileSync(
|
|
19
|
+
path.join(process.cwd(), 'package.json'),
|
|
20
|
+
'utf8'
|
|
21
|
+
);
|
|
18
22
|
const projectSpecificTailwindConfigPath = path.join(
|
|
19
23
|
process.cwd(),
|
|
20
24
|
'tailwind.config.js'
|
|
@@ -40,6 +44,9 @@ function options(additionalOptions) {
|
|
|
40
44
|
const appHasOwnHtml = nrfConnectForDesktop?.html !== undefined;
|
|
41
45
|
|
|
42
46
|
return {
|
|
47
|
+
define: {
|
|
48
|
+
'process.env.PACKAGE_JSON_OF_APP': JSON.stringify(packageJsonOfApp),
|
|
49
|
+
},
|
|
43
50
|
format: appHasOwnHtml ? 'iife' : 'cjs',
|
|
44
51
|
outfile,
|
|
45
52
|
outdir,
|
package/scripts/esbuild.js
CHANGED
|
@@ -24,13 +24,13 @@ if (!fs.existsSync(distFolder)) {
|
|
|
24
24
|
fs.mkdirSync(distFolder);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
);
|
|
27
|
+
const fileInShared = file =>
|
|
28
|
+
require.resolve(`@nordicsemiconductor/pc-nrfconnect-shared/${file}`);
|
|
29
|
+
|
|
30
|
+
const fileInDist = file => join(distFolder, basename(file));
|
|
31
31
|
|
|
32
32
|
const copyFileToDist = file =>
|
|
33
|
-
fs.copyFileSync(
|
|
33
|
+
fs.copyFileSync(fileInShared(file), fileInDist(file));
|
|
34
34
|
|
|
35
35
|
copyFileToDist('scripts/nordic-publish.js');
|
|
36
36
|
copyFileToDist('dist/bootstrap.css');
|
|
@@ -42,9 +42,8 @@ if (process.argv.includes('--include-bootloader')) {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
fs.copyFileSync(
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
'/fw/bootloader/graviton_bootloader_v1.0.1-[nRF5_SDK_15.0.1-1.alpha_f76d012].zip'
|
|
45
|
+
fileInShared(
|
|
46
|
+
'fw/bootloader/graviton_bootloader_v1.0.1-[nRF5_SDK_15.0.1-1.alpha_f76d012].zip'
|
|
48
47
|
),
|
|
49
48
|
join(
|
|
50
49
|
process.cwd(),
|
package/src/utils/packageJson.ts
CHANGED
|
@@ -4,51 +4,24 @@
|
|
|
4
4
|
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
/* Explanation for that cascade of eslint-disable-next-line and @ts-ignore:
|
|
8
|
-
'../../../../package.json' will resolve correctly when `shared` is used in
|
|
9
|
-
a real app, so it is fine.
|
|
10
|
-
|
|
11
|
-
When checking `shared` '../../../../package.json' will not be there, so we
|
|
12
|
-
need to disable the errors that occur in that case. That is done by the
|
|
13
|
-
second and third statement:
|
|
14
|
-
// @ts-ignore This will be available when the app uses it.
|
|
15
|
-
// eslint-disable-next-line import/no-unresolved
|
|
16
|
-
|
|
17
|
-
Usually we would not use `@ts-ignore` but rather `@ts-expect-error`. But
|
|
18
|
-
the latter is not possible for a different reason: When we type-check an
|
|
19
|
-
app that uses shared, that line will now be type-checked too and now
|
|
20
|
-
'../../../../package.json' actually is there, so `ts-expect-error` would
|
|
21
|
-
lead to an error, telling us that contrary to our expectation there is no
|
|
22
|
-
error there.
|
|
23
|
-
|
|
24
|
-
Because of that we have to use `@ts-ignore`. But that is usually forbidden
|
|
25
|
-
by the linting rules, so additionally we have to add that first line
|
|
26
|
-
eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
27
|
-
|
|
28
|
-
Phew!
|
|
29
|
-
*/
|
|
30
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
31
|
-
// @ts-ignore This will be available when the app uses it.
|
|
32
|
-
// eslint-disable-next-line import/no-unresolved
|
|
33
|
-
import packageJson from '../../../../../package.json';
|
|
34
7
|
import type { PackageJson } from '../../ipc/MetaFiles';
|
|
35
8
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
9
|
+
let cache: PackageJson | undefined;
|
|
10
|
+
|
|
11
|
+
const parsedPackageJson = () => {
|
|
12
|
+
if (cache != null) {
|
|
13
|
+
return cache;
|
|
41
14
|
}
|
|
42
15
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
16
|
+
const json = process.env.PACKAGE_JSON_OF_APP;
|
|
17
|
+
cache = JSON.parse(json ?? 'null');
|
|
18
|
+
if (cache == null) {
|
|
19
|
+
throw new Error(
|
|
20
|
+
"The env variable PACKAGE_JSON_OF_APP must be defined during bundling (through the bundler settings) but wasn't. Fix this."
|
|
21
|
+
);
|
|
22
|
+
}
|
|
48
23
|
|
|
49
|
-
|
|
50
|
-
that always at least one version is provided and also check this in
|
|
51
|
-
`check-app-properties.ts`)
|
|
52
|
-
*/
|
|
53
|
-
return packageJson as unknown as PackageJson;
|
|
24
|
+
return cache;
|
|
54
25
|
};
|
|
26
|
+
|
|
27
|
+
export default () => parsedPackageJson();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"batch.d.ts","sourceRoot":"","sources":["../../../../nrfutil/device/batch.ts"],"names":[],"mappings":";AAWA,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAyB,SAAS,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EACH,UAAU,EACV,YAAY,EAGZ,6BAA6B,EAC7B,SAAS,EACZ,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,yBAAyB,EAAE,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,IAAI,4BACzC,eAAe,SACtB,MAAM,EAAE,sCAahB;IAEK,kCAAkC,sBAC5B,MAAM,2BACS,QAAQ,SAAS,IAAI,KAAK,IAAI,4BACzC,eAAe,SACtB,MAAM,EAAE,4BAehB;IAEK,+BAA+B,sBACzB,MAAM,eACF,eAAe,SACtB,MAAM,EAAE,gBAehB;IAEK,SAAS,sBAAuB,UAAU,KAAK,IAAI,sBAzW5B,UAAU,KAAK,IAAI,IAiX/C;IAEK,WAAW,UAAW,QAAQ,UAEnC;CACL;kCAGY,MAAM,UACP,MAAM,YACJ,MAAM,2BACQ,QAAQ,SAAS,IAAI,KAAK,IAAI;AAJ1D,wBAyCE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageJson.d.ts","sourceRoot":"","sources":["../../../../src/utils/packageJson.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"packageJson.d.ts","sourceRoot":"","sources":["../../../../src/utils/packageJson.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;;AAoBvD,wBAAyC"}
|