@appdirect/sfb-toolkit 4.0.18 → 4.0.20

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 (44) hide show
  1. package/bin/index.js +16 -12
  2. package/coverage/clover.xml +32 -32
  3. package/coverage/coverage-final.json +4 -4
  4. package/coverage/lcov-report/constants/customUserAttributesMock.js.html +1 -1
  5. package/coverage/lcov-report/constants/index.html +1 -1
  6. package/coverage/lcov-report/constants/pageUrls.js.html +1 -1
  7. package/coverage/lcov-report/constants/userMock.js.html +1 -1
  8. package/coverage/lcov-report/controllers/controllers-utils/assetsUtils.js.html +1 -1
  9. package/coverage/lcov-report/controllers/controllers-utils/index.html +1 -1
  10. package/coverage/lcov-report/controllers/data-filters/bootstrap-data-filter.js.html +1 -1
  11. package/coverage/lcov-report/controllers/data-filters/call-to-actions-filter.js.html +1 -1
  12. package/coverage/lcov-report/controllers/data-filters/index.html +1 -1
  13. package/coverage/lcov-report/controllers/index.html +1 -1
  14. package/coverage/lcov-report/controllers/index.js.html +1 -1
  15. package/coverage/lcov-report/front-end-utils/src/components/base/ResultItem.js.html +7 -7
  16. package/coverage/lcov-report/front-end-utils/src/components/base/SearchBar.js.html +3 -3
  17. package/coverage/lcov-report/front-end-utils/src/components/base/index.html +1 -1
  18. package/coverage/lcov-report/front-end-utils/src/components/base/item.js.html +11 -11
  19. package/coverage/lcov-report/front-end-utils/src/components/container.js.html +1 -1
  20. package/coverage/lcov-report/front-end-utils/src/components/data-view.js.html +1 -1
  21. package/coverage/lcov-report/front-end-utils/src/components/header-view.js.html +1 -1
  22. package/coverage/lcov-report/front-end-utils/src/components/index.html +1 -1
  23. package/coverage/lcov-report/front-end-utils/src/components/search.js.html +13 -13
  24. package/coverage/lcov-report/front-end-utils/src/constants/index.html +1 -1
  25. package/coverage/lcov-report/front-end-utils/src/constants/pageUrl.js.html +1 -1
  26. package/coverage/lcov-report/front-end-utils/src/constants/roleType.js.html +1 -1
  27. package/coverage/lcov-report/front-end-utils/src/constants/searchType.js.html +1 -1
  28. package/coverage/lcov-report/front-end-utils/src/utils/debounce.js.html +1 -1
  29. package/coverage/lcov-report/front-end-utils/src/utils/index.html +1 -1
  30. package/coverage/lcov-report/index.html +1 -1
  31. package/coverage/lcov-report/middlewares/config.js.html +1 -1
  32. package/coverage/lcov-report/middlewares/index.html +1 -1
  33. package/coverage/lcov-report/tools/index.html +1 -1
  34. package/coverage/lcov-report/tools/proxy-fetch.js.html +1 -1
  35. package/coverage/lcov.info +81 -81
  36. package/npm-shrinkwrap.json +2636 -689
  37. package/package.json +4 -4
  38. package/readme.md +6 -0
  39. package/src/tools/prompt-questions.js +0 -6
  40. package/src/tools/toolkit-common-fun.js +22 -19
  41. package/src/tools/toolkit-common-utils.js +63 -0
  42. package/src/tools/toolkit-common-vars.js +0 -6
  43. package/src/tools/toolkit-create-extension.js +71 -10
  44. package/src/tools/toolkit-start.js +1 -2
package/bin/index.js CHANGED
@@ -1,7 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const program = require("commander")
3
+ const { Command } = require("commander")
4
4
  const { spawn } = require("child_process")
5
+ const {
6
+ shouldNotBeInExtensionsFolder,
7
+ } = require("../src/tools/toolkit-common-utils")
5
8
 
6
9
  const PROJECT_SETUP_PATH = "src/tools/toolkit-setup.js"
7
10
  const PROJECT_SETUP_E2E_PATH = "src/tools/toolkit-setup-e2e.js"
@@ -13,15 +16,16 @@ const CHECKOUT_PATH = "src/tools/toolkit-checkout.js"
13
16
  const UPDATE_PATH = "src/tools/toolkit-update.js"
14
17
  const SERVER_START_PATH = "src/tools/toolkit-start.js"
15
18
  const PACKAGE_PATH = "src/tools/toolkit-package.js"
16
- const TESTS_PATH = "src/tools/toolkit-tests.js"
17
19
  const CREATE_EXTENSION_PATH = "src/tools/toolkit-create-extension.js"
18
20
  const VERSION_PATH = "src/tools/toolkit-version.js"
19
21
  const STORYBOOK = "src/tools/toolkit-storybook.js"
20
22
  const INSTALL = "src/tools/toolkit-install.js"
21
23
  const COMPONENTS = "src/tools/toolkit-components.js"
22
- const COMPONETNS_INFO = "src/tools/toolkit-components-info.js"
24
+ const COMPONENTS_INFO = "src/tools/toolkit-components-info.js"
23
25
  const DEV_E2E = "src/tools/toolkit-dev-e2e.js"
24
26
 
27
+ const program = new Command()
28
+
25
29
  program
26
30
  .command("setup [name]")
27
31
  .description("Creates a new project")
@@ -152,25 +156,21 @@ program
152
156
  majorVersion = parseInt(process.version.split(".")[0].slice(1), 10)
153
157
  } catch (err) {
154
158
  console.warn(
155
- "Failed to parse Node.js version. Defaulting to applying --openssl-legacy-provider flag."
159
+ "Failed to parse Node.js version. Not applying --openssl-legacy-provider flag."
156
160
  )
157
- majorVersion = 18 // default to 18 to ensure flag is added if parsing fails
158
161
  }
159
162
 
160
163
  const isNode18AndUp = majorVersion >= 18
161
164
 
162
165
  const nodeArgs = []
163
- const envOptions = { ...process.env }
164
166
 
165
167
  if (isNode18AndUp) {
166
168
  nodeArgs.push("--openssl-legacy-provider")
167
- envOptions.NODE_OPTIONS = "--openssl-legacy-provider"
168
169
  }
169
170
 
170
171
  nodeArgs.push(`${__dirname}/../${STORYBOOK}`)
171
172
 
172
173
  spawn("node", nodeArgs, {
173
- env: envOptions,
174
174
  stdio: "inherit",
175
175
  shell: true,
176
176
  })
@@ -200,7 +200,7 @@ program
200
200
  .command("components-info")
201
201
  .description("Custom components information")
202
202
  .action(() => {
203
- spawn(`node "${__dirname}/../${COMPONETNS_INFO}"`, {
203
+ spawn(`node "${__dirname}/../${COMPONENTS_INFO}"`, {
204
204
  stdio: "inherit",
205
205
  shell: true,
206
206
  })
@@ -228,15 +228,19 @@ program
228
228
  })
229
229
 
230
230
  program
231
- .command("create-extension", { hidden: true })
231
+ .command("create-extension <ExtensionName> <MarketplacePath> <AppPath>", {
232
+ hidden: true,
233
+ })
232
234
  .description("Creates a new application")
233
- .action((name) => {
234
- spawn(`node "${__dirname}/../${CREATE_EXTENSION_PATH}" ${name}`, {
235
+ .action((ExtensionName, MarketplacePath, AppPath) => {
236
+ const args = [ExtensionName, MarketplacePath, AppPath].join(" ")
237
+ spawn(`node "${__dirname}/../${CREATE_EXTENSION_PATH}" ${args}`, {
235
238
  stdio: "inherit",
236
239
  shell: true,
237
240
  })
238
241
  })
239
242
 
243
+ shouldNotBeInExtensionsFolder()
240
244
  program.parse(process.argv)
241
245
 
242
246
  // check if there were no args specified
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <coverage generated="1698172967691" clover="3.2.0">
3
- <project timestamp="1698172967691" name="All files">
2
+ <coverage generated="1706041549746" clover="3.2.0">
3
+ <project timestamp="1706041549746" 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"/>
@@ -367,9 +367,9 @@
367
367
  <file name="search.js" path="/var/jenkins/workspace/sf-devtools-pipeline-release-to-npm/src/front-end-utils/src/components/search.js">
368
368
  <metrics statements="76" coveredstatements="73" conditionals="57" coveredconditionals="47" methods="31" coveredmethods="29"/>
369
369
  <line num="13" count="2" type="stmt"/>
370
- <line num="15" count="59" type="cond" truecount="2" falsecount="0"/>
371
- <line num="17" count="59" type="cond" truecount="2" falsecount="0"/>
372
- <line num="25" count="59" type="cond" truecount="2" falsecount="0"/>
370
+ <line num="15" count="57" type="cond" truecount="2" falsecount="0"/>
371
+ <line num="17" count="57" type="cond" truecount="2" falsecount="0"/>
372
+ <line num="25" count="57" type="cond" truecount="2" falsecount="0"/>
373
373
  <line num="29" count="2" type="stmt"/>
374
374
  <line num="40" count="2" type="stmt"/>
375
375
  <line num="48" count="2" type="stmt"/>
@@ -386,13 +386,13 @@
386
386
  <line num="90" count="5" type="cond" truecount="1" falsecount="1"/>
387
387
  <line num="91" count="5" type="stmt"/>
388
388
  <line num="98" count="11" type="cond" truecount="2" falsecount="0"/>
389
- <line num="103" count="18" type="stmt"/>
390
- <line num="104" count="18" type="cond" truecount="2" falsecount="0"/>
389
+ <line num="103" count="16" type="stmt"/>
390
+ <line num="104" count="16" type="cond" truecount="2" falsecount="0"/>
391
391
  <line num="105" count="4" type="stmt"/>
392
- <line num="114" count="14" type="cond" truecount="1" falsecount="1"/>
393
- <line num="115" count="14" type="stmt"/>
392
+ <line num="114" count="12" type="cond" truecount="1" falsecount="1"/>
393
+ <line num="115" count="12" type="stmt"/>
394
394
  <line num="131" count="0" type="stmt"/>
395
- <line num="136" count="18" type="stmt"/>
395
+ <line num="136" count="16" type="stmt"/>
396
396
  <line num="140" count="7" type="stmt"/>
397
397
  <line num="141" count="7" type="stmt"/>
398
398
  <line num="143" count="7" type="cond" truecount="2" falsecount="0"/>
@@ -413,7 +413,7 @@
413
413
  <line num="185" count="8" type="stmt"/>
414
414
  <line num="186" count="8" type="stmt"/>
415
415
  <line num="189" count="8" type="stmt"/>
416
- <line num="190" count="6" type="stmt"/>
416
+ <line num="190" count="4" type="stmt"/>
417
417
  <line num="196" count="13" type="stmt"/>
418
418
  <line num="197" count="10" type="stmt"/>
419
419
  <line num="198" count="10" type="cond" truecount="4" falsecount="0"/>
@@ -439,9 +439,9 @@
439
439
  <line num="244" count="5" type="stmt"/>
440
440
  <line num="250" count="5" type="cond" truecount="1" falsecount="1"/>
441
441
  <line num="251" count="5" type="stmt"/>
442
- <line num="266" count="59" type="stmt"/>
443
- <line num="267" count="59" type="stmt"/>
444
- <line num="290" count="18" type="cond" truecount="2" falsecount="0"/>
442
+ <line num="266" count="57" type="stmt"/>
443
+ <line num="267" count="57" type="stmt"/>
444
+ <line num="290" count="16" type="cond" truecount="2" falsecount="0"/>
445
445
  </file>
446
446
  </package>
447
447
  <package name="front-end-utils.src.components.base">
@@ -449,12 +449,12 @@
449
449
  <file name="ResultItem.js" path="/var/jenkins/workspace/sf-devtools-pipeline-release-to-npm/src/front-end-utils/src/components/base/ResultItem.js">
450
450
  <metrics statements="33" coveredstatements="24" conditionals="29" coveredconditionals="15" methods="12" coveredmethods="7"/>
451
451
  <line num="10" count="2" type="stmt"/>
452
- <line num="12" count="19" type="cond" truecount="2" falsecount="0"/>
452
+ <line num="12" count="17" type="cond" truecount="2" falsecount="0"/>
453
453
  <line num="14" count="2" type="stmt"/>
454
454
  <line num="19" count="2" type="stmt"/>
455
- <line num="21" count="19" type="cond" truecount="1" falsecount="1"/>
455
+ <line num="21" count="17" type="cond" truecount="1" falsecount="1"/>
456
456
  <line num="24" count="2" type="stmt"/>
457
- <line num="26" count="19" type="cond" truecount="2" falsecount="0"/>
457
+ <line num="26" count="17" type="cond" truecount="2" falsecount="0"/>
458
458
  <line num="30" count="2" type="stmt"/>
459
459
  <line num="34" count="2" type="stmt"/>
460
460
  <line num="41" count="2" type="stmt"/>
@@ -478,9 +478,9 @@
478
478
  <line num="95" count="0" type="stmt"/>
479
479
  <line num="97" count="0" type="stmt"/>
480
480
  <line num="102" count="0" type="stmt"/>
481
- <line num="110" count="19" type="stmt"/>
482
- <line num="111" count="19" type="stmt"/>
483
- <line num="112" count="19" type="stmt"/>
481
+ <line num="110" count="17" type="stmt"/>
482
+ <line num="111" count="17" type="stmt"/>
483
+ <line num="112" count="17" type="stmt"/>
484
484
  </file>
485
485
  <file name="SearchBar.js" path="/var/jenkins/workspace/sf-devtools-pipeline-release-to-npm/src/front-end-utils/src/components/base/SearchBar.js">
486
486
  <metrics statements="11" coveredstatements="11" conditionals="0" coveredconditionals="0" methods="3" coveredmethods="1"/>
@@ -493,29 +493,29 @@
493
493
  <line num="53" count="2" type="stmt"/>
494
494
  <line num="71" count="2" type="stmt"/>
495
495
  <line num="79" count="2" type="stmt"/>
496
- <line num="94" count="59" type="stmt"/>
497
- <line num="95" count="59" type="stmt"/>
496
+ <line num="94" count="57" type="stmt"/>
497
+ <line num="95" count="57" type="stmt"/>
498
498
  </file>
499
499
  <file name="item.js" path="/var/jenkins/workspace/sf-devtools-pipeline-release-to-npm/src/front-end-utils/src/components/base/item.js">
500
500
  <metrics statements="18" coveredstatements="18" conditionals="12" coveredconditionals="12" methods="11" coveredmethods="9"/>
501
501
  <line num="5" count="2" type="stmt"/>
502
- <line num="9" count="258" type="cond" truecount="2" falsecount="0"/>
503
- <line num="23" count="258" type="stmt"/>
504
- <line num="26" count="258" type="cond" truecount="2" falsecount="0"/>
505
- <line num="27" count="258" type="cond" truecount="2" falsecount="0"/>
506
- <line num="29" count="258" type="cond" truecount="2" falsecount="0"/>
502
+ <line num="9" count="256" type="cond" truecount="2" falsecount="0"/>
503
+ <line num="23" count="256" type="stmt"/>
504
+ <line num="26" count="256" type="cond" truecount="2" falsecount="0"/>
505
+ <line num="27" count="256" type="cond" truecount="2" falsecount="0"/>
506
+ <line num="29" count="256" type="cond" truecount="2" falsecount="0"/>
507
507
  <line num="33" count="2" type="stmt"/>
508
- <line num="36" count="258" type="stmt"/>
509
- <line num="40" count="258" type="cond" truecount="2" falsecount="0"/>
508
+ <line num="36" count="256" type="stmt"/>
509
+ <line num="40" count="256" type="cond" truecount="2" falsecount="0"/>
510
510
  <line num="42" count="2" type="stmt"/>
511
511
  <line num="46" count="2" type="stmt"/>
512
512
  <line num="50" count="2" type="stmt"/>
513
- <line num="54" count="258" type="cond" truecount="2" falsecount="0"/>
513
+ <line num="54" count="256" type="cond" truecount="2" falsecount="0"/>
514
514
  <line num="57" count="2" type="stmt"/>
515
515
  <line num="67" count="2" type="stmt"/>
516
516
  <line num="80" count="2" type="stmt"/>
517
- <line num="105" count="258" type="stmt"/>
518
- <line num="106" count="258" type="stmt"/>
517
+ <line num="105" count="256" type="stmt"/>
518
+ <line num="106" count="256" type="stmt"/>
519
519
  </file>
520
520
  </package>
521
521
  <package name="front-end-utils.src.constants">