@appdirect/sfb-toolkit 4.0.12 → 4.0.13

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 (41) hide show
  1. package/bin/index.js +11 -0
  2. package/coverage/clover.xml +2 -2
  3. package/coverage/lcov-report/constants/customUserAttributesMock.js.html +1 -1
  4. package/coverage/lcov-report/constants/index.html +1 -1
  5. package/coverage/lcov-report/constants/pageUrls.js.html +1 -1
  6. package/coverage/lcov-report/constants/userMock.js.html +1 -1
  7. package/coverage/lcov-report/controllers/controllers-utils/assetsUtils.js.html +1 -1
  8. package/coverage/lcov-report/controllers/controllers-utils/index.html +1 -1
  9. package/coverage/lcov-report/controllers/data-filters/bootstrap-data-filter.js.html +1 -1
  10. package/coverage/lcov-report/controllers/data-filters/call-to-actions-filter.js.html +1 -1
  11. package/coverage/lcov-report/controllers/data-filters/index.html +1 -1
  12. package/coverage/lcov-report/controllers/index.html +1 -1
  13. package/coverage/lcov-report/controllers/index.js.html +1 -1
  14. package/coverage/lcov-report/front-end-utils/src/components/base/ResultItem.js.html +1 -1
  15. package/coverage/lcov-report/front-end-utils/src/components/base/SearchBar.js.html +1 -1
  16. package/coverage/lcov-report/front-end-utils/src/components/base/index.html +1 -1
  17. package/coverage/lcov-report/front-end-utils/src/components/base/item.js.html +1 -1
  18. package/coverage/lcov-report/front-end-utils/src/components/container.js.html +1 -1
  19. package/coverage/lcov-report/front-end-utils/src/components/data-view.js.html +1 -1
  20. package/coverage/lcov-report/front-end-utils/src/components/header-view.js.html +1 -1
  21. package/coverage/lcov-report/front-end-utils/src/components/index.html +1 -1
  22. package/coverage/lcov-report/front-end-utils/src/components/search.js.html +1 -1
  23. package/coverage/lcov-report/front-end-utils/src/constants/index.html +1 -1
  24. package/coverage/lcov-report/front-end-utils/src/constants/pageUrl.js.html +1 -1
  25. package/coverage/lcov-report/front-end-utils/src/constants/roleType.js.html +1 -1
  26. package/coverage/lcov-report/front-end-utils/src/constants/searchType.js.html +1 -1
  27. package/coverage/lcov-report/front-end-utils/src/utils/debounce.js.html +1 -1
  28. package/coverage/lcov-report/front-end-utils/src/utils/index.html +1 -1
  29. package/coverage/lcov-report/index.html +1 -1
  30. package/coverage/lcov-report/middlewares/config.js.html +1 -1
  31. package/coverage/lcov-report/middlewares/index.html +1 -1
  32. package/coverage/lcov-report/tools/index.html +1 -1
  33. package/coverage/lcov-report/tools/proxy-fetch.js.html +1 -1
  34. package/npm-shrinkwrap.json +2 -2
  35. package/package.json +1 -1
  36. package/readme.md +15 -0
  37. package/src/tools/prompt-questions.js +15 -2
  38. package/src/tools/toolkit-common-fun.js +4 -233
  39. package/src/tools/toolkit-components-fun.js +259 -0
  40. package/src/tools/toolkit-components-info.js +24 -0
  41. package/src/tools/toolkit-components.js +4 -4
package/bin/index.js CHANGED
@@ -19,6 +19,7 @@ const VERSION_PATH = "src/tools/toolkit-version.js"
19
19
  const STORYBOOK = "src/tools/toolkit-storybook.js"
20
20
  const INSTALL = "src/tools/toolkit-install.js"
21
21
  const COMPONENTS = "src/tools/toolkit-components.js"
22
+ const COMPONETNS_INFO = "src/tools/toolkit-components-info.js"
22
23
  const DEV_E2E = "src/tools/toolkit-dev-e2e.js"
23
24
 
24
25
  program
@@ -195,6 +196,16 @@ program
195
196
  })
196
197
  })
197
198
 
199
+ program
200
+ .command("components-info")
201
+ .description("Custom components information")
202
+ .action(() => {
203
+ spawn(`node "${__dirname}/../${COMPONETNS_INFO}"`, {
204
+ stdio: "inherit",
205
+ shell: true,
206
+ })
207
+ })
208
+
198
209
  program
199
210
  .command("use-local-sfb-components")
200
211
  .description("Setup theme to use local sfb-components bundles for e2e")
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <coverage generated="1696513930836" clover="3.2.0">
3
- <project timestamp="1696513930836" name="All files">
2
+ <coverage generated="1696607647166" clover="3.2.0">
3
+ <project timestamp="1696607647166" name="All files">
4
4
  <metrics statements="498" coveredstatements="424" conditionals="246" coveredconditionals="175" methods="133" coveredmethods="109" elements="877" coveredelements="708" complexity="0" loc="498" ncloc="498" packages="10" files="20" classes="20"/>
5
5
  <package name="constants">
6
6
  <metrics statements="9" coveredstatements="9" conditionals="0" coveredconditionals="0" methods="1" coveredmethods="1"/>
@@ -481,7 +481,7 @@ module.exports = customUserAttributesMock
481
481
  <div class='footer quiet pad2 space-top1 center small'>
482
482
  Code coverage generated by
483
483
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
484
- at 2023-10-05T13:52:10.809Z
484
+ at 2023-10-06T15:54:07.139Z
485
485
  </div>
486
486
  <script src="../prettify.js"></script>
487
487
  <script>
@@ -131,7 +131,7 @@
131
131
  <div class='footer quiet pad2 space-top1 center small'>
132
132
  Code coverage generated by
133
133
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
134
- at 2023-10-05T13:52:10.809Z
134
+ at 2023-10-06T15:54:07.139Z
135
135
  </div>
136
136
  <script src="../prettify.js"></script>
137
137
  <script>
@@ -88,7 +88,7 @@ module.exports = { toolkitAssetsPath, themeAssetsPath }
88
88
  <div class='footer quiet pad2 space-top1 center small'>
89
89
  Code coverage generated by
90
90
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
91
- at 2023-10-05T13:52:10.809Z
91
+ at 2023-10-06T15:54:07.139Z
92
92
  </div>
93
93
  <script src="../prettify.js"></script>
94
94
  <script>
@@ -148,7 +148,7 @@ module.exports = userMock
148
148
  <div class='footer quiet pad2 space-top1 center small'>
149
149
  Code coverage generated by
150
150
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
151
- at 2023-10-05T13:52:10.809Z
151
+ at 2023-10-06T15:54:07.139Z
152
152
  </div>
153
153
  <script src="../prettify.js"></script>
154
154
  <script>
@@ -163,7 +163,7 @@ module.exports = buildHeaderAssets
163
163
  <div class='footer quiet pad2 space-top1 center small'>
164
164
  Code coverage generated by
165
165
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
166
- at 2023-10-05T13:52:10.809Z
166
+ at 2023-10-06T15:54:07.139Z
167
167
  </div>
168
168
  <script src="../../prettify.js"></script>
169
169
  <script>
@@ -101,7 +101,7 @@
101
101
  <div class='footer quiet pad2 space-top1 center small'>
102
102
  Code coverage generated by
103
103
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
104
- at 2023-10-05T13:52:10.809Z
104
+ at 2023-10-06T15:54:07.139Z
105
105
  </div>
106
106
  <script src="../../prettify.js"></script>
107
107
  <script>
@@ -136,7 +136,7 @@ module.exports = {
136
136
  <div class='footer quiet pad2 space-top1 center small'>
137
137
  Code coverage generated by
138
138
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
139
- at 2023-10-05T13:52:10.809Z
139
+ at 2023-10-06T15:54:07.139Z
140
140
  </div>
141
141
  <script src="../../prettify.js"></script>
142
142
  <script>
@@ -337,7 +337,7 @@ module.exports = {
337
337
  <div class='footer quiet pad2 space-top1 center small'>
338
338
  Code coverage generated by
339
339
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
340
- at 2023-10-05T13:52:10.809Z
340
+ at 2023-10-06T15:54:07.139Z
341
341
  </div>
342
342
  <script src="../../prettify.js"></script>
343
343
  <script>
@@ -116,7 +116,7 @@
116
116
  <div class='footer quiet pad2 space-top1 center small'>
117
117
  Code coverage generated by
118
118
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
119
- at 2023-10-05T13:52:10.809Z
119
+ at 2023-10-06T15:54:07.139Z
120
120
  </div>
121
121
  <script src="../../prettify.js"></script>
122
122
  <script>
@@ -101,7 +101,7 @@
101
101
  <div class='footer quiet pad2 space-top1 center small'>
102
102
  Code coverage generated by
103
103
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
104
- at 2023-10-05T13:52:10.809Z
104
+ at 2023-10-06T15:54:07.139Z
105
105
  </div>
106
106
  <script src="../prettify.js"></script>
107
107
  <script>
@@ -1426,7 +1426,7 @@ module.exports = Pages
1426
1426
  <div class='footer quiet pad2 space-top1 center small'>
1427
1427
  Code coverage generated by
1428
1428
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
1429
- at 2023-10-05T13:52:10.809Z
1429
+ at 2023-10-06T15:54:07.139Z
1430
1430
  </div>
1431
1431
  <script src="../prettify.js"></script>
1432
1432
  <script>
@@ -508,7 +508,7 @@ export default class ResultItem extends React.Component {
508
508
  <div class='footer quiet pad2 space-top1 center small'>
509
509
  Code coverage generated by
510
510
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
511
- at 2023-10-05T13:52:10.809Z
511
+ at 2023-10-06T15:54:07.139Z
512
512
  </div>
513
513
  <script src="../../../../prettify.js"></script>
514
514
  <script>
@@ -442,7 +442,7 @@ export default class Search extends React.Component {
442
442
  <div class='footer quiet pad2 space-top1 center small'>
443
443
  Code coverage generated by
444
444
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
445
- at 2023-10-05T13:52:10.809Z
445
+ at 2023-10-06T15:54:07.139Z
446
446
  </div>
447
447
  <script src="../../../../prettify.js"></script>
448
448
  <script>
@@ -131,7 +131,7 @@
131
131
  <div class='footer quiet pad2 space-top1 center small'>
132
132
  Code coverage generated by
133
133
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
134
- at 2023-10-05T13:52:10.809Z
134
+ at 2023-10-06T15:54:07.139Z
135
135
  </div>
136
136
  <script src="../../../../prettify.js"></script>
137
137
  <script>
@@ -448,7 +448,7 @@ export default class Item extends React.Component {
448
448
  <div class='footer quiet pad2 space-top1 center small'>
449
449
  Code coverage generated by
450
450
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
451
- at 2023-10-05T13:52:10.809Z
451
+ at 2023-10-06T15:54:07.139Z
452
452
  </div>
453
453
  <script src="../../../../prettify.js"></script>
454
454
  <script>
@@ -538,7 +538,7 @@ export default class Container extends React.Component {
538
538
  <div class='footer quiet pad2 space-top1 center small'>
539
539
  Code coverage generated by
540
540
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
541
- at 2023-10-05T13:52:10.809Z
541
+ at 2023-10-06T15:54:07.139Z
542
542
  </div>
543
543
  <script src="../../../prettify.js"></script>
544
544
  <script>
@@ -373,7 +373,7 @@ export default class DataView extends React.Component {
373
373
  <div class='footer quiet pad2 space-top1 center small'>
374
374
  Code coverage generated by
375
375
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
376
- at 2023-10-05T13:52:10.809Z
376
+ at 2023-10-06T15:54:07.139Z
377
377
  </div>
378
378
  <script src="../../../prettify.js"></script>
379
379
  <script>
@@ -793,7 +793,7 @@ export default class HeaderView extends React.Component {
793
793
  <div class='footer quiet pad2 space-top1 center small'>
794
794
  Code coverage generated by
795
795
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
796
- at 2023-10-05T13:52:10.809Z
796
+ at 2023-10-06T15:54:07.139Z
797
797
  </div>
798
798
  <script src="../../../prettify.js"></script>
799
799
  <script>
@@ -146,7 +146,7 @@
146
146
  <div class='footer quiet pad2 space-top1 center small'>
147
147
  Code coverage generated by
148
148
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
149
- at 2023-10-05T13:52:10.809Z
149
+ at 2023-10-06T15:54:07.139Z
150
150
  </div>
151
151
  <script src="../../../prettify.js"></script>
152
152
  <script>
@@ -967,7 +967,7 @@ export default class SearchTool extends React.Component {
967
967
  <div class='footer quiet pad2 space-top1 center small'>
968
968
  Code coverage generated by
969
969
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
970
- at 2023-10-05T13:52:10.809Z
970
+ at 2023-10-06T15:54:07.139Z
971
971
  </div>
972
972
  <script src="../../../prettify.js"></script>
973
973
  <script>
@@ -131,7 +131,7 @@
131
131
  <div class='footer quiet pad2 space-top1 center small'>
132
132
  Code coverage generated by
133
133
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
134
- at 2023-10-05T13:52:10.809Z
134
+ at 2023-10-06T15:54:07.139Z
135
135
  </div>
136
136
  <script src="../../../prettify.js"></script>
137
137
  <script>
@@ -76,7 +76,7 @@ export const MOCK_ADMIN_PAGE_URL = `${BASE_URL}/admin`;</pre></td></tr></table><
76
76
  <div class='footer quiet pad2 space-top1 center small'>
77
77
  Code coverage generated by
78
78
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
79
- at 2023-10-05T13:52:10.809Z
79
+ at 2023-10-06T15:54:07.139Z
80
80
  </div>
81
81
  <script src="../../../prettify.js"></script>
82
82
  <script>
@@ -82,7 +82,7 @@ export const NO_ROLE = "NO_ROLE";
82
82
  <div class='footer quiet pad2 space-top1 center small'>
83
83
  Code coverage generated by
84
84
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
85
- at 2023-10-05T13:52:10.809Z
85
+ at 2023-10-06T15:54:07.139Z
86
86
  </div>
87
87
  <script src="../../../prettify.js"></script>
88
88
  <script>
@@ -154,7 +154,7 @@ export const SEARCH_TYPES = [
154
154
  <div class='footer quiet pad2 space-top1 center small'>
155
155
  Code coverage generated by
156
156
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
157
- at 2023-10-05T13:52:10.809Z
157
+ at 2023-10-06T15:54:07.139Z
158
158
  </div>
159
159
  <script src="../../../prettify.js"></script>
160
160
  <script>
@@ -106,7 +106,7 @@
106
106
  <div class='footer quiet pad2 space-top1 center small'>
107
107
  Code coverage generated by
108
108
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
109
- at 2023-10-05T13:52:10.809Z
109
+ at 2023-10-06T15:54:07.139Z
110
110
  </div>
111
111
  <script src="../../../prettify.js"></script>
112
112
  <script>
@@ -101,7 +101,7 @@
101
101
  <div class='footer quiet pad2 space-top1 center small'>
102
102
  Code coverage generated by
103
103
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
104
- at 2023-10-05T13:52:10.809Z
104
+ at 2023-10-06T15:54:07.139Z
105
105
  </div>
106
106
  <script src="../../../prettify.js"></script>
107
107
  <script>
@@ -236,7 +236,7 @@
236
236
  <div class='footer quiet pad2 space-top1 center small'>
237
237
  Code coverage generated by
238
238
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
239
- at 2023-10-05T13:52:10.809Z
239
+ at 2023-10-06T15:54:07.139Z
240
240
  </div>
241
241
  <script src="prettify.js"></script>
242
242
  <script>
@@ -178,7 +178,7 @@ module.exports = (req, res, next) =&gt; {
178
178
  <div class='footer quiet pad2 space-top1 center small'>
179
179
  Code coverage generated by
180
180
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
181
- at 2023-10-05T13:52:10.809Z
181
+ at 2023-10-06T15:54:07.139Z
182
182
  </div>
183
183
  <script src="../prettify.js"></script>
184
184
  <script>
@@ -101,7 +101,7 @@
101
101
  <div class='footer quiet pad2 space-top1 center small'>
102
102
  Code coverage generated by
103
103
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
104
- at 2023-10-05T13:52:10.809Z
104
+ at 2023-10-06T15:54:07.139Z
105
105
  </div>
106
106
  <script src="../prettify.js"></script>
107
107
  <script>
@@ -101,7 +101,7 @@
101
101
  <div class='footer quiet pad2 space-top1 center small'>
102
102
  Code coverage generated by
103
103
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
104
- at 2023-10-05T13:52:10.809Z
104
+ at 2023-10-06T15:54:07.139Z
105
105
  </div>
106
106
  <script src="../prettify.js"></script>
107
107
  <script>
@@ -118,7 +118,7 @@ module.exports = fetchProxied;
118
118
  <div class='footer quiet pad2 space-top1 center small'>
119
119
  Code coverage generated by
120
120
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
121
- at 2023-10-05T13:52:10.809Z
121
+ at 2023-10-06T15:54:07.139Z
122
122
  </div>
123
123
  <script src="../prettify.js"></script>
124
124
  <script>
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@appdirect/sfb-toolkit",
3
- "version": "4.0.12",
3
+ "version": "4.0.13",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@appdirect/sfb-toolkit",
9
- "version": "4.0.12",
9
+ "version": "4.0.13",
10
10
  "license": "SEE LICENSE IN https://help.appdirect.com/sfb-eula.pdf",
11
11
  "dependencies": {
12
12
  "@appdirect/public-custom-app-ui": "^0.0.17",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appdirect/sfb-toolkit",
3
- "version": "4.0.12",
3
+ "version": "4.0.13",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {
package/readme.md CHANGED
@@ -10,6 +10,21 @@ It can be easily mixed with eg. HTML, CSS, JavaScript, jQuery, SASS.
10
10
 
11
11
  ### Release Notes:
12
12
 
13
+ **4.0.13**
14
+ - Added new command `sfb-toolkit components-info`
15
+ - shows which custom components could override our internal UI library (`sfb-theme-components`)
16
+ - Updated warning prompt for `sfb-toolkit install @appdirect/sfb-theme-components`
17
+ - includes the current version of `sfb-theme-components` used
18
+ - indicates which custom components should potentially be tested when updating the `sfb-theme-components` version
19
+
20
+ **4.0.12**
21
+ - Bug fix: fixed proxy issue
22
+
23
+ **4.0.11**
24
+ - Added warning prompt to `sfb-toolkit components` command
25
+ - Added warning prompt to `sfb-toolkit install @appdirect/sfb-theme-components` command
26
+ - Bug fix: fixed node_modules issue
27
+
13
28
  **4.0.10**
14
29
  - Add Node 18 support
15
30
  - Add prompts when enabling custom components and updating sfb-theme-component version
@@ -9,6 +9,8 @@ const {
9
9
  EXTENSION_PROMPT,
10
10
  } = require("./toolkit-common-vars");
11
11
 
12
+ const { getCustomComponentsInfo, getSfbThemeComponentsVersion } = require('./toolkit-components-fun');
13
+
12
14
  // small function to check if item has been defined
13
15
  const isDefined = (answer) => !!answer;
14
16
 
@@ -77,6 +79,16 @@ const isValidMarketplaceURL = async (toTest) => {
77
79
 
78
80
  const licenseText = ` In order to use this software, please type 'agree' to accept the license agreement that can be found at https://help.appdirect.com/sfb-eula.pdf`;
79
81
 
82
+ const customComponentsHints = () => {
83
+ const { overridesJavaScript, overridesSass } = getCustomComponentsInfo();
84
+ return (overridesJavaScript.length || overridesSass.length)
85
+ ? '\nSee below a list (none exhaustive) of custom components that should be ' +
86
+ `tested after changing the ${chalk.cyan("@appdirect/sfb-theme-components")} version:` +
87
+ (overridesJavaScript.length ? `\n\nOverrides Components JS:\n ` + chalk.green(overridesJavaScript.join(',\n ')) : '') +
88
+ (overridesSass.length ? `\n\nOverrides Components SCSS:\n ` + chalk.green(overridesSass.join(',\n ')) : '')
89
+ : '';
90
+ }
91
+
80
92
  // list of default questions that could be prompt to user
81
93
  const QUESTIONS = [
82
94
  {
@@ -110,14 +122,15 @@ const QUESTIONS = [
110
122
  )} library.` +
111
123
  ` Please note your current ${chalk.cyan(
112
124
  "@appdirect/sfb-theme-components"
113
- )} version before going forward in the event you need to revert.
125
+ )} version (${chalk.bgRed.yellowBright(getSfbThemeComponentsVersion())}) before going forward in the event you need to revert.
114
126
  \u2022 ${chalk.bgRed.yellowBright(
115
127
  "Ensure you thoroughly test your theme before deploying this new version."
116
128
  )}
117
129
  \u2022 Please see our documentation for more information.
118
130
  ${chalk.cyan(
119
131
  "https://developer.appdirect.com/storefront/how-tos/components/storefront-custom-components#update-custom-components-ui-library-sfb-theme-components."
120
- )}
132
+ )}
133
+ ${customComponentsHints()}
121
134
  \nDo you wish to proceed? (y/n)`
122
135
  ),
123
136
  },
@@ -8,6 +8,9 @@ const chalk = require("chalk")
8
8
  const { CURRENT_PATH, TOOLKIT_PATH, BOOTSTRAP_FOLDERS, BOOTSTRAP_FILES, CONFIG_PATH, THEME_COMPONENT_MODULE,
9
9
  THEME_COMPONENT_VERSION, ACTIVE_THEME_PATH, THEME_LOGS_PATH, THEME_LOGS_FILE_PATH, SASS_MODULE,
10
10
  SASS_VERSION, SASS_LOADER_MODULE, SASS_LOADER_VERSION } = require("./toolkit-common-vars");
11
+
12
+ const { getCustomComponentsInfo } = require("./toolkit-components-fun");
13
+
11
14
  const { has } = require("lodash");
12
15
 
13
16
  // function to remove project's folders (used to revert changes on error)
@@ -188,237 +191,6 @@ const updateCustomComponentsMetadata = (data) => {
188
191
  return data;
189
192
  }
190
193
 
191
- const removeCurrentFolderPathPrefix = (path) => {
192
- return path.replace(/^\.\//, '').trim();
193
- }
194
-
195
- const getExportList = (fileData, prefixPath = '') => {
196
- const exportList = [];
197
- const defaultExports = [];
198
- const pathPattern = /['|"|`](.+)['|"|`]/;
199
- const exportedComponentPattern = /default\s*as\s*(\w+).*['|"|`](.+)['|"|`]/;
200
- const filterOutComments = fileData.replace(/\/\/+.*\s*/g, '');
201
- const filterOutNewlines = filterOutComments.replace(/\r?\n$/g, '');
202
- const dataList = filterOutNewlines.split(/\r?\n/);
203
- dataList.forEach(item => {
204
- const directExportItem = exportedComponentPattern.exec(item);
205
- if(directExportItem) {
206
- defaultExports.push({
207
- alias: directExportItem[1].trim(),
208
- path: prefixPath + removeCurrentFolderPathPrefix(directExportItem[2])
209
- });
210
-
211
- } else {
212
- const exportItem = pathPattern.exec(item);
213
- if(exportItem) {
214
- exportList.push(prefixPath + removeCurrentFolderPathPrefix(exportItem[1]));
215
- }
216
- }
217
- })
218
-
219
- return {
220
- exportList,
221
- defaultExports
222
- }
223
- }
224
-
225
- const getPathToUse = (usePath) => {
226
- let fullPath;
227
- let isPathToFolder = false;
228
- const basePath = `${ACTIVE_THEME_PATH}/customComponents/${usePath}`;
229
- const jsFilePath = `${basePath}.js`;
230
- const jsxFilePath = `${basePath}.jsx`;
231
- const indexFilePath = `${basePath}/index.js`;
232
-
233
- if(!(/\.jsx?$/.test(basePath))) {
234
- if(fs.existsSync(jsxFilePath)) {
235
- fullPath = jsxFilePath;
236
- } else if (fs.existsSync(jsFilePath)) {
237
- fullPath = jsFilePath;
238
- } else if (fs.existsSync(indexFilePath)) {
239
- fullPath = indexFilePath;
240
- isPathToFolder = true;
241
- }
242
- } else {
243
- if(fs.existsSync(basePath)) {
244
- fullPath = basePath;
245
- }
246
- }
247
-
248
- return {
249
- fullPath,
250
- isPathToFolder
251
- }
252
- }
253
-
254
- const customComponentsExportsTraversal = (pathsToTraverse) => {
255
- let paths = [...pathsToTraverse];
256
- let allDefaultExports = [];
257
- const overridenScss = new Set();
258
- while(paths.length > 0) {
259
- let pathItem = paths.pop();
260
- let usePath = pathItem.path || pathItem;
261
- let prefixPath = usePath;
262
- const { fullPath, isPathToFolder } = getPathToUse(usePath);
263
-
264
- if (fullPath) {
265
- const fileData = fs.readFileSync(fullPath, 'utf8');
266
- const filterOutComments = fileData.replace(/\/\/+.*\s*/g, '');
267
-
268
- // check if file content is a component
269
- const component = filterOutComments.match(/export\s+default\s+(?:\w*\((\w+)\)|(\w+));?/);
270
-
271
- if(component) {
272
- foundComponent = component[1] || component[2];
273
- const allScssImports = filterOutComments.matchAll(/['|"|`](.*\/(\w+)\.s?css)['|"|`]/g);
274
- for(const match of allScssImports) {
275
- const sfbLibraryScssImport = match[1].includes(THEME_COMPONENT_MODULE);
276
- if(!sfbLibraryScssImport) {
277
- if(pathItem.alias) {
278
- overridenScss.add(pathItem.alias);
279
- } else {
280
- // catches the case: export * from 'somePath'
281
- overridenScss.add(match[2]);
282
- allDefaultExports.push(match[2]);
283
- }
284
- }
285
- }
286
- } else {
287
- if(!isPathToFolder || usePath.match(/jsx?/)) {
288
- prefixPath = usePath.match(/(.+)\/.*$/)[1];
289
- };
290
- const {
291
- exportList,
292
- defaultExports
293
- } = getExportList(fileData, prefixPath + "/");
294
- paths.push(...exportList);
295
- paths.push(...defaultExports);
296
-
297
- allDefaultExports.push(...defaultExports);
298
- }
299
- }
300
- }
301
-
302
- return {
303
- // converts to Set to filter duplicates then back to a list
304
- allDefaultExports: [...new Set(allDefaultExports)],
305
- overridenScss: [...overridenScss]
306
- }
307
- }
308
-
309
- const getSfbThemeComponentsList = () => {
310
- const sfbThemeComponentsPath = `${ACTIVE_THEME_PATH}/node_modules/${THEME_COMPONENT_MODULE}/src/components/index.js`;
311
- const sfbThemeComponents = fs.existsSync(sfbThemeComponentsPath);
312
- const defaultExportAliasList = []
313
- if (sfbThemeComponents) {
314
- const fileData = fs.readFileSync(sfbThemeComponentsPath, 'utf8');
315
- const { defaultExports } = getExportList(fileData);
316
- for(const exportItem of defaultExports) {
317
- defaultExportAliasList.push(exportItem.alias);
318
- }
319
- }
320
- return defaultExportAliasList;
321
- }
322
-
323
- const getCustomComponentsInfo = () => {
324
- try {
325
- const overridesJavaScript = new Set();
326
- const overridesSass = new Set();
327
- const userDefinedCustomComponents = new Set();
328
- const sfbConfigPath = CURRENT_PATH;
329
- const currentTheme = JSON.parse(fs.readFileSync(`${sfbConfigPath}/.sfbconfig`)).current;
330
- const customComponentsFilesPath = `${sfbConfigPath}/themes/${currentTheme}/customComponents/index.js`;
331
- const customComponents = fs.existsSync(customComponentsFilesPath);
332
-
333
- if(customComponents) {
334
- let componentsPathsLoadedBeforeUiLibrary = [];
335
- let componentsPathsLoadedAfterUiLibrary = [];
336
- let uiLibraryPassed = false;
337
- const indexFileData = fs.readFileSync(customComponentsFilesPath, 'utf8');
338
- const { exportList, defaultExports }= getExportList(indexFileData);
339
- const sfbDirectExportsList = getSfbThemeComponentsList();
340
- const {
341
- overridenScss: rootIndexOverridenScss
342
- } = customComponentsExportsTraversal(defaultExports);
343
-
344
- defaultExports.forEach(exportedItem => {
345
- if(sfbDirectExportsList.includes(exportedItem.alias)) {
346
- overridesJavaScript.add(exportedItem.alias);
347
- if(rootIndexOverridenScss.includes(exportedItem.alias)) {
348
- overridesSass.add(exportedItem.alias);
349
- }
350
- } else {
351
- userDefinedCustomComponents.add(exportedItem.alias);
352
- }
353
- });
354
-
355
- exportList.forEach(exportPath => {
356
- if(uiLibraryPassed) {
357
- componentsPathsLoadedAfterUiLibrary.push(exportPath);
358
- } else {
359
- if(exportPath.includes(THEME_COMPONENT_MODULE)) {
360
- uiLibraryPassed = true;
361
- } else {
362
- componentsPathsLoadedBeforeUiLibrary.push(exportPath);
363
- }
364
- }
365
- });
366
-
367
- const {
368
- allDefaultExports: directExportsBeforeUiLibrary,
369
- overridenScss: overridenScssBefore
370
- } = customComponentsExportsTraversal(componentsPathsLoadedBeforeUiLibrary);
371
-
372
- const {
373
- allDefaultExports: directExportsAfterUiLibrary,
374
- overridenScss: overridenScssAfter
375
- } = customComponentsExportsTraversal(componentsPathsLoadedAfterUiLibrary);
376
-
377
- directExportsBeforeUiLibrary.forEach(exportedItem => {
378
- if(sfbDirectExportsList.includes(exportedItem.alias)) {
379
- overridesJavaScript.add(exportedItem.alias);
380
- if(overridenScssBefore.includes(exportedItem.alias)) {
381
- overridesSass.add(exportedItem.alias);
382
- }
383
- } else if (sfbDirectExportsList.includes(exportedItem)) {
384
- if(overridenScssBefore.includes(exportedItem)) {
385
- overridesSass.add(exportedItem);
386
- }
387
- } else {
388
- userDefinedCustomComponents.add(exportedItem.alias);
389
- }
390
- });
391
-
392
- directExportsAfterUiLibrary.forEach(exportedItem => {
393
- if(sfbDirectExportsList.includes(exportedItem.alias)) {
394
- if(overridenScssAfter.includes(exportedItem.alias)) {
395
- overridesSass.add(exportedItem.alias);
396
- }
397
- } else if(sfbDirectExportsList.includes(exportedItem)) {
398
- if(overridenScssAfter.includes(exportedItem)) {
399
- overridesSass.add(exportedItem);
400
- }
401
- } else {
402
- userDefinedCustomComponents.add(exportedItem.alias);
403
- }
404
- })
405
- }
406
-
407
- return {
408
- overridesJavaScript: [...overridesJavaScript].sort(),
409
- overridesSass: [...overridesSass].sort(),
410
- userDefinedCustomComponents: [...userDefinedCustomComponents].sort()
411
- }
412
- } catch (error) {
413
- console.error(chalk.red(`\n ERROR: Unable to obtain Custom Components information due to: ${error}.\n`));
414
- return {
415
- overridesJavaScript: [],
416
- overridesSass: [],
417
- userDefinedCustomComponents: []
418
- }
419
- }
420
- }
421
-
422
194
  const addMetadata = (metadata = {}, themePath) => {
423
195
  const sfbConfigPath = themePath || CURRENT_PATH;
424
196
  const currentTheme = JSON.parse(fs.readFileSync(`${sfbConfigPath}/.sfbconfig`)).current;
@@ -516,6 +288,5 @@ module.exports = {
516
288
  createCustomThemePacakgeJson,
517
289
  updateCustomComponentsMetadata,
518
290
  addMetadata,
519
- installSass,
520
- getCustomComponentsInfo
291
+ installSass
521
292
  }
@@ -0,0 +1,259 @@
1
+ const fs = require("fs-extra");
2
+ const chalk = require("chalk");
3
+ const { CURRENT_PATH, THEME_COMPONENT_MODULE, ACTIVE_THEME_PATH} = require("./toolkit-common-vars");
4
+
5
+ const removeCurrentFolderPathPrefix = (path) => {
6
+ return path.replace(/^\.\//, '').trim();
7
+ }
8
+
9
+ const getExportList = (fileData, prefixPath = '') => {
10
+ const exportList = [];
11
+ const defaultExports = [];
12
+ const pathPattern = /['|"|`](.+)['|"|`]/;
13
+ const exportedComponentPattern = /default\s*as\s*(\w+).*['|"|`](.+)['|"|`]/;
14
+ const filterOutComments = fileData.replace(/\/\/+.*\s*/g, '');
15
+ const filterOutNewlines = filterOutComments.replace(/\r?\n$/g, '');
16
+ const dataList = filterOutNewlines.split(/\r?\n/);
17
+ dataList.forEach(item => {
18
+ const directExportItem = exportedComponentPattern.exec(item);
19
+ if(directExportItem) {
20
+ defaultExports.push({
21
+ alias: directExportItem[1].trim(),
22
+ path: prefixPath + removeCurrentFolderPathPrefix(directExportItem[2])
23
+ });
24
+
25
+ } else {
26
+ const exportItem = pathPattern.exec(item);
27
+ if(exportItem) {
28
+ exportList.push(prefixPath + removeCurrentFolderPathPrefix(exportItem[1]));
29
+ }
30
+ }
31
+ })
32
+
33
+ return {
34
+ exportList,
35
+ defaultExports
36
+ }
37
+ }
38
+
39
+ const getPathToUse = (usePath) => {
40
+ let fullPath;
41
+ let isPathToFolder = false;
42
+ const basePath = `${ACTIVE_THEME_PATH}/customComponents/${usePath}`;
43
+ const jsFilePath = `${basePath}.js`;
44
+ const jsxFilePath = `${basePath}.jsx`;
45
+ const indexFilePath = `${basePath}/index.js`;
46
+
47
+ if(!(/\.jsx?$/.test(basePath))) {
48
+ if(fs.existsSync(jsxFilePath)) {
49
+ fullPath = jsxFilePath;
50
+ } else if (fs.existsSync(jsFilePath)) {
51
+ fullPath = jsFilePath;
52
+ } else if (fs.existsSync(indexFilePath)) {
53
+ fullPath = indexFilePath;
54
+ isPathToFolder = true;
55
+ }
56
+ } else {
57
+ if(fs.existsSync(basePath)) {
58
+ fullPath = basePath;
59
+ }
60
+ }
61
+
62
+ return {
63
+ fullPath,
64
+ isPathToFolder
65
+ }
66
+ }
67
+
68
+ const customComponentsEnabled = () => {
69
+ const customComponentsPath = `${ACTIVE_THEME_PATH}/customComponents`
70
+ return fs.existsSync(customComponentsPath);
71
+ }
72
+
73
+ const customComponentsExportsTraversal = (pathsToTraverse) => {
74
+ let paths = [...pathsToTraverse];
75
+ let allDefaultExports = [];
76
+ const overridenScss = new Set();
77
+ while(paths.length > 0) {
78
+ let pathItem = paths.pop();
79
+ let usePath = pathItem.path || pathItem;
80
+ let prefixPath = usePath;
81
+ const { fullPath, isPathToFolder } = getPathToUse(usePath);
82
+
83
+ if (fullPath) {
84
+ const fileData = fs.readFileSync(fullPath, 'utf8');
85
+ const filterOutComments = fileData.replace(/\/\/+.*\s*/g, '');
86
+
87
+ // check if file content is a component
88
+ const component = filterOutComments.match(/export\s+default\s+(?:\w*\((\w+)\)|(\w+));?/);
89
+
90
+ if(component) {
91
+ foundComponent = component[1] || component[2];
92
+ const allScssImports = filterOutComments.matchAll(/['|"|`](.*\/(\w+)\.s?css)['|"|`]/g);
93
+ for(const match of allScssImports) {
94
+ const sfbLibraryScssImport = match[1].includes(THEME_COMPONENT_MODULE);
95
+ if(!sfbLibraryScssImport) {
96
+ if(pathItem.alias) {
97
+ overridenScss.add(pathItem.alias);
98
+ } else {
99
+ // catches the case: export * from 'somePath'
100
+ overridenScss.add(match[2]);
101
+ allDefaultExports.push(match[2]);
102
+ }
103
+ }
104
+ }
105
+ } else {
106
+ if(!isPathToFolder || usePath.match(/jsx?/)) {
107
+ prefixPath = usePath.match(/(.+)\/.*$/)[1];
108
+ };
109
+ const {
110
+ exportList,
111
+ defaultExports
112
+ } = getExportList(fileData, prefixPath + "/");
113
+ paths.push(...exportList);
114
+ paths.push(...defaultExports);
115
+
116
+ allDefaultExports.push(...defaultExports);
117
+ }
118
+ }
119
+ }
120
+
121
+ return {
122
+ // converts to Set to filter duplicates then back to a list
123
+ allDefaultExports: [...new Set(allDefaultExports)],
124
+ overridenScss: [...overridenScss]
125
+ }
126
+ }
127
+
128
+ const getSfbThemeComponentsList = () => {
129
+ const sfbThemeComponentsPath = `${ACTIVE_THEME_PATH}/node_modules/${THEME_COMPONENT_MODULE}/src/components/index.js`;
130
+ const sfbThemeComponents = fs.existsSync(sfbThemeComponentsPath);
131
+ const defaultExportAliasList = []
132
+ if (sfbThemeComponents) {
133
+ const fileData = fs.readFileSync(sfbThemeComponentsPath, 'utf8');
134
+ const { defaultExports } = getExportList(fileData);
135
+ for(const exportItem of defaultExports) {
136
+ defaultExportAliasList.push(exportItem.alias);
137
+ }
138
+ }
139
+ return defaultExportAliasList;
140
+ }
141
+
142
+ const getCustomComponentsInfo = () => {
143
+ try {
144
+ const overridesJavaScript = new Set();
145
+ const overridesSass = new Set();
146
+ const userDefinedCustomComponents = new Set();
147
+ const sfbConfigPath = CURRENT_PATH;
148
+ const currentTheme = JSON.parse(fs.readFileSync(`${sfbConfigPath}/.sfbconfig`)).current;
149
+ const customComponentsFilesPath = `${sfbConfigPath}/themes/${currentTheme}/customComponents/index.js`;
150
+ const customComponents = fs.existsSync(customComponentsFilesPath);
151
+
152
+ if(customComponents) {
153
+ let componentsPathsLoadedBeforeUiLibrary = [];
154
+ let componentsPathsLoadedAfterUiLibrary = [];
155
+ let uiLibraryPassed = false;
156
+ const indexFileData = fs.readFileSync(customComponentsFilesPath, 'utf8');
157
+ const { exportList, defaultExports }= getExportList(indexFileData);
158
+ const sfbDirectExportsList = getSfbThemeComponentsList();
159
+ const {
160
+ overridenScss: rootIndexOverridenScss
161
+ } = customComponentsExportsTraversal(defaultExports);
162
+
163
+ defaultExports.forEach(exportedItem => {
164
+ if(sfbDirectExportsList.includes(exportedItem.alias)) {
165
+ overridesJavaScript.add(exportedItem.alias);
166
+ if(rootIndexOverridenScss.includes(exportedItem.alias)) {
167
+ overridesSass.add(exportedItem.alias);
168
+ }
169
+ } else {
170
+ userDefinedCustomComponents.add(exportedItem.alias);
171
+ }
172
+ });
173
+
174
+ exportList.forEach(exportPath => {
175
+ if(uiLibraryPassed) {
176
+ componentsPathsLoadedAfterUiLibrary.push(exportPath);
177
+ } else {
178
+ if(exportPath.includes(THEME_COMPONENT_MODULE)) {
179
+ uiLibraryPassed = true;
180
+ } else {
181
+ componentsPathsLoadedBeforeUiLibrary.push(exportPath);
182
+ }
183
+ }
184
+ });
185
+
186
+ const {
187
+ allDefaultExports: directExportsBeforeUiLibrary,
188
+ overridenScss: overridenScssBefore
189
+ } = customComponentsExportsTraversal(componentsPathsLoadedBeforeUiLibrary);
190
+
191
+ const {
192
+ allDefaultExports: directExportsAfterUiLibrary,
193
+ overridenScss: overridenScssAfter
194
+ } = customComponentsExportsTraversal(componentsPathsLoadedAfterUiLibrary);
195
+
196
+ directExportsBeforeUiLibrary.forEach(exportedItem => {
197
+ if(sfbDirectExportsList.includes(exportedItem.alias)) {
198
+ overridesJavaScript.add(exportedItem.alias);
199
+ if(overridenScssBefore.includes(exportedItem.alias)) {
200
+ overridesSass.add(exportedItem.alias);
201
+ }
202
+ } else if (sfbDirectExportsList.includes(exportedItem)) {
203
+ if(overridenScssBefore.includes(exportedItem)) {
204
+ overridesSass.add(exportedItem);
205
+ }
206
+ } else {
207
+ userDefinedCustomComponents.add(exportedItem.alias);
208
+ }
209
+ });
210
+
211
+ directExportsAfterUiLibrary.forEach(exportedItem => {
212
+ if(sfbDirectExportsList.includes(exportedItem.alias)) {
213
+ if(overridenScssAfter.includes(exportedItem.alias)) {
214
+ overridesSass.add(exportedItem.alias);
215
+ }
216
+ } else if(sfbDirectExportsList.includes(exportedItem)) {
217
+ if(overridenScssAfter.includes(exportedItem)) {
218
+ overridesSass.add(exportedItem);
219
+ }
220
+ } else {
221
+ userDefinedCustomComponents.add(exportedItem.alias);
222
+ }
223
+ })
224
+ }
225
+
226
+ return {
227
+ overridesJavaScript: [...overridesJavaScript].sort(),
228
+ overridesSass: [...overridesSass].sort(),
229
+ userDefinedCustomComponents: [...userDefinedCustomComponents].sort()
230
+ }
231
+ } catch (error) {
232
+ console.error(chalk.red(`\n ERROR: Unable to obtain Custom Components information due to: ${error}.\n`));
233
+ return {
234
+ overridesJavaScript: [],
235
+ overridesSass: [],
236
+ userDefinedCustomComponents: []
237
+ }
238
+ }
239
+ }
240
+
241
+ const getSfbThemeComponentsVersion = () => {
242
+ let sfbThemeComponentsVersion = "N/A";
243
+ const hasPackageJson = fs.existsSync(`${ACTIVE_THEME_PATH}/package.json`);
244
+ if (hasPackageJson) {
245
+ const themePackageJson = JSON.parse(fs.readFileSync(`${ACTIVE_THEME_PATH}/package.json`));
246
+ const sfbVersion = themePackageJson.dependencies['@appdirect/sfb-theme-components'];
247
+ const foundSfbVersion = sfbVersion && sfbVersion.match(/\d+\.\d+\.\d+/)[0];
248
+ if(foundSfbVersion) {
249
+ sfbThemeComponentsVersion = foundSfbVersion;
250
+ }
251
+ };
252
+ return sfbThemeComponentsVersion;
253
+ };
254
+
255
+ module.exports = {
256
+ getCustomComponentsInfo,
257
+ customComponentsEnabled,
258
+ getSfbThemeComponentsVersion
259
+ }
@@ -0,0 +1,24 @@
1
+ const chalk = require("chalk");
2
+
3
+ const { shouldBeProjectFolder } = require("./toolkit-common-fun");
4
+
5
+ const { getCustomComponentsInfo, customComponentsEnabled } = require("./toolkit-components-fun");
6
+
7
+ // check if user is in correct location
8
+ shouldBeProjectFolder(true);
9
+
10
+ (() => {
11
+ try {
12
+ if(customComponentsEnabled) {
13
+ const { overridesJavaScript, overridesSass, userDefinedCustomComponents } = getCustomComponentsInfo();
14
+ console.log('Overrides Components JS:', overridesJavaScript);
15
+ console.log('Overrides Components:', overridesSass);
16
+ console.log('User Defined Components/Atoms:', userDefinedCustomComponents);
17
+ } else {
18
+ console.log('Custom components are not enabled for this theme.');
19
+ }
20
+
21
+ } catch ( err ) {
22
+ console.error(chalk.red(`\n ERROR: Unable to find configuration for current project due to: ${err}.\n`));
23
+ }
24
+ })();
@@ -4,7 +4,7 @@ const prompt = require("./prompt-questions");
4
4
  const { shouldBeProjectFolder, installSfbThemeComponents,
5
5
  createPackageJson, updateCustomComponentsMetadata, installSass } = require("./toolkit-common-fun");
6
6
  const { ACTIVE_THEME_PATH, TOOLKIT_PATH } = require("./toolkit-common-vars");
7
-
7
+ const { customComponentsEnabled } = require("./toolkit-components-fun");
8
8
  shouldBeProjectFolder(true);
9
9
 
10
10
  const addCustomCompToBase = (baseFilePath, data) => {
@@ -21,9 +21,9 @@ const settingsSchemaData = `{ "useComponents": true }`;
21
21
  (async () => {
22
22
  const baseFilePath = `${ACTIVE_THEME_PATH}/content/layout/base.html`;
23
23
  const customComponentsPath = `${ACTIVE_THEME_PATH}/customComponents`
24
- const customComponentsEnabled = fs.existsSync(customComponentsPath);
24
+ const areCustomComponentsEnabled = customComponentsEnabled();
25
25
 
26
- if(!customComponentsEnabled) {
26
+ if(!areCustomComponentsEnabled) {
27
27
  const customComponents = await prompt.ask(["InstallCustomComponents"]);
28
28
  if(customComponents.InstallCustomComponents.toLowerCase() !== "y") {
29
29
  return;
@@ -42,7 +42,7 @@ const settingsSchemaData = `{ "useComponents": true }`;
42
42
  })
43
43
  }
44
44
 
45
- if (!customComponentsEnabled) {
45
+ if (!areCustomComponentsEnabled) {
46
46
  try {
47
47
  fs.copySync(`${TOOLKIT_PATH}/customComponents`, customComponentsPath)
48
48
  } catch (error) {