@appdirect/sfb-toolkit 3.0.5 → 4.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.
Files changed (66) hide show
  1. package/.babelrc +8 -13
  2. package/Dockerfile +2 -2
  3. package/bin/index.js +0 -14
  4. package/coverage/clover.xml +32 -32
  5. package/coverage/coverage-final.json +10 -10
  6. package/coverage/lcov-report/block-navigation.js +8 -0
  7. package/coverage/lcov-report/constants/customUserAttributesMock.js.html +8 -3
  8. package/coverage/lcov-report/constants/index.html +8 -3
  9. package/coverage/lcov-report/constants/pageUrls.js.html +8 -3
  10. package/coverage/lcov-report/constants/userMock.js.html +8 -3
  11. package/coverage/lcov-report/controllers/controllers-utils/assetsUtils.js.html +8 -3
  12. package/coverage/lcov-report/controllers/controllers-utils/index.html +8 -3
  13. package/coverage/lcov-report/controllers/data-filters/bootstrap-data-filter.js.html +9 -4
  14. package/coverage/lcov-report/controllers/data-filters/call-to-actions-filter.js.html +8 -3
  15. package/coverage/lcov-report/controllers/data-filters/index.html +12 -7
  16. package/coverage/lcov-report/controllers/index.html +8 -3
  17. package/coverage/lcov-report/controllers/index.js.html +11 -6
  18. package/coverage/lcov-report/favicon.png +0 -0
  19. package/coverage/lcov-report/front-end-utils/src/components/base/ResultItem.js.html +18 -13
  20. package/coverage/lcov-report/front-end-utils/src/components/base/SearchBar.js.html +11 -6
  21. package/coverage/lcov-report/front-end-utils/src/components/base/index.html +13 -8
  22. package/coverage/lcov-report/front-end-utils/src/components/base/item.js.html +19 -14
  23. package/coverage/lcov-report/front-end-utils/src/components/container.js.html +11 -6
  24. package/coverage/lcov-report/front-end-utils/src/components/data-view.js.html +10 -5
  25. package/coverage/lcov-report/front-end-utils/src/components/header-view.js.html +10 -5
  26. package/coverage/lcov-report/front-end-utils/src/components/index.html +17 -12
  27. package/coverage/lcov-report/front-end-utils/src/components/search.js.html +23 -18
  28. package/coverage/lcov-report/front-end-utils/src/constants/index.html +8 -3
  29. package/coverage/lcov-report/front-end-utils/src/constants/pageUrl.js.html +8 -3
  30. package/coverage/lcov-report/front-end-utils/src/constants/roleType.js.html +8 -3
  31. package/coverage/lcov-report/front-end-utils/src/constants/searchType.js.html +8 -3
  32. package/coverage/lcov-report/front-end-utils/src/utils/debounce.js.html +8 -3
  33. package/coverage/lcov-report/front-end-utils/src/utils/index.html +8 -3
  34. package/coverage/lcov-report/index.html +18 -13
  35. package/coverage/lcov-report/middlewares/config.js.html +8 -3
  36. package/coverage/lcov-report/middlewares/index.html +8 -3
  37. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  38. package/coverage/lcov-report/sorter.js +26 -0
  39. package/coverage/lcov.info +81 -81
  40. package/index.js +14 -8
  41. package/npm-shrinkwrap.json +34576 -7042
  42. package/package.json +99 -80
  43. package/readme.md +18 -6
  44. package/src/controllers/index.js +1 -1
  45. package/src/front-end-utils/dist/toolbar.bundle.js +2 -49
  46. package/src/front-end-utils/dist/toolbar.bundle.js.LICENSE.txt +52 -0
  47. package/src/front-end-utils/src/components/base/ResultItem.js +2 -2
  48. package/src/front-end-utils/src/components/base/SearchBar.js +1 -1
  49. package/src/front-end-utils/src/components/container.js +1 -1
  50. package/src/front-end-utils/src/components/data-view.js +1 -1
  51. package/src/front-end-utils/src/components/header-view.js +1 -1
  52. package/src/front-end-utils/src/components/search.js +1 -1
  53. package/src/tools/compiler-components-prod.js +1 -1
  54. package/src/tools/gulp-tasks.js +2 -2
  55. package/src/tools/toolkit-common-fun.js +88 -4
  56. package/src/tools/toolkit-common-vars.js +1 -1
  57. package/src/tools/toolkit-components.js +11 -5
  58. package/src/tools/toolkit-create.js +19 -2
  59. package/src/tools/toolkit-install.js +20 -2
  60. package/src/tools/toolkit-package.js +4 -3
  61. package/src/tools/toolkit-setup.js +41 -7
  62. package/src/tools/toolkit-storybook.js +5 -5
  63. package/{webpack-components.config.js → webpack-components.config.cjs} +1 -3
  64. package/{webpack-components.config.prod.js → webpack-components.config.prod.cjs} +1 -3
  65. package/{webpack.config.js → webpack.config.cjs} +8 -5
  66. package/src/tools/toolkit-tests.js +0 -99
@@ -30,14 +30,14 @@
30
30
 
31
31
 
32
32
  <div class='fl pad1y space-right2'>
33
- <span class="strong">71.13% </span>
33
+ <span class="strong">71.12% </span>
34
34
  <span class="quiet">Branches</span>
35
35
  <span class='fraction'>170/239</span>
36
36
  </div>
37
37
 
38
38
 
39
39
  <div class='fl pad1y space-right2'>
40
- <span class="strong">79.39% </span>
40
+ <span class="strong">79.38% </span>
41
41
  <span class="quiet">Functions</span>
42
42
  <span class='fraction'>104/131</span>
43
43
  </div>
@@ -54,6 +54,12 @@
54
54
  <p class="quiet">
55
55
  Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
56
56
  </p>
57
+ <template id="filterTemplate">
58
+ <div class="quiet">
59
+ Filter:
60
+ <input oninput="onInput()" type="search" id="fileSearch">
61
+ </div>
62
+ </template>
57
63
  </div>
58
64
  <div class='status-line high'></div>
59
65
  <div class="pad1">
@@ -119,16 +125,16 @@
119
125
 
120
126
  <tr>
121
127
  <td class="file high" data-value="controllers/data-filters"><a href="controllers/data-filters/index.html">controllers/data-filters</a></td>
122
- <td data-value="84.62" class="pic high">
128
+ <td data-value="84.61" class="pic high">
123
129
  <div class="chart"><div class="cover-fill" style="width: 84%"></div><div class="cover-empty" style="width: 16%"></div></div>
124
130
  </td>
125
- <td data-value="84.62" class="pct high">84.62%</td>
131
+ <td data-value="84.61" class="pct high">84.61%</td>
126
132
  <td data-value="39" class="abs high">33/39</td>
127
133
  <td data-value="60" class="pct medium">60%</td>
128
134
  <td data-value="15" class="abs medium">9/15</td>
129
- <td data-value="88.89" class="pct high">88.89%</td>
135
+ <td data-value="88.88" class="pct high">88.88%</td>
130
136
  <td data-value="9" class="abs high">8/9</td>
131
- <td data-value="84.62" class="pct high">84.62%</td>
137
+ <td data-value="84.61" class="pct high">84.61%</td>
132
138
  <td data-value="39" class="abs high">33/39</td>
133
139
  </tr>
134
140
 
@@ -139,9 +145,9 @@
139
145
  </td>
140
146
  <td data-value="84.53" class="pct high">84.53%</td>
141
147
  <td data-value="181" class="abs high">153/181</td>
142
- <td data-value="86.54" class="pct high">86.54%</td>
148
+ <td data-value="86.53" class="pct high">86.53%</td>
143
149
  <td data-value="104" class="abs high">90/104</td>
144
- <td data-value="83.93" class="pct high">83.93%</td>
150
+ <td data-value="83.92" class="pct high">83.92%</td>
145
151
  <td data-value="56" class="abs high">47/56</td>
146
152
  <td data-value="84.18" class="pct high">84.18%</td>
147
153
  <td data-value="177" class="abs high">149/177</td>
@@ -149,10 +155,10 @@
149
155
 
150
156
  <tr>
151
157
  <td class="file high" data-value="front-end-utils/src/components/base"><a href="front-end-utils/src/components/base/index.html">front-end-utils/src/components/base</a></td>
152
- <td data-value="84.13" class="pic high">
158
+ <td data-value="84.12" class="pic high">
153
159
  <div class="chart"><div class="cover-fill" style="width: 84%"></div><div class="cover-empty" style="width: 16%"></div></div>
154
160
  </td>
155
- <td data-value="84.13" class="pct high">84.13%</td>
161
+ <td data-value="84.12" class="pct high">84.12%</td>
156
162
  <td data-value="63" class="abs high">53/63</td>
157
163
  <td data-value="65.85" class="pct medium">65.85%</td>
158
164
  <td data-value="41" class="abs medium">27/41</td>
@@ -214,10 +220,9 @@
214
220
  </div><!-- /wrapper -->
215
221
  <div class='footer quiet pad2 space-top1 center small'>
216
222
  Code coverage generated by
217
- <a href="https://istanbul.js.org/" target="_blank">istanbul</a>
218
- at Mon Jul 25 2022 19:04:08 GMT+0000 (Coordinated Universal Time)
223
+ <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
224
+ at 2022-10-12T21:32:58.515Z
219
225
  </div>
220
- </div>
221
226
  <script src="prettify.js"></script>
222
227
  <script>
223
228
  window.onload = function () {
@@ -54,6 +54,12 @@
54
54
  <p class="quiet">
55
55
  Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
56
56
  </p>
57
+ <template id="filterTemplate">
58
+ <div class="quiet">
59
+ Filter:
60
+ <input oninput="onInput()" type="search" id="fileSearch">
61
+ </div>
62
+ </template>
57
63
  </div>
58
64
  <div class='status-line high'></div>
59
65
  <pre><table class="coverage">
@@ -171,10 +177,9 @@ module.exports = (req, res, next) =&gt; {
171
177
  </div><!-- /wrapper -->
172
178
  <div class='footer quiet pad2 space-top1 center small'>
173
179
  Code coverage generated by
174
- <a href="https://istanbul.js.org/" target="_blank">istanbul</a>
175
- at Mon Jul 25 2022 19:04:08 GMT+0000 (Coordinated Universal Time)
180
+ <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
181
+ at 2022-10-12T21:32:58.515Z
176
182
  </div>
177
- </div>
178
183
  <script src="../prettify.js"></script>
179
184
  <script>
180
185
  window.onload = function () {
@@ -54,6 +54,12 @@
54
54
  <p class="quiet">
55
55
  Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
56
56
  </p>
57
+ <template id="filterTemplate">
58
+ <div class="quiet">
59
+ Filter:
60
+ <input oninput="onInput()" type="search" id="fileSearch">
61
+ </div>
62
+ </template>
57
63
  </div>
58
64
  <div class='status-line high'></div>
59
65
  <div class="pad1">
@@ -94,10 +100,9 @@
94
100
  </div><!-- /wrapper -->
95
101
  <div class='footer quiet pad2 space-top1 center small'>
96
102
  Code coverage generated by
97
- <a href="https://istanbul.js.org/" target="_blank">istanbul</a>
98
- at Mon Jul 25 2022 19:04:08 GMT+0000 (Coordinated Universal Time)
103
+ <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
104
+ at 2022-10-12T21:32:58.515Z
99
105
  </div>
100
- </div>
101
106
  <script src="../prettify.js"></script>
102
107
  <script>
103
108
  window.onload = function () {
@@ -24,6 +24,31 @@ var addSorting = (function() {
24
24
  return getTableHeader().querySelectorAll('th')[n];
25
25
  }
26
26
 
27
+ function onFilterInput() {
28
+ const searchValue = document.getElementById('fileSearch').value;
29
+ const rows = document.getElementsByTagName('tbody')[0].children;
30
+ for (let i = 0; i < rows.length; i++) {
31
+ const row = rows[i];
32
+ if (
33
+ row.textContent
34
+ .toLowerCase()
35
+ .includes(searchValue.toLowerCase())
36
+ ) {
37
+ row.style.display = '';
38
+ } else {
39
+ row.style.display = 'none';
40
+ }
41
+ }
42
+ }
43
+
44
+ // loads the search box
45
+ function addSearchBox() {
46
+ var template = document.getElementById('filterTemplate');
47
+ var templateClone = template.content.cloneNode(true);
48
+ templateClone.getElementById('fileSearch').oninput = onFilterInput;
49
+ template.parentElement.appendChild(templateClone);
50
+ }
51
+
27
52
  // loads all columns
28
53
  function loadColumns() {
29
54
  var colNodes = getTableHeader().querySelectorAll('th'),
@@ -162,6 +187,7 @@ var addSorting = (function() {
162
187
  }
163
188
  cols = loadColumns();
164
189
  loadData();
190
+ addSearchBox();
165
191
  addSortIndicators();
166
192
  enableUI();
167
193
  };
@@ -709,15 +709,15 @@ FN:257,(anonymous_29)
709
709
  FN:290,(anonymous_30)
710
710
  FNF:31
711
711
  FNH:29
712
- FNDA:58,(anonymous_0)
713
- FNDA:58,(anonymous_1)
714
- FNDA:58,(anonymous_2)
712
+ FNDA:57,(anonymous_0)
713
+ FNDA:57,(anonymous_1)
714
+ FNDA:57,(anonymous_2)
715
715
  FNDA:13,(anonymous_3)
716
716
  FNDA:13,(anonymous_4)
717
717
  FNDA:5,(anonymous_5)
718
718
  FNDA:5,(anonymous_6)
719
719
  FNDA:11,(anonymous_7)
720
- FNDA:17,(anonymous_8)
720
+ FNDA:16,(anonymous_8)
721
721
  FNDA:0,(anonymous_9)
722
722
  FNDA:7,(anonymous_10)
723
723
  FNDA:11,(anonymous_11)
@@ -726,7 +726,7 @@ FNDA:0,(anonymous_13)
726
726
  FNDA:6,(anonymous_14)
727
727
  FNDA:5,(anonymous_15)
728
728
  FNDA:8,(anonymous_16)
729
- FNDA:5,(anonymous_17)
729
+ FNDA:4,(anonymous_17)
730
730
  FNDA:10,(anonymous_18)
731
731
  FNDA:3,(anonymous_19)
732
732
  FNDA:3,(anonymous_20)
@@ -738,12 +738,12 @@ FNDA:6,(anonymous_25)
738
738
  FNDA:5,(anonymous_26)
739
739
  FNDA:12,(anonymous_27)
740
740
  FNDA:5,(anonymous_28)
741
- FNDA:58,(anonymous_29)
742
- FNDA:17,(anonymous_30)
741
+ FNDA:57,(anonymous_29)
742
+ FNDA:16,(anonymous_30)
743
743
  DA:13,2
744
- DA:15,58
745
- DA:17,58
746
- DA:25,58
744
+ DA:15,57
745
+ DA:17,57
746
+ DA:25,57
747
747
  DA:29,2
748
748
  DA:40,2
749
749
  DA:48,2
@@ -760,13 +760,13 @@ DA:87,5
760
760
  DA:90,5
761
761
  DA:91,5
762
762
  DA:98,11
763
- DA:103,17
764
- DA:104,17
763
+ DA:103,16
764
+ DA:104,16
765
765
  DA:105,4
766
- DA:114,13
767
- DA:115,13
766
+ DA:114,12
767
+ DA:115,12
768
768
  DA:131,0
769
- DA:136,17
769
+ DA:136,16
770
770
  DA:140,7
771
771
  DA:141,7
772
772
  DA:143,7
@@ -787,7 +787,7 @@ DA:184,13
787
787
  DA:185,8
788
788
  DA:186,8
789
789
  DA:189,8
790
- DA:190,5
790
+ DA:190,4
791
791
  DA:196,13
792
792
  DA:197,10
793
793
  DA:198,10
@@ -813,32 +813,32 @@ DA:243,5
813
813
  DA:244,5
814
814
  DA:250,5
815
815
  DA:251,5
816
- DA:266,58
817
- DA:267,58
818
- DA:290,17
816
+ DA:266,57
817
+ DA:267,57
818
+ DA:290,16
819
819
  LF:76
820
820
  LH:73
821
- BRDA:15,0,0,39
821
+ BRDA:15,0,0,38
822
822
  BRDA:15,0,1,19
823
- BRDA:17,1,0,5
823
+ BRDA:17,1,0,4
824
824
  BRDA:17,1,1,53
825
- BRDA:25,2,0,5
825
+ BRDA:25,2,0,4
826
826
  BRDA:25,2,1,53
827
827
  BRDA:90,3,0,5
828
828
  BRDA:90,3,1,0
829
829
  BRDA:98,4,0,6
830
830
  BRDA:98,4,1,5
831
- BRDA:101,5,0,17
831
+ BRDA:101,5,0,16
832
832
  BRDA:104,6,0,4
833
- BRDA:104,6,1,13
834
- BRDA:114,7,0,13
833
+ BRDA:104,6,1,12
834
+ BRDA:114,7,0,12
835
835
  BRDA:114,7,1,0
836
836
  BRDA:123,8,0,0
837
- BRDA:123,8,1,13
838
- BRDA:125,9,0,13
839
- BRDA:125,9,1,13
840
- BRDA:128,10,0,13
841
- BRDA:128,10,1,11
837
+ BRDA:123,8,1,12
838
+ BRDA:125,9,0,12
839
+ BRDA:125,9,1,12
840
+ BRDA:128,10,0,12
841
+ BRDA:128,10,1,10
842
842
  BRDA:128,10,2,0
843
843
  BRDA:143,11,0,4
844
844
  BRDA:143,11,1,3
@@ -865,15 +865,15 @@ BRDA:221,21,0,6
865
865
  BRDA:221,21,1,1
866
866
  BRDA:250,22,0,5
867
867
  BRDA:250,22,1,0
868
- BRDA:289,23,0,58
869
- BRDA:289,23,1,17
870
- BRDA:289,23,2,16
871
- BRDA:290,24,0,58
872
- BRDA:290,24,1,53
873
- BRDA:291,25,0,58
868
+ BRDA:289,23,0,57
869
+ BRDA:289,23,1,16
870
+ BRDA:289,23,2,15
871
+ BRDA:290,24,0,57
872
+ BRDA:290,24,1,52
873
+ BRDA:291,25,0,57
874
874
  BRDA:291,25,1,0
875
875
  BRDA:291,25,2,0
876
- BRDA:293,26,0,58
876
+ BRDA:293,26,0,57
877
877
  BRDA:293,26,1,5
878
878
  BRF:57
879
879
  BRH:47
@@ -894,9 +894,9 @@ FN:101,(anonymous_10)
894
894
  FN:109,(anonymous_11)
895
895
  FNF:12
896
896
  FNH:7
897
- FNDA:18,(anonymous_0)
898
- FNDA:18,(anonymous_1)
899
- FNDA:18,(anonymous_2)
897
+ FNDA:17,(anonymous_0)
898
+ FNDA:17,(anonymous_1)
899
+ FNDA:17,(anonymous_2)
900
900
  FNDA:10,(anonymous_3)
901
901
  FNDA:1,(anonymous_4)
902
902
  FNDA:0,(anonymous_5)
@@ -905,14 +905,14 @@ FNDA:0,(anonymous_7)
905
905
  FNDA:0,(anonymous_8)
906
906
  FNDA:0,(anonymous_9)
907
907
  FNDA:0,(anonymous_10)
908
- FNDA:18,(anonymous_11)
908
+ FNDA:17,(anonymous_11)
909
909
  DA:10,2
910
- DA:12,18
910
+ DA:12,17
911
911
  DA:14,2
912
912
  DA:19,2
913
- DA:21,18
913
+ DA:21,17
914
914
  DA:24,2
915
- DA:26,18
915
+ DA:26,17
916
916
  DA:30,2
917
917
  DA:34,2
918
918
  DA:41,2
@@ -936,16 +936,16 @@ DA:94,0
936
936
  DA:95,0
937
937
  DA:97,0
938
938
  DA:102,0
939
- DA:110,18
940
- DA:111,18
941
- DA:112,18
939
+ DA:110,17
940
+ DA:111,17
941
+ DA:112,17
942
942
  LF:33
943
943
  LH:24
944
- BRDA:12,0,0,18
944
+ BRDA:12,0,0,17
945
945
  BRDA:12,0,1,5
946
- BRDA:21,1,0,18
946
+ BRDA:21,1,0,17
947
947
  BRDA:21,1,1,0
948
- BRDA:26,2,0,18
948
+ BRDA:26,2,0,17
949
949
  BRDA:26,2,1,5
950
950
  BRDA:66,3,0,2
951
951
  BRDA:66,3,1,8
@@ -966,9 +966,9 @@ BRDA:87,10,1,0
966
966
  BRDA:87,11,0,0
967
967
  BRDA:87,11,1,0
968
968
  BRDA:93,12,0,0
969
- BRDA:126,13,0,18
969
+ BRDA:126,13,0,17
970
970
  BRDA:126,13,1,2
971
- BRDA:140,14,0,18
971
+ BRDA:140,14,0,17
972
972
  BRDA:140,14,1,0
973
973
  BRF:29
974
974
  BRH:15
@@ -982,7 +982,7 @@ FNF:3
982
982
  FNH:1
983
983
  FNDA:0,(anonymous_0)
984
984
  FNDA:0,(anonymous_1)
985
- FNDA:58,(anonymous_2)
985
+ FNDA:57,(anonymous_2)
986
986
  DA:7,2
987
987
  DA:16,2
988
988
  DA:24,2
@@ -992,8 +992,8 @@ DA:46,2
992
992
  DA:53,2
993
993
  DA:71,2
994
994
  DA:79,2
995
- DA:94,58
996
- DA:95,58
995
+ DA:94,57
996
+ DA:95,57
997
997
  LF:11
998
998
  LH:11
999
999
  BRF:0
@@ -1014,49 +1014,49 @@ FN:76,(anonymous_9)
1014
1014
  FN:93,(anonymous_10)
1015
1015
  FNF:11
1016
1016
  FNH:9
1017
- FNDA:257,(anonymous_0)
1018
- FNDA:257,(anonymous_1)
1019
- FNDA:257,(anonymous_2)
1020
- FNDA:257,(anonymous_3)
1021
- FNDA:257,(anonymous_4)
1022
- FNDA:257,(anonymous_5)
1023
- FNDA:257,(anonymous_6)
1024
- FNDA:257,(anonymous_7)
1017
+ FNDA:256,(anonymous_0)
1018
+ FNDA:256,(anonymous_1)
1019
+ FNDA:256,(anonymous_2)
1020
+ FNDA:256,(anonymous_3)
1021
+ FNDA:256,(anonymous_4)
1022
+ FNDA:256,(anonymous_5)
1023
+ FNDA:256,(anonymous_6)
1024
+ FNDA:256,(anonymous_7)
1025
1025
  FNDA:0,(anonymous_8)
1026
1026
  FNDA:0,(anonymous_9)
1027
- FNDA:257,(anonymous_10)
1027
+ FNDA:256,(anonymous_10)
1028
1028
  DA:5,2
1029
- DA:9,257
1030
- DA:23,257
1031
- DA:26,257
1032
- DA:27,257
1033
- DA:29,257
1029
+ DA:9,256
1030
+ DA:23,256
1031
+ DA:26,256
1032
+ DA:27,256
1033
+ DA:29,256
1034
1034
  DA:33,2
1035
- DA:36,257
1036
- DA:40,257
1035
+ DA:36,256
1036
+ DA:40,256
1037
1037
  DA:42,2
1038
1038
  DA:46,2
1039
1039
  DA:50,2
1040
- DA:54,257
1040
+ DA:54,256
1041
1041
  DA:57,2
1042
1042
  DA:67,2
1043
1043
  DA:80,2
1044
- DA:105,257
1045
- DA:106,257
1044
+ DA:105,256
1045
+ DA:106,256
1046
1046
  LF:18
1047
1047
  LH:18
1048
1048
  BRDA:9,0,0,24
1049
- BRDA:9,0,1,233
1049
+ BRDA:9,0,1,232
1050
1050
  BRDA:26,1,0,120
1051
- BRDA:26,1,1,137
1051
+ BRDA:26,1,1,136
1052
1052
  BRDA:27,2,0,120
1053
- BRDA:27,2,1,137
1054
- BRDA:29,3,0,197
1053
+ BRDA:27,2,1,136
1054
+ BRDA:29,3,0,196
1055
1055
  BRDA:29,3,1,60
1056
1056
  BRDA:40,4,0,22
1057
- BRDA:40,4,1,235
1058
- BRDA:54,5,0,257
1059
- BRDA:54,5,1,222
1057
+ BRDA:40,4,1,234
1058
+ BRDA:54,5,0,256
1059
+ BRDA:54,5,1,221
1060
1060
  BRF:12
1061
1061
  BRH:12
1062
1062
  end_of_record
package/index.js CHANGED
@@ -5,10 +5,12 @@ const webpackDevMiddleware = require("webpack-dev-middleware")
5
5
  const webpackHotMiddleware = require("webpack-hot-middleware")
6
6
  const bodyParser = require("body-parser")
7
7
  const cookieParser = require("cookie-parser")
8
- const configWebpack = require("./webpack.config")
8
+ const { sep } = require("path")
9
+ const { pathToFileURL } = require("url")
10
+ const configWebpack = require("./webpack.config.cjs")
9
11
  const routes = require("./src/routes")
10
12
  const configMiddleware = require("./src/middlewares/config")
11
- const getConfigComponentsWebpack = require("./webpack-components.config")
13
+ const getConfigComponentsWebpack = require("./webpack-components.config.cjs")
12
14
 
13
15
  const {
14
16
  toolkitAssetsPath,
@@ -30,6 +32,15 @@ if (process.env.RUN_ENV === "dev") {
30
32
  }
31
33
 
32
34
  if (fs.existsSync(`${currentPath}/themes/${config.theme}/customComponents`)) {
35
+ // This is a workaround for SASS bug:
36
+ // https://github.com/dart-lang/sdk/issues/27979
37
+ // which manifests itself sometimes when webpack dev middleware is used
38
+ // (in dev mode), and app modules are imported in some unfortunate ways.
39
+ if (!global.location) {
40
+ global.location = {
41
+ href: `${pathToFileURL(process.cwd()).href}${sep}`
42
+ }
43
+ }
33
44
  const configComponentsWebpackAsset = getConfigComponentsWebpack(
34
45
  currentPath,
35
46
  config,
@@ -38,11 +49,8 @@ if (fs.existsSync(`${currentPath}/themes/${config.theme}/customComponents`)) {
38
49
  const compilerComponentsAsset = webpack(configComponentsWebpackAsset)
39
50
  app.use(
40
51
  webpackDevMiddleware(compilerComponentsAsset, {
41
- hot: true,
42
- filename: "sfb-components.js",
43
52
  publicPath: configComponentsWebpackAsset.output.publicPath,
44
53
  writeToDisk: true,
45
- logLevel: "error",
46
54
  stats: { colors: true }
47
55
  })
48
56
  )
@@ -85,9 +93,7 @@ server.on("error", err => {
85
93
  switch (err.errno) {
86
94
  case "EADDRINUSE":
87
95
  return console.log(
88
- `Error (${
89
- err.errno
90
- }):\n Port 3555 is already in use.\n The previous server instance might not have been terminated correctly.\n Make sure the previous sfb-toolkit instance is properly terminated and enter \`rs\` to restart the current instance.`
96
+ `Error (${err.errno}):\n Port 3555 is already in use.\n The previous server instance might not have been terminated correctly.\n Make sure the previous sfb-toolkit instance is properly terminated and enter \`rs\` to restart the current instance.`
91
97
  .red
92
98
  )
93
99
  default: