@ordergroove/smi-serve 1.10.0 → 1.11.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 +22 -0
- package/coverage/cobertura-coverage.xml +78 -67
- package/coverage/coverage.txt +3 -3
- package/package.json +2 -2
- package/src/serve.js +16 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,28 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [1.11.0](https://github.com/ordergroove/plush-toys/compare/@ordergroove/smi-serve@1.10.1...@ordergroove/smi-serve@1.11.0) (2026-02-11)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* manage focus on cancel flow close ([a1482ce](https://github.com/ordergroove/plush-toys/commit/a1482ce65e01bbeb64c205d5fbac131f4f8c5a17))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [1.10.1](https://github.com/ordergroove/plush-toys/compare/@ordergroove/smi-serve@1.10.0...@ordergroove/smi-serve@1.10.1) (2026-02-06)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* also remove data-click-target when --auto-cancel-flow ([ab2f6d9](https://github.com/ordergroove/plush-toys/commit/ab2f6d9c422a0ee5553673d6727f1cec55eacf7b))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
6
28
|
# [1.10.0](https://github.com/ordergroove/plush-toys/compare/@ordergroove/smi-serve@1.9.24...@ordergroove/smi-serve@1.10.0) (2026-01-30)
|
|
7
29
|
|
|
8
30
|
|
|
@@ -1,11 +1,11 @@
|
|
|
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="570" lines-covered="218" line-rate="0.3824" branches-valid="218" branches-covered="45" branch-rate="0.2064" timestamp="1770835493470" complexity="0" version="0.1">
|
|
4
4
|
<sources>
|
|
5
5
|
<source>/home/jenkins/agent/workspace/Ordergroove_plush-toys_master/plush-toys/packages/smi-serve</source>
|
|
6
6
|
</sources>
|
|
7
7
|
<packages>
|
|
8
|
-
<package name="smi-serve" line-rate="0.
|
|
8
|
+
<package name="smi-serve" line-rate="0.4067" branch-rate="0.2368">
|
|
9
9
|
<classes>
|
|
10
10
|
<class name="auth.js" filename="src/auth.js" line-rate="0.9333" branch-rate="0.8332999999999999">
|
|
11
11
|
<methods>
|
|
@@ -723,7 +723,7 @@
|
|
|
723
723
|
<line number="84" hits="2" branch="false"/>
|
|
724
724
|
</lines>
|
|
725
725
|
</class>
|
|
726
|
-
<class name="serve.js" filename="src/serve.js" line-rate="0.
|
|
726
|
+
<class name="serve.js" filename="src/serve.js" line-rate="0.14279999999999998" branch-rate="0">
|
|
727
727
|
<methods>
|
|
728
728
|
<method name="getGlobals" hits="0" signature="()V">
|
|
729
729
|
<lines>
|
|
@@ -737,72 +737,77 @@
|
|
|
737
737
|
</method>
|
|
738
738
|
<method name="(anonymous_2)" hits="0" signature="()V">
|
|
739
739
|
<lines>
|
|
740
|
-
<line number="
|
|
740
|
+
<line number="56" hits="0"/>
|
|
741
741
|
</lines>
|
|
742
742
|
</method>
|
|
743
743
|
<method name="(anonymous_3)" hits="0" signature="()V">
|
|
744
744
|
<lines>
|
|
745
|
-
<line number="
|
|
745
|
+
<line number="66" hits="0"/>
|
|
746
746
|
</lines>
|
|
747
747
|
</method>
|
|
748
748
|
<method name="(anonymous_4)" hits="0" signature="()V">
|
|
749
749
|
<lines>
|
|
750
|
-
<line number="
|
|
750
|
+
<line number="80" hits="0"/>
|
|
751
751
|
</lines>
|
|
752
752
|
</method>
|
|
753
753
|
<method name="(anonymous_5)" hits="0" signature="()V">
|
|
754
754
|
<lines>
|
|
755
|
-
<line number="
|
|
755
|
+
<line number="85" hits="0"/>
|
|
756
756
|
</lines>
|
|
757
757
|
</method>
|
|
758
758
|
<method name="(anonymous_6)" hits="0" signature="()V">
|
|
759
759
|
<lines>
|
|
760
|
-
<line number="
|
|
760
|
+
<line number="86" hits="0"/>
|
|
761
761
|
</lines>
|
|
762
762
|
</method>
|
|
763
763
|
<method name="(anonymous_7)" hits="0" signature="()V">
|
|
764
764
|
<lines>
|
|
765
|
-
<line number="
|
|
765
|
+
<line number="93" hits="0"/>
|
|
766
766
|
</lines>
|
|
767
767
|
</method>
|
|
768
768
|
<method name="(anonymous_8)" hits="0" signature="()V">
|
|
769
769
|
<lines>
|
|
770
|
-
<line number="
|
|
770
|
+
<line number="96" hits="0"/>
|
|
771
771
|
</lines>
|
|
772
772
|
</method>
|
|
773
773
|
<method name="(anonymous_9)" hits="0" signature="()V">
|
|
774
774
|
<lines>
|
|
775
|
-
<line number="
|
|
775
|
+
<line number="129" hits="0"/>
|
|
776
776
|
</lines>
|
|
777
777
|
</method>
|
|
778
778
|
<method name="(anonymous_10)" hits="0" signature="()V">
|
|
779
779
|
<lines>
|
|
780
|
-
<line number="
|
|
780
|
+
<line number="135" hits="0"/>
|
|
781
781
|
</lines>
|
|
782
782
|
</method>
|
|
783
783
|
<method name="(anonymous_11)" hits="0" signature="()V">
|
|
784
784
|
<lines>
|
|
785
|
-
<line number="
|
|
785
|
+
<line number="143" hits="0"/>
|
|
786
786
|
</lines>
|
|
787
787
|
</method>
|
|
788
788
|
<method name="(anonymous_12)" hits="0" signature="()V">
|
|
789
789
|
<lines>
|
|
790
|
-
<line number="
|
|
790
|
+
<line number="154" hits="0"/>
|
|
791
791
|
</lines>
|
|
792
792
|
</method>
|
|
793
793
|
<method name="(anonymous_13)" hits="0" signature="()V">
|
|
794
794
|
<lines>
|
|
795
|
-
<line number="
|
|
795
|
+
<line number="182" hits="0"/>
|
|
796
796
|
</lines>
|
|
797
797
|
</method>
|
|
798
798
|
<method name="(anonymous_14)" hits="0" signature="()V">
|
|
799
799
|
<lines>
|
|
800
|
-
<line number="
|
|
800
|
+
<line number="185" hits="0"/>
|
|
801
|
+
</lines>
|
|
802
|
+
</method>
|
|
803
|
+
<method name="(anonymous_15)" hits="0" signature="()V">
|
|
804
|
+
<lines>
|
|
805
|
+
<line number="186" hits="0"/>
|
|
801
806
|
</lines>
|
|
802
807
|
</method>
|
|
803
808
|
<method name="serve" hits="0" signature="()V">
|
|
804
809
|
<lines>
|
|
805
|
-
<line number="
|
|
810
|
+
<line number="200" hits="0"/>
|
|
806
811
|
</lines>
|
|
807
812
|
</method>
|
|
808
813
|
</methods>
|
|
@@ -827,78 +832,84 @@
|
|
|
827
832
|
<line number="42" hits="0" branch="false"/>
|
|
828
833
|
<line number="51" hits="1" branch="false"/>
|
|
829
834
|
<line number="52" hits="0" branch="true" condition-coverage="0% (0/4)"/>
|
|
830
|
-
<line number="
|
|
835
|
+
<line number="53" hits="0" branch="false"/>
|
|
831
836
|
<line number="56" hits="0" branch="false"/>
|
|
832
|
-
<line number="57" hits="0" branch="true" condition-coverage="0% (0/2)"/>
|
|
833
837
|
<line number="58" hits="0" branch="false"/>
|
|
838
|
+
<line number="59" hits="0" branch="true" condition-coverage="0% (0/2)"/>
|
|
834
839
|
<line number="60" hits="0" branch="false"/>
|
|
835
840
|
<line number="62" hits="0" branch="false"/>
|
|
836
|
-
<line number="
|
|
837
|
-
<line number="67" hits="1" branch="false"/>
|
|
841
|
+
<line number="66" hits="0" branch="false"/>
|
|
838
842
|
<line number="68" hits="0" branch="false"/>
|
|
843
|
+
<line number="69" hits="0" branch="true" condition-coverage="0% (0/2)"/>
|
|
839
844
|
<line number="70" hits="0" branch="false"/>
|
|
840
|
-
<line number="
|
|
845
|
+
<line number="72" hits="0" branch="false"/>
|
|
841
846
|
<line number="75" hits="0" branch="false"/>
|
|
842
|
-
<line number="
|
|
847
|
+
<line number="77" hits="0" branch="false"/>
|
|
848
|
+
<line number="80" hits="1" branch="false"/>
|
|
843
849
|
<line number="81" hits="0" branch="false"/>
|
|
844
850
|
<line number="83" hits="0" branch="false"/>
|
|
845
|
-
<line number="86" hits="0" branch="
|
|
846
|
-
<line number="
|
|
847
|
-
<line number="
|
|
848
|
-
<line number="93" hits="0" branch="false"/>
|
|
851
|
+
<line number="86" hits="0" branch="false"/>
|
|
852
|
+
<line number="88" hits="0" branch="false"/>
|
|
853
|
+
<line number="92" hits="0" branch="false"/>
|
|
849
854
|
<line number="94" hits="0" branch="false"/>
|
|
850
|
-
<line number="
|
|
851
|
-
<line number="
|
|
852
|
-
<line number="
|
|
853
|
-
<line number="
|
|
854
|
-
<line number="
|
|
855
|
-
<line number="
|
|
856
|
-
<line number="
|
|
855
|
+
<line number="96" hits="0" branch="false"/>
|
|
856
|
+
<line number="99" hits="0" branch="true" condition-coverage="0% (0/2)"/>
|
|
857
|
+
<line number="100" hits="0" branch="false"/>
|
|
858
|
+
<line number="102" hits="0" branch="false"/>
|
|
859
|
+
<line number="106" hits="0" branch="false"/>
|
|
860
|
+
<line number="107" hits="0" branch="false"/>
|
|
861
|
+
<line number="108" hits="0" branch="false"/>
|
|
862
|
+
<line number="114" hits="0" branch="false"/>
|
|
863
|
+
<line number="128" hits="0" branch="false"/>
|
|
864
|
+
<line number="129" hits="0" branch="false"/>
|
|
857
865
|
<line number="130" hits="0" branch="false"/>
|
|
858
|
-
<line number="
|
|
859
|
-
<line number="
|
|
860
|
-
<line number="
|
|
861
|
-
<line number="142" hits="0" branch="false"/>
|
|
866
|
+
<line number="135" hits="0" branch="false"/>
|
|
867
|
+
<line number="136" hits="0" branch="false"/>
|
|
868
|
+
<line number="143" hits="0" branch="false"/>
|
|
862
869
|
<line number="144" hits="0" branch="false"/>
|
|
863
|
-
<line number="
|
|
864
|
-
<line number="
|
|
865
|
-
<line number="150" hits="0" branch="true" condition-coverage="0% (0/2)"/>
|
|
866
|
-
<line number="154" hits="0" branch="false"/>
|
|
870
|
+
<line number="151" hits="0" branch="false"/>
|
|
871
|
+
<line number="154" hits="1" branch="false"/>
|
|
867
872
|
<line number="155" hits="0" branch="false"/>
|
|
868
873
|
<line number="157" hits="0" branch="false"/>
|
|
874
|
+
<line number="158" hits="0" branch="false"/>
|
|
869
875
|
<line number="159" hits="0" branch="false"/>
|
|
876
|
+
<line number="163" hits="0" branch="true" condition-coverage="0% (0/2)"/>
|
|
877
|
+
<line number="167" hits="0" branch="false"/>
|
|
878
|
+
<line number="168" hits="0" branch="false"/>
|
|
870
879
|
<line number="170" hits="0" branch="false"/>
|
|
871
|
-
<line number="
|
|
872
|
-
<line number="
|
|
873
|
-
<line number="175" hits="0" branch="true" condition-coverage="0% (0/4)"/>
|
|
874
|
-
<line number="176" hits="0" branch="false"/>
|
|
880
|
+
<line number="172" hits="0" branch="false"/>
|
|
881
|
+
<line number="183" hits="0" branch="false"/>
|
|
875
882
|
<line number="184" hits="0" branch="false"/>
|
|
876
|
-
<line number="
|
|
883
|
+
<line number="186" hits="0" branch="false"/>
|
|
884
|
+
<line number="188" hits="0" branch="true" condition-coverage="0% (0/4)"/>
|
|
877
885
|
<line number="189" hits="0" branch="false"/>
|
|
878
|
-
<line number="
|
|
879
|
-
<line number="192" hits="0" branch="false"/>
|
|
880
|
-
<line number="193" hits="0" branch="false"/>
|
|
881
|
-
<line number="195" hits="0" branch="true" condition-coverage="0% (0/2)"/>
|
|
882
|
-
<line number="196" hits="0" branch="false"/>
|
|
883
|
-
<line number="199" hits="0" branch="false"/>
|
|
886
|
+
<line number="197" hits="0" branch="false"/>
|
|
884
887
|
<line number="201" hits="0" branch="false"/>
|
|
885
888
|
<line number="202" hits="0" branch="false"/>
|
|
886
|
-
<line number="
|
|
889
|
+
<line number="204" hits="0" branch="false"/>
|
|
887
890
|
<line number="205" hits="0" branch="false"/>
|
|
888
|
-
<line number="
|
|
889
|
-
<line number="
|
|
890
|
-
<line number="
|
|
891
|
-
<line number="
|
|
892
|
-
<line number="
|
|
893
|
-
<line number="
|
|
894
|
-
<line number="
|
|
895
|
-
<line number="
|
|
896
|
-
<line number="
|
|
897
|
-
<line number="
|
|
891
|
+
<line number="206" hits="0" branch="false"/>
|
|
892
|
+
<line number="208" hits="0" branch="true" condition-coverage="0% (0/2)"/>
|
|
893
|
+
<line number="209" hits="0" branch="false"/>
|
|
894
|
+
<line number="212" hits="0" branch="false"/>
|
|
895
|
+
<line number="214" hits="0" branch="false"/>
|
|
896
|
+
<line number="215" hits="0" branch="false"/>
|
|
897
|
+
<line number="216" hits="0" branch="false"/>
|
|
898
|
+
<line number="218" hits="0" branch="false"/>
|
|
899
|
+
<line number="221" hits="0" branch="false"/>
|
|
900
|
+
<line number="252" hits="0" branch="true" condition-coverage="0% (0/2)"/>
|
|
901
|
+
<line number="253" hits="0" branch="false"/>
|
|
898
902
|
<line number="256" hits="0" branch="false"/>
|
|
899
|
-
<line number="
|
|
900
|
-
<line number="
|
|
901
|
-
<line number="
|
|
903
|
+
<line number="258" hits="0" branch="false"/>
|
|
904
|
+
<line number="260" hits="0" branch="false"/>
|
|
905
|
+
<line number="265" hits="0" branch="false"/>
|
|
906
|
+
<line number="266" hits="0" branch="true" condition-coverage="0% (0/2)"/>
|
|
907
|
+
<line number="267" hits="0" branch="false"/>
|
|
908
|
+
<line number="268" hits="0" branch="false"/>
|
|
909
|
+
<line number="269" hits="0" branch="false"/>
|
|
910
|
+
<line number="270" hits="0" branch="false"/>
|
|
911
|
+
<line number="272" hits="0" branch="false"/>
|
|
912
|
+
<line number="274" hits="1" branch="false"/>
|
|
902
913
|
</lines>
|
|
903
914
|
</class>
|
|
904
915
|
<class name="utils.js" filename="src/utils.js" line-rate="0.4893" branch-rate="0.44439999999999996">
|
package/coverage/coverage.txt
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---------------------|---------|----------|---------|---------|-------------------------------------------------------------------------
|
|
2
2
|
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
|
|
3
3
|
---------------------|---------|----------|---------|---------|-------------------------------------------------------------------------
|
|
4
|
-
All files |
|
|
5
|
-
src |
|
|
4
|
+
All files | 37.71 | 20.64 | 30.27 | 38.24 |
|
|
5
|
+
src | 40.07 | 23.68 | 32.35 | 40.67 |
|
|
6
6
|
auth.js | 93.33 | 83.33 | 100 | 93.33 | 14
|
|
7
7
|
impersonate.js | 15.87 | 0 | 0 | 16.66 | 10-139
|
|
8
8
|
init.js | 84.09 | 37.5 | 87.5 | 87.5 | 38,53-54,64,83
|
|
@@ -10,7 +10,7 @@ All files | 38.09 | 20.83 | 30.55 | 38.65 |
|
|
|
10
10
|
pull-theme.js | 77.77 | 56.25 | 93.75 | 76.84 | 25-28,37-38,69-70,77,94,102-103,117,130,145,156-157,163-166,178,234-239
|
|
11
11
|
push-theme.js | 0 | 0 | 0 | 0 | 1-130
|
|
12
12
|
select-merchant.js | 50 | 35.29 | 22.22 | 55.88 | 19,31,38,43-81
|
|
13
|
-
serve.js |
|
|
13
|
+
serve.js | 14.14 | 0 | 0 | 14.28 | 14-42,52-77,81-151,155-272
|
|
14
14
|
utils.js | 47.91 | 44.44 | 36.84 | 48.93 | 13,23-31,40,53-70,81-94,104,141-145,154-158,169-174,194-196
|
|
15
15
|
src/partials | 0 | 0 | 0 | 0 |
|
|
16
16
|
devmode.js | 0 | 0 | 100 | 0 | 4-21
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ordergroove/smi-serve",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"description": "Utility to serve a Subscription Manager template locally",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "Eugenio Lattanzio <eugenio.lattanzio@ordergroove.com>",
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"memfs": "^4.8.2"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "4630740e3093b00663aada0d2ffecdef3db29575"
|
|
38
38
|
}
|
package/src/serve.js
CHANGED
|
@@ -50,15 +50,28 @@ async function getGlobals(argv) {
|
|
|
50
50
|
|
|
51
51
|
const replaceCancelFlowClickHandlers = file => {
|
|
52
52
|
if (file.name.endsWith('/more-options-dropdown.liquid') || file.name.endsWith('/order-item-buttons.liquid')) {
|
|
53
|
+
let modifiedContent = file.content;
|
|
54
|
+
|
|
53
55
|
// Replace @click handlers on cancel buttons with new cancel flow handler
|
|
54
|
-
|
|
56
|
+
modifiedContent = modifiedContent.replace(/@click="[^"]*"/g, (match, offset) => {
|
|
55
57
|
// Check if this is a cancel button by looking at the context
|
|
56
|
-
const contextBefore =
|
|
58
|
+
const contextBefore = modifiedContent.substring(Math.max(0, offset - 200), offset);
|
|
57
59
|
if (contextBefore.includes('cancel')) {
|
|
58
|
-
return `onclick="window.og?.cancelFlow?.openCancelFlow({ subscriptionId: '{{ subscription.public_id }}' });"`;
|
|
60
|
+
return `onclick="window.og?.cancelFlow?.openCancelFlow({ subscriptionId: '{{ subscription.public_id }}', opener: this });"`;
|
|
61
|
+
}
|
|
62
|
+
return match;
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
// Remove data-click-target attributes from buttons that now have the cancel flow onclick handler
|
|
66
|
+
modifiedContent = modifiedContent.replace(/data-click-target="[^"]*"\s*/g, (match, offset) => {
|
|
67
|
+
// Check if this attribute is followed by the cancel flow onclick handler
|
|
68
|
+
const contextAfter = modifiedContent.substring(offset, offset + 300);
|
|
69
|
+
if (contextAfter.includes('window.og?.cancelFlow?.openCancelFlow')) {
|
|
70
|
+
return '';
|
|
59
71
|
}
|
|
60
72
|
return match;
|
|
61
73
|
});
|
|
74
|
+
|
|
62
75
|
return { ...file, content: modifiedContent };
|
|
63
76
|
}
|
|
64
77
|
return file;
|