@pega/custom-dx-components 0.25.45 → 0.25.46

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 (155) hide show
  1. package/package.json +33 -27
  2. package/src/tasks/build-jest-assets/index.js +4 -4
  3. package/src/tasks/bundle/builder/index.js +15 -15
  4. package/src/tasks/create/index.js +19 -33
  5. package/src/tasks/create/templates/Constellation/Field/Boolean/config.json.mustache +0 -1
  6. package/src/tasks/create/templates/Constellation/Field/Date/config.json.mustache +0 -1
  7. package/src/tasks/create/templates/Constellation/Field/DateTime/config.json.mustache +0 -1
  8. package/src/tasks/create/templates/Constellation/Field/Decimal/config.json.mustache +0 -1
  9. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/config.json.mustache +0 -1
  10. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/config.json.mustache +0 -1
  11. package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/config.json.mustache +0 -1
  12. package/src/tasks/create/templates/Constellation/Field/Integer/config.json.mustache +0 -1
  13. package/src/tasks/create/templates/Constellation/Field/Picklist/config.json.mustache +0 -1
  14. package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/config.json.mustache +0 -1
  15. package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/config.json.mustache +0 -1
  16. package/src/tasks/create/templates/Constellation/Field/Text/config.json.mustache +0 -1
  17. package/src/tasks/create/templates/Constellation/Field/Text-Email/config.json.mustache +0 -1
  18. package/src/tasks/create/templates/Constellation/Field/Text-Input/config.json.mustache +0 -1
  19. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/config.json.mustache +0 -1
  20. package/src/tasks/create/templates/Constellation/Field/Text-Phone/config.json.mustache +0 -1
  21. package/src/tasks/create/templates/Constellation/Field/Text-URL/config.json.mustache +0 -1
  22. package/src/tasks/create/templates/Constellation/Field/TimeofDay/config.json.mustache +0 -1
  23. package/src/tasks/create/templates/Constellation/Template/DETAILS/config.json.mustache +0 -1
  24. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/config.json.mustache +0 -1
  25. package/src/tasks/create/templates/Constellation/Template/FORM/config.json.mustache +0 -1
  26. package/src/tasks/create/templates/Constellation/Template/FORM-region/config.json.mustache +0 -1
  27. package/src/tasks/create/templates/Constellation/Template/PAGE/config.json.mustache +0 -1
  28. package/src/tasks/create/templates/Constellation/Template/PAGE/demo.stories.tsx.mustache +1 -0
  29. package/src/tasks/create/templates/Constellation/Widget/CASE/config.json.mustache +0 -1
  30. package/src/tasks/create/templates/Constellation/Widget/PAGE/config.json.mustache +0 -1
  31. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/config.json.mustache +0 -1
  32. package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/config.json.mustache +0 -1
  33. package/src/tasks/create/templates/Launchpad/Widget/CASE/config.json.mustache +0 -1
  34. package/src/tasks/create/templates/Launchpad/Widget/PAGE/config.json.mustache +0 -1
  35. package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/config.json.mustache +0 -1
  36. package/src/tasks/create-all/index.js +22 -35
  37. package/src/tasks/delete-pub/helper.js +5 -5
  38. package/src/tasks/delete-pub/index.js +21 -9
  39. package/src/tasks/init/index.js +62 -59
  40. package/src/tasks/init/template/package.json.mustache +2 -1
  41. package/src/tasks/list-pub/helper.js +6 -3
  42. package/src/tasks/list-pub/index.js +5 -4
  43. package/src/tasks/show-status/index.js +1 -1
  44. package/src/tasks/validator/index.js +0 -2
  45. package/src/util.js +487 -473
  46. package/tests/assets/library/components/create/Pega_DXIL_MyTestText/config.json +0 -1
  47. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyBoolean/config.json +0 -1
  48. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/config.json +0 -1
  49. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyCurrency/config.json +0 -1
  50. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDate/config.json +0 -1
  51. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDateTime/config.json +0 -1
  52. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDecimal/config.json +0 -1
  53. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDetails/config.json +0 -1
  54. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyEmail/config.json +0 -1
  55. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyForm/config.json +0 -1
  56. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/config.json +0 -1
  57. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyInteger/config.json +0 -1
  58. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPage/config.json +0 -1
  59. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPage/demo.stories.tsx +1 -0
  60. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/config.json +0 -1
  61. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPageWidget/config.json +0 -1
  62. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyParagraph/config.json +0 -1
  63. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPercentage/config.json +0 -1
  64. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPhone/config.json +0 -1
  65. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPicklist/config.json +0 -1
  66. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyRadiobuttons/config.json +0 -1
  67. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MySearchbox/config.json +0 -1
  68. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyText/config.json +0 -1
  69. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTextInput/config.json +0 -1
  70. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/config.json +0 -1
  71. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/config.json +0 -1
  72. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/config.json +0 -1
  73. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyURL/config.json +0 -1
  74. package/tests/assets/original/components/create/Pega_DXIL_MyTestText/config.json +0 -1
  75. package/tests/assets/original/components/create/shared/PConnProps.d.ts +46 -0
  76. package/tests/assets/original/components/create/shared/create-nonce.ts +5 -0
  77. package/tests/assets/original/components/create/shared/suggestions-handler.ts +9 -0
  78. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyBoolean/config.json +0 -1
  79. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/config.json +0 -1
  80. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyCurrency/config.json +0 -1
  81. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDate/config.json +0 -1
  82. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDateTime/config.json +0 -1
  83. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDecimal/config.json +0 -1
  84. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDetails/config.json +0 -1
  85. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyEmail/config.json +0 -1
  86. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyForm/config.json +0 -1
  87. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/config.json +0 -1
  88. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyInteger/config.json +0 -1
  89. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPage/config.json +0 -1
  90. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPage/demo.stories.tsx +1 -0
  91. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/config.json +0 -1
  92. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPageWidget/config.json +0 -1
  93. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyParagraph/config.json +0 -1
  94. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPercentage/config.json +0 -1
  95. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPhone/config.json +0 -1
  96. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPicklist/config.json +0 -1
  97. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyRadiobuttons/config.json +0 -1
  98. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MySearchbox/config.json +0 -1
  99. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyText/config.json +0 -1
  100. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTextInput/config.json +0 -1
  101. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/config.json +0 -1
  102. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/config.json +0 -1
  103. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/config.json +0 -1
  104. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyURL/config.json +0 -1
  105. package/tests/assets/original/components/createAll/Constellation/shared/PConnProps.d.ts +46 -0
  106. package/tests/assets/original/components/createAll/Constellation/shared/create-nonce.ts +5 -0
  107. package/tests/assets/original/components/createAll/Constellation/shared/suggestions-handler.ts +9 -0
  108. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyBoolean/config.json +0 -1
  109. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyCaseWidget/config.json +0 -1
  110. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyCurrency/config.json +0 -1
  111. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDate/config.json +0 -1
  112. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDateTime/config.json +0 -1
  113. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDecimal/config.json +0 -1
  114. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDetails/config.json +0 -1
  115. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyEmail/config.json +0 -1
  116. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyForm/config.json +0 -1
  117. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyIconButtonURL/config.json +0 -1
  118. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyInteger/config.json +0 -1
  119. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPage/config.json +0 -1
  120. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPage/demo.stories.tsx +1 -0
  121. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPageCaseWidget/config.json +0 -1
  122. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPageWidget/config.json +0 -1
  123. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyParagraph/config.json +0 -1
  124. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPercentage/config.json +0 -1
  125. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPhone/config.json +0 -1
  126. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPicklist/config.json +0 -1
  127. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyRadiobuttons/config.json +0 -1
  128. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MySearchbox/config.json +0 -1
  129. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyText/config.json +0 -1
  130. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTextInput/config.json +0 -1
  131. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/config.json +0 -1
  132. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/config.json +0 -1
  133. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/config.json +0 -1
  134. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyURL/config.json +0 -1
  135. package/tests/assets/original/components/createAll/Launchpad/shared/PConnProps.d.ts +46 -0
  136. package/tests/assets/original/components/createAll/Launchpad/shared/create-nonce.ts +5 -0
  137. package/tests/assets/original/components/createAll/Launchpad/shared/suggestions-handler.ts +9 -0
  138. package/tests/functional/localCreateAllListDeleteAll.test.js +1 -1
  139. package/tests/functional/localCreateBuildAllDeleteAll.test.js +3 -3
  140. package/tests/functional/localCreateBuildDelete.test.js +1 -1
  141. package/tests/functional/localCreateListDelete.test.js +1 -1
  142. package/tests/functional/localCreatePublishAllDeleteAll.test.js +3 -3
  143. package/tests/functional/localCreatePublishDelete.test.js +1 -1
  144. package/tests/functional/localCreateRenameDelete.test.js +1 -1
  145. package/tests/functional/localLibCreateLibBuildLibDeleteLib.test.js +3 -3
  146. package/tests/functional/localLibCreateLibBuildLibListPubDeleteLib.test.js +3 -3
  147. package/tests/functional/localLibCreateLibExportImportLib.test.js +1 -1
  148. package/tests/functional/localLibCreateLibExportLib.test.js +1 -1
  149. package/tests/functional/localLibCreateLibListDeleteLib.test.js +1 -1
  150. package/tests/functional/localLibCreateLibListMoveDeleteLib.test.js +1 -1
  151. package/tests/functional/localLibCreateLibListSwitchDeleteLib.test.js +1 -1
  152. package/tests/functional/localLibCreateLibStatusDeleteLib.test.js +1 -1
  153. package/tests/functional/localLibCreateLibStoreRestoreDeleteLib.test.js +1 -1
  154. package/tests/functional/localLibCreateLibValidateDeleteLib.test.js +3 -3
  155. package/tests/functional/localLibCreateLibVersionDeleteLib.test.js +1 -1
package/src/util.js CHANGED
@@ -5,9 +5,9 @@ import { promisify } from 'util';
5
5
  import https from 'https';
6
6
  import crypto from 'node:crypto';
7
7
  import { createRequire } from 'module';
8
- import { jwtDecode } from 'jwt-decode';
8
+ import {jwtDecode} from 'jwt-decode';
9
9
  import archiver from 'archiver';
10
- import { unarchive } from 'unarchive';
10
+ import {unarchive} from 'unarchive';
11
11
  import ora from 'ora';
12
12
 
13
13
  import chalk from 'chalk';
@@ -83,32 +83,32 @@ let sPegaServerConfig;
83
83
  export const modAddAboutData = (addInAboutData) => {
84
84
  // used by jest to not put in to match assets without aboutData
85
85
  addAboutData = addInAboutData;
86
- };
86
+ }
87
87
 
88
88
  export const addDebugLog = (sFunctionName, sLogData, sIncDec) => {
89
89
 
90
90
  let sLog;
91
91
  if (showDebug) {
92
- if (sIncDec === "-") {
93
- debugLevel--;
94
- }
92
+ if (sIncDec === "-") {
93
+ debugLevel--;
94
+ }
95
95
 
96
- sLog = `>> log ${debugLevel} `;
96
+ sLog = `>> log ${debugLevel} `;
97
97
 
98
- for (let i = 0; i < debugLevel; i++) {
99
- sLog = sLog.concat("-");
100
- }
98
+ for (let i =0; i < debugLevel; i++) {
99
+ sLog = sLog.concat("-");
100
+ }
101
101
 
102
- sLog = sLog.concat(sFunctionName).concat(": ").concat(sLogData);
102
+ sLog = sLog.concat(sFunctionName).concat(": ").concat(sLogData);
103
103
 
104
- console.log(`${chalk.hex('#A0522D')(sLog)}`);
104
+ console.log(`${chalk.hex('#A0522D')(sLog)}`);
105
105
 
106
- if (sIncDec === "+") {
107
- debugLevel++;
108
- }
106
+ if (sIncDec === "+") {
107
+ debugLevel++;
108
+ }
109
109
 
110
110
  }
111
- };
111
+ }
112
112
 
113
113
  export const setUpDefaults = async () => {
114
114
 
@@ -183,11 +183,11 @@ export const setUpDefaults = async () => {
183
183
 
184
184
  retrievedConfigData.serverType = data["server-config"].serverType;
185
185
  retrievedConfigData.devBuild = data["server-config"].devBuild;
186
- retrievedConfigData.devServerPort = data["server-config"].devServerPort;
186
+ retrievedConfigData.devServerPort = data["server-config"].devServerPort;
187
187
 
188
188
  retrievedConfigData.buildVersion = retrievedConfigData.devBuild ? `${retrievedConfigData.version}-dev` : retrievedConfigData.version;
189
189
  retrievedConfigData.currentOrgLib = `${retrievedConfigData.organization}_${retrievedConfigData.library}`;
190
- retrievedConfigData.displayLibVersion = `${retrievedConfigData.currentOrgLib}/${retrievedConfigData.buildVersion}`;
190
+ retrievedConfigData.displayLibVersion = `${retrievedConfigData.currentOrgLib }/${retrievedConfigData.buildVersion}`;
191
191
 
192
192
  }
193
193
  catch (ex) {
@@ -197,7 +197,7 @@ export const setUpDefaults = async () => {
197
197
  }
198
198
 
199
199
  return JSON.parse(JSON.stringify(retrievedConfigData));
200
- };
200
+ }
201
201
 
202
202
  export const convertYNToBoolean = (inputYN) => {
203
203
  switch (inputYN) {
@@ -213,7 +213,7 @@ export const convertYNToBoolean = (inputYN) => {
213
213
  }
214
214
 
215
215
  return false;
216
- };
216
+ }
217
217
 
218
218
  export const getInputConfigForCommand = async (commandName) => {
219
219
  // retrievedConfigData
@@ -254,7 +254,7 @@ export const getInputConfigForCommand = async (commandName) => {
254
254
 
255
255
  return {};
256
256
 
257
- };
257
+ }
258
258
 
259
259
  // initialize
260
260
  // await setUpDefaults();
@@ -268,18 +268,18 @@ export const checkPathAccess = async (path, options = {}, throwError = false) =>
268
268
  await access(path, fs.constants.R_OK);
269
269
  } catch (err) {
270
270
  if (throwError) {
271
- if (showDebug) addDebugLog("checkPathAccess", "path: ".concat(path), "+");
272
- if (showDebug) addDebugLog("checkPathAccess", "Error: ".concat(err), "");
273
- if (showDebug) addDebugLog("checkPathAccess", "END", "-");
271
+ if (showDebug) addDebugLog("checkPathAccess", "path: ".concat(path), "+");
272
+ if (showDebug) addDebugLog("checkPathAccess", "Error: ".concat(err), "");
273
+ if (showDebug) addDebugLog("checkPathAccess", "END", "-");
274
274
  throw new Error(err);
275
275
 
276
276
  }
277
277
  else {
278
- if (showDebug) addDebugLog("checkPathAccess", "path: ".concat(path), "+");
278
+ if (showDebug) addDebugLog("checkPathAccess", "path: ".concat(path), "+");
279
279
  const message =
280
280
  errorMessage || `${chalk.red.bold('ERROR')} Could not able to access path - ${path}`;
281
281
  console.error(message);
282
- if (showDebug) addDebugLog("checkPathAccess", "END", "-");
282
+ if (showDebug) addDebugLog("checkPathAccess", "END", "-");
283
283
  process.exit(1);
284
284
  }
285
285
 
@@ -287,7 +287,7 @@ export const checkPathAccess = async (path, options = {}, throwError = false) =>
287
287
  };
288
288
 
289
289
  export const getUseWebPackPromotion = async () => {
290
- if (showDebug) addDebugLog("getUseWebPackPromotion", "", "");
290
+ if (showDebug) addDebugLog("getUseWebPackPromotion", "", "");
291
291
  const currentDirectory = process.cwd();
292
292
  const pegaConfigJsonPath = join(currentDirectory, TASKS_CONFIG_JSON_FILENAME);
293
293
 
@@ -319,10 +319,10 @@ export const getUseWebPackPromotion = async () => {
319
319
 
320
320
  return data[USE_PROMOTED_WEB_PACK];
321
321
 
322
- };
322
+ }
323
323
 
324
- export const updateUseWebPackPromotion = async (useValue = false) => {
325
- if (showDebug) addDebugLog("updateUseWebPackPromotion", "", "");
324
+ export const updateUseWebPackPromotion = async ( useValue = false ) => {
325
+ if (showDebug) addDebugLog("updateUseWebPackPromotion", "", "");
326
326
 
327
327
  const currentDirectory = process.cwd();
328
328
  const pegaConfigJsonPath = join(currentDirectory, TASKS_CONFIG_JSON_FILENAME);
@@ -341,12 +341,12 @@ export const updateUseWebPackPromotion = async (useValue = false) => {
341
341
 
342
342
  data["usePromotedWebPack"] = useValue;
343
343
 
344
- fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(data, null, 4), { encoding: 'utf8', flag: 'w' });
344
+ fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(data, null, 4), { encoding: 'utf8',flag:'w' });
345
345
 
346
- };
346
+ }
347
347
 
348
348
  export const getAboutData = async (currentOrgLib, buildVersion, dateStamp) => {
349
- if (showDebug) addDebugLog("getAboutData", `currentOrgLib: ${currentOrgLib}, buildVersion: ${buildVersion}, dateStamp: ${dateStamp}`, "");
349
+ if (showDebug) addDebugLog("getAboutData", `currentOrgLib: ${currentOrgLib}, buildVersion: ${buildVersion}, dateStamp: ${dateStamp}`,"");
350
350
  const tokenAndStaticServer = await getC11NB2STokenAndStaticServer();
351
351
 
352
352
  if (tokenAndStaticServer.C11NB2S === undefined) {
@@ -355,16 +355,16 @@ export const getAboutData = async (currentOrgLib, buildVersion, dateStamp) => {
355
355
  }
356
356
 
357
357
  const jwt = jwtDecode(tokenAndStaticServer.C11NB2S);
358
- let infinityVersion = jwt.infinity_version;
358
+ let infinityVersion= jwt.infinity_version;
359
359
  infinityVersion = infinityVersion.replace("8.", "");
360
360
 
361
361
  return `${currentOrgLib} ${buildVersion}, ${dateStamp}, ${infinityVersion}`;
362
- };
362
+ }
363
363
 
364
364
  export const applyPegaData = async (configJson) => {
365
- if (showDebug) addDebugLog("applyPegaData", "", "");
365
+ if (showDebug) addDebugLog("applyPegaData", "", "");
366
366
  const tokenAndStaticServer = await getC11NB2STokenAndStaticServer();
367
- const currentDirectory = process.cwd();
367
+ const currentDirectory = process.cwd()
368
368
  // const currentPackagePath = join(currentDirectory, PACKAGE_JSON_FILENAME);
369
369
  const currentPackageLockPath = join(currentDirectory, PACKAGE_LOCK_JSON_FILENAME);
370
370
  // let currentPackageData;
@@ -391,7 +391,7 @@ export const applyPegaData = async (configJson) => {
391
391
  }
392
392
  else {
393
393
  const jwt = jwtDecode(tokenAndStaticServer.C11NB2S);
394
- infinityVersion = jwt.infinity_version;
394
+ infinityVersion= jwt.infinity_version;
395
395
  // don't remove "8." from infinity version so can do a comparison
396
396
  }
397
397
 
@@ -400,7 +400,7 @@ export const applyPegaData = async (configJson) => {
400
400
  configJson.packageCosmosVersion = cosmosVersion;
401
401
 
402
402
 
403
- };
403
+ }
404
404
 
405
405
  export const checkJWTExpiration = async () => {
406
406
  const tokenAndStaticServer = await getC11NB2STokenAndStaticServer();
@@ -413,7 +413,7 @@ export const checkJWTExpiration = async () => {
413
413
  }
414
414
 
415
415
  const jwt = jwtDecode(tokenAndStaticServer.C11NB2S);
416
- const { exp, customer_org } = jwt;
416
+ const { exp, customer_org } = jwt;
417
417
  if (exp < (new Date().getTime() + 1) / 1000) {
418
418
  console.log(chalk.redBright("JWT token has expired, please reauthenticate."));
419
419
  process.exit(1);
@@ -432,9 +432,9 @@ export const checkJWTExpiration = async () => {
432
432
  }
433
433
 
434
434
 
435
- };
435
+ }
436
436
 
437
- export const checkAccessTokenExpiration = async () => {
437
+ export const checkAccessTokenExpiration = async() => {
438
438
 
439
439
  const tokenAndStaticServer = await getC11NB2STokenAndStaticServer();
440
440
 
@@ -444,16 +444,16 @@ export const checkAccessTokenExpiration = async () => {
444
444
  }
445
445
 
446
446
  const jwt = jwtDecode(tokenAndStaticServer.access_token);
447
- const { exp, customer_org } = jwt;
447
+ const { exp, customer_org } = jwt;
448
448
  if (exp < (new Date().getTime() + 1) / 1000) {
449
449
  console.log(chalk.redBright("Authentication token has expired, please reauthenticate."));
450
450
  process.exit(1);
451
451
  }
452
452
 
453
453
 
454
- };
454
+ }
455
455
 
456
- export const getApplicationAndVersionFromToken = async () => {
456
+ export const getApplicationAndVersionFromToken = async() => {
457
457
  const tokenAndStaticServer = await getC11NB2STokenAndStaticServer();
458
458
 
459
459
  if (tokenAndStaticServer.access_token === undefined) {
@@ -465,27 +465,27 @@ export const getApplicationAndVersionFromToken = async () => {
465
465
  const { app_name, app_version } = jwt;
466
466
  return { app_name, app_version };
467
467
 
468
- };
468
+ }
469
469
 
470
470
  export const getLibraryBased = () => {
471
- if (showDebug) addDebugLog("getLibraryBased", "", "");
471
+ if (showDebug) addDebugLog("getLibraryBased", "", "");
472
472
  return defaultConfigs.isLibraryBased;
473
- };
473
+ }
474
474
 
475
475
  export const getLibraryBasedCL = () => {
476
- if (showDebug) addDebugLog("getLibraryBasedCL", "", "");
476
+ if (showDebug) addDebugLog("getLibraryBasedCL", "", "");
477
477
  return defaultConfigs.isLibraryBasedCL;
478
- };
478
+ }
479
479
 
480
480
  export const getUseInputConfig = () => {
481
- if (showDebug) addDebugLog("getUseInputConfig", "", "");
481
+ if (showDebug) addDebugLog("getUseInputConfig", "", "");
482
482
 
483
483
 
484
484
  return defaultConfigs.useInputConfig;
485
- };
485
+ }
486
486
 
487
487
  export const setLibraryBased = async (isLibraryBased) => {
488
- if (showDebug) addDebugLog("setLibraryBased", "", "");
488
+ if (showDebug) addDebugLog("setLibraryBased", "", "");
489
489
  const currentDirectory = process.cwd();
490
490
  const pegaConfigJsonPath = join(currentDirectory, TASKS_CONFIG_JSON_FILENAME);
491
491
 
@@ -508,7 +508,7 @@ export const setLibraryBased = async (isLibraryBased) => {
508
508
  // update file
509
509
  // stringify "4", makes the json string look like JSON in the file, formated instead of a single line
510
510
  try {
511
- fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(data, null, 4), { encoding: 'utf8', flag: 'w' });
511
+ fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(data, null, 4), { encoding: 'utf8',flag:'w' });
512
512
  }
513
513
  catch (err) {
514
514
  console.error(err);
@@ -522,66 +522,66 @@ export const setLibraryBased = async (isLibraryBased) => {
522
522
 
523
523
  }
524
524
 
525
- };
525
+ }
526
526
 
527
527
  export const setLibraryBasedCL = async (isLibraryBasedCL) => {
528
528
  if (showDebug) addDebugLog("setLibraryBased", "", "");
529
- const currentDirectory = process.cwd();
530
- const pegaConfigJsonPath = join(currentDirectory, TASKS_CONFIG_JSON_FILENAME);
529
+ const currentDirectory = process.cwd();
530
+ const pegaConfigJsonPath = join(currentDirectory, TASKS_CONFIG_JSON_FILENAME);
531
531
 
532
- try {
533
- // force to throw error and not console log
534
- await checkPathAccess(pegaConfigJsonPath, {}, true);
535
- }
536
- catch (ex) {
537
- // when can't find it, always be false, assume no library based.
538
- // This is IMPORTANT for init (npx install)
539
- return false;
540
- }
532
+ try {
533
+ // force to throw error and not console log
534
+ await checkPathAccess(pegaConfigJsonPath, {}, true);
535
+ }
536
+ catch (ex) {
537
+ // when can't find it, always be false, assume no library based.
538
+ // This is IMPORTANT for init (npx install)
539
+ return false;
540
+ }
541
541
 
542
- let data = fs.readFileSync(pegaConfigJsonPath, { encoding: 'utf8' });
543
- data = JSON.parse(data);
542
+ let data = fs.readFileSync(pegaConfigJsonPath, { encoding: 'utf8' });
543
+ data = JSON.parse(data);
544
544
 
545
- if (data[LIBRARY_BASED_CL] != undefined) {
546
- data[LIBRARY_BASED_CL] = isLibraryBasedCL;
545
+ if (data[LIBRARY_BASED_CL] != undefined) {
546
+ data[LIBRARY_BASED_CL] = isLibraryBasedCL;
547
547
 
548
- // if not undefined, force this as well
549
- if (data[LIBRARY_BASED] != undefined) {
550
- data[LIBRARY_BASED] = isLibraryBasedCL;
551
- }
548
+ // if not undefined, force this as well
549
+ if (data[LIBRARY_BASED] != undefined) {
550
+ data[LIBRARY_BASED] = isLibraryBasedCL;
551
+ }
552
552
 
553
- // update file
554
- // stringify "4", makes the json string look like JSON in the file, formated instead of a single line
555
- try {
556
- fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(data, null, 4), { encoding: 'utf8', flag: 'w' });
557
- }
558
- catch (err) {
559
- console.error(err);
560
- }
561
- //await forceDefaultsUpdate();
562
- defaultConfigs.isLibraryBasedCL = isLibraryBasedCL;
553
+ // update file
554
+ // stringify "4", makes the json string look like JSON in the file, formated instead of a single line
555
+ try {
556
+ fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(data, null, 4), { encoding: 'utf8',flag:'w' });
557
+ }
558
+ catch (err) {
559
+ console.error(err);
560
+ }
561
+ //await forceDefaultsUpdate();
562
+ defaultConfigs.isLibraryBasedCL = isLibraryBasedCL;
563
563
 
564
- // force libraryBased if isLibraryBasedCL is true
565
- defaultConfigs.isLibraryBased = isLibraryBasedCL;
564
+ // force libraryBased if isLibraryBasedCL is true
565
+ defaultConfigs.isLibraryBased = isLibraryBasedCL;
566
566
 
567
567
 
568
- // reset
569
- pegaData = null;
570
- pegaConfig = null;
568
+ // reset
569
+ pegaData = null;
570
+ pegaConfig = null;
571
571
 
572
- }
572
+ }
573
573
 
574
- };
574
+ }
575
575
 
576
576
  export const getShowDebug = () => {
577
577
 
578
578
  return defaultConfigs.showDebug;
579
579
 
580
- };
580
+ }
581
581
 
582
582
 
583
583
  export const deleteLocalComponent = async componentKey => {
584
- if (showDebug) addDebugLog("deleteLocalComponent", `componentKey: ${componentKey}`, "");
584
+ if (showDebug) addDebugLog("deleteLocalComponent", `componentKey: ${componentKey}`, "");
585
585
  const currentDirectory = process.cwd();
586
586
  const pegaConfigJsonPath = join(currentDirectory, TASKS_CONFIG_JSON_FILENAME);
587
587
 
@@ -617,7 +617,7 @@ export const getHttpsAgent = serverConfig => {
617
617
  };
618
618
 
619
619
  export const deleteServerComponent = async componentKey => {
620
- if (showDebug) addDebugLog("deleteServerComponent", `componentKey: ${componentKey}`, "");
620
+ if (showDebug) addDebugLog("deleteServerComponent", `componentKey: ${componentKey}`, "");
621
621
  const serverConfig = await getPegaServerConfig();
622
622
  const { server, user, password } = serverConfig;
623
623
  const url = constructCompleteUrl(server, DELETE_COMPONENT_SERVICE_REST_ENDPOINT);
@@ -662,8 +662,8 @@ export const deleteServerComponent = async componentKey => {
662
662
  }
663
663
  };
664
664
 
665
- export const copyFileToShared = async (fileName, fileContents) => {
666
- if (showDebug) addDebugLog("copyFileToShared", `fileName: ${fileName}`, "");
665
+ export const copyFileToShared = async ( fileName, fileContents) => {
666
+ if (showDebug) addDebugLog("copyFileToShared", `fileName: ${fileName}`, "");
667
667
  const currentDirectory = process.cwd();
668
668
  const pegaConfigJsonPath = join(currentDirectory, TASKS_CONFIG_JSON_FILENAME);
669
669
 
@@ -697,7 +697,7 @@ export const copyFileToShared = async (fileName, fileContents) => {
697
697
  };
698
698
 
699
699
  export const getComponents = async (overrideDirectory = null) => {
700
- if (showDebug) addDebugLog("getComponents", "", "");
700
+ if (showDebug) addDebugLog("getComponents", "", "");
701
701
  const currentDirectory = process.cwd();
702
702
  const pegaConfigJsonPath = join(currentDirectory, TASKS_CONFIG_JSON_FILENAME);
703
703
 
@@ -723,39 +723,39 @@ export const getComponents = async (overrideDirectory = null) => {
723
723
  };
724
724
 
725
725
  export const getTopLevelConfigFiles = async (directory) => {
726
- if (showDebug) addDebugLog("getTopLevelConfigFiles", `directory: ${directory}`, "");
726
+ if (showDebug) addDebugLog("getTopLevelConfigFiles", `directory: ${directory}`, "");
727
727
  if (fs.existsSync(directory)) {
728
728
  return fs
729
- .readdirSync(directory, { withFileTypes: true })
730
- .filter(dirent => !dirent.isDirectory())
731
- .map(dirent => dirent.name);
729
+ .readdirSync(directory, { withFileTypes: true })
730
+ .filter(dirent => !dirent.isDirectory())
731
+ .map(dirent => dirent.name);
732
732
  }
733
733
  else {
734
734
  return [];
735
735
  }
736
- };
736
+ }
737
737
 
738
738
  export const removeTopLevelConfigFiles = async (directory) => {
739
- if (showDebug) addDebugLog("removeTopLevelConfigFiles", `directory: ${directory}`, "");
739
+ if (showDebug) addDebugLog("removeTopLevelConfigFiles", `directory: ${directory}`, "");
740
740
  const configFiles = await getTopLevelConfigFiles(directory);
741
741
 
742
742
  if (configFiles && configFiles.length > 0) {
743
743
  for (const configF of configFiles) {
744
744
  // don't remove these files, otherwise, remove it
745
745
  if (configF !== "package-lock.json" &&
746
- configF !== "package.json" &&
747
- configF !== "tasks.config.json" &&
748
- configF !== ".gitignore" &&
749
- configF !== ".npmrc" &&
750
- configF !== ".prettierignore") {
751
- fs.rmSync(join(directory, configF), { recursive: true, force: true, maxRetries: 2 });
746
+ configF !== "package.json" &&
747
+ configF !== "tasks.config.json" &&
748
+ configF !== ".gitignore" &&
749
+ configF !== ".npmrc" &&
750
+ configF !== ".prettierignore") {
751
+ fs.rmSync( join(directory, configF), { recursive: true, force: true, maxRetries: 2 });
752
752
  }
753
753
  }
754
754
  }
755
- };
755
+ }
756
756
 
757
- export const restoreTopLevelConfigFiles = async (directory) => {
758
- if (showDebug) addDebugLog("restoreTopLevelConfigFiles", `directory: ${directory}`, "");
757
+ export const restoreTopLevelConfigFiles = async(directory) => {
758
+ if (showDebug) addDebugLog("restoreTopLevelConfigFiles", `directory: ${directory}`, "");
759
759
  const currentDirectory = process.cwd();
760
760
  const tempDirectory = join(currentDirectory, TEMP_PATH);
761
761
  const configFiles = await getTopLevelConfigFiles(tempDirectory);
@@ -772,28 +772,28 @@ export const restoreTopLevelConfigFiles = async (directory) => {
772
772
  }
773
773
  }
774
774
  }
775
- };
775
+ }
776
776
 
777
777
  export const getTemplateConfigFiles = async () => {
778
- if (showDebug) addDebugLog("getTemplateConfigFiles", ``, "");
778
+ if (showDebug) addDebugLog("getTemplateConfigFiles", ``, "");
779
779
  const currentDirectory = process.cwd();
780
780
  const initDir = join(currentDirectory, "node_modules", "@pega", "custom-dx-components", "src", "tasks", "init");
781
781
  const templateDir = join(initDir, "template");
782
782
 
783
783
  if (fs.existsSync(templateDir)) {
784
784
  return fs
785
- .readdirSync(templateDir, { withFileTypes: true })
786
- .filter(dirent => !dirent.isDirectory())
787
- .map(dirent => dirent.name);
785
+ .readdirSync(templateDir, { withFileTypes: true })
786
+ .filter(dirent => !dirent.isDirectory())
787
+ .map(dirent => dirent.name);
788
788
  }
789
789
  else {
790
790
  return [];
791
791
  }
792
792
 
793
- };
793
+ }
794
794
 
795
- export const restoreTopLevelConfigFilesFromTemplate = async (clearDep = true) => {
796
- if (showDebug) addDebugLog("restoreTopLevelConfigFilesFromTemplate", ``, "");
795
+ export const restoreTopLevelConfigFilesFromTemplate = async(clearDep = true) => {
796
+ if (showDebug) addDebugLog("restoreTopLevelConfigFilesFromTemplate", ``, "");
797
797
  // we can't loose devDep that is part of install, so go get the template mustache and push
798
798
  // those in, replacing any changes there, but allowing additional, an keeping it updated
799
799
  // so won't loose new function if an old archive
@@ -812,7 +812,7 @@ export const restoreTopLevelConfigFilesFromTemplate = async (clearDep = true) =>
812
812
  currentPackageData = fs.readFileSync(currentPackagePath);
813
813
  }
814
814
  catch (ex) {
815
- console.log($chalk.red(`\nUnable to retrieve current package.json.`));
815
+ console.log($chalk.red(`\nUnable to retrieve current package.json.`))
816
816
  process.exit(1);
817
817
  }
818
818
  let cData = JSON.parse(currentPackageData);
@@ -822,7 +822,7 @@ export const restoreTopLevelConfigFilesFromTemplate = async (clearDep = true) =>
822
822
  retrievedTemplateData = fs.readFileSync(packageTemplateJsonPath);
823
823
  }
824
824
  catch (ex) {
825
- console.log($chalk.red(`\nUnable to retrieve package.json.mustache from code.`));
825
+ console.log($chalk.red(`\nUnable to retrieve package.json.mustache from code.`))
826
826
  process.exit(1);
827
827
  }
828
828
 
@@ -865,7 +865,7 @@ export const restoreTopLevelConfigFilesFromTemplate = async (clearDep = true) =>
865
865
  }
866
866
 
867
867
  // update current package json file
868
- fs.writeFileSync(currentPackagePath, JSON.stringify(cData, null, 4), { encoding: 'utf8', flag: 'w' });
868
+ fs.writeFileSync(currentPackagePath, JSON.stringify(cData, null, 4), { encoding: 'utf8',flag:'w' });
869
869
 
870
870
  // restore from template
871
871
  const templateFiles = await getTemplateConfigFiles();
@@ -877,10 +877,10 @@ export const restoreTopLevelConfigFilesFromTemplate = async (clearDep = true) =>
877
877
  }
878
878
  }
879
879
 
880
- };
880
+ }
881
881
 
882
882
  export const getSubComponents = async (directory, type) => {
883
- if (showDebug) addDebugLog("getDirectoryFiles", `directory: ${directory}, type: ${type}`, "");
883
+ if (showDebug) addDebugLog("getDirectoryFiles", `directory: ${directory}, type: ${type}`, "");
884
884
  const subDirectory = join(directory, type);
885
885
  return fs
886
886
  .readdirSync(subDirectory, { withFileTypes: true })
@@ -889,7 +889,7 @@ export const getSubComponents = async (directory, type) => {
889
889
  };
890
890
 
891
891
  export const getDirectoryFiles = async directory => {
892
- if (showDebug) addDebugLog("getDirectoryFiles", `directory: ${directory}`, "");
892
+ if (showDebug) addDebugLog("getDirectoryFiles", `directory: ${directory}`, "");
893
893
  return fs
894
894
  .readdirSync(directory, { withFileTypes: true })
895
895
  .filter(dirent => !dirent.isDirectory())
@@ -897,7 +897,7 @@ export const getDirectoryFiles = async directory => {
897
897
  };
898
898
 
899
899
  export const getComponentsObj = async () => {
900
- if (showDebug) addDebugLog("getComponentsObj", "", "+");
900
+ if (showDebug) addDebugLog("getComponentsObj", "", "+");
901
901
  const compList = [];
902
902
 
903
903
  // const componentList = await getDirectoryFiles(directory);
@@ -910,21 +910,21 @@ export const getComponentsObj = async () => {
910
910
  container.name = name;
911
911
  container.value = name;
912
912
 
913
- if (showDebug) addDebugLog("getComponentsObj", "container: " + JSON.stringify(container), "");
913
+ if (showDebug) addDebugLog("getComponentsObj", "container: " + JSON.stringify(container), "");
914
914
  return container;
915
915
  })
916
916
  );
917
917
  }
918
918
 
919
- if (showDebug) addDebugLog("getComponentsObj", "END", "-");
919
+ if (showDebug) addDebugLog("getComponentsObj", "END", "-");
920
920
  return compList;
921
921
  };
922
922
 
923
923
  export const getPegaConfig = async (force = false) => {
924
- if (showDebug) { addDebugLog("getPegaConfig", "", "+"); }
924
+ if (showDebug) { addDebugLog("getPegaConfig", "", "+"); }
925
925
  if (!pegaData || force) {
926
926
 
927
- if (showDebug) { addDebugLog("getPegaConfig", "retrieveData", ""); }
927
+ if (showDebug) { addDebugLog("getPegaConfig", "retrieveData", ""); }
928
928
  const currentDirectory = process.cwd();
929
929
  const pegaConfigJsonPath = join(currentDirectory, TASKS_CONFIG_JSON_FILENAME);
930
930
 
@@ -935,14 +935,14 @@ export const getPegaConfig = async (force = false) => {
935
935
  }
936
936
 
937
937
 
938
- if (showDebug) { addDebugLog("getPegaConfig", "pegaData: " + sPegaData, ""); }
939
- if (showDebug) { addDebugLog("getPegaConfig", "END", "-"); }
938
+ if (showDebug) { addDebugLog("getPegaConfig", "pegaData: " + sPegaData, ""); }
939
+ if (showDebug) { addDebugLog("getPegaConfig", "END", "-"); }
940
940
 
941
941
  return pegaData;
942
942
  };
943
943
 
944
944
  export const getPegaServerConfig = async (force = false) => {
945
- if (showDebug) addDebugLog("getPegaServerConfig", "", "+");
945
+ if (showDebug) addDebugLog("getPegaServerConfig", "", "+");
946
946
  if (!pegaConfig || force) {
947
947
  pegaConfig = await getPegaConfig();
948
948
 
@@ -971,26 +971,26 @@ export const getPegaServerConfig = async (force = false) => {
971
971
  sPegaServerConfig = JSON.stringify(pegaConfig['server-config']);
972
972
  }
973
973
 
974
- if (showDebug) addDebugLog("getPegaServerConfig", "server config:" + sPegaServerConfig, "");
975
- if (showDebug) addDebugLog("getPegaServerConfig", "END", "-");
974
+ if (showDebug) addDebugLog("getPegaServerConfig", "server config:" + sPegaServerConfig, "");
975
+ if (showDebug) addDebugLog("getPegaServerConfig", "END", "-");
976
976
  return pegaConfig['server-config'];
977
977
  };
978
978
 
979
979
 
980
980
  // contains all the config, task config, etc. created upon start
981
981
  export const getConfigDefaults = () => {
982
- if (showDebug) addDebugLog("getConfigDefaults", `defaults: ${JSON.stringify(defaultConfigs)}`, "");
982
+ if (showDebug) addDebugLog("getConfigDefaults", `defaults: ${JSON.stringify(defaultConfigs)}`, "");
983
983
 
984
984
  return defaultConfigs;
985
985
 
986
- };
986
+ }
987
987
 
988
988
  export const forceDefaultsUpdate = async () => {
989
989
  defaultConfigs = await setUpDefaults();
990
- };
990
+ }
991
991
 
992
992
  export const updateServerConfigRuleSetAndVersion = async (rulesetName, rulesetVersion) => {
993
- if (showDebug) addDebugLog("updateServerConfigRuleSetAndVersion", `rulesetName: ${rulesetName}, rulesetVersion: ${rulesetVersion}`, "");
993
+ if (showDebug) addDebugLog("updateServerConfigRuleSetAndVersion", `rulesetName: ${rulesetName}, rulesetVersion: ${rulesetVersion}`, "");
994
994
  const currentDirectory = process.cwd();
995
995
  const pegaConfigJsonPath = join(currentDirectory, TASKS_CONFIG_JSON_FILENAME);
996
996
  let configData = await getPegaConfig(true);
@@ -1001,12 +1001,12 @@ export const updateServerConfigRuleSetAndVersion = async (rulesetName, rulesetVe
1001
1001
 
1002
1002
  // update file
1003
1003
  // stringify "4", makes the json string look like JSON in the file, formated instead of a single line
1004
- fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(configData, null, 4), { encoding: 'utf8', flag: 'w' });
1004
+ fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(configData, null, 4), { encoding: 'utf8',flag:'w' });
1005
1005
 
1006
- };
1006
+ }
1007
1007
 
1008
1008
  export const updateComponentDefaultLibrary = async (library) => {
1009
- if (showDebug) addDebugLog("updateComponentDefaultLibrary", `library: ${library}`, "");
1009
+ if (showDebug) addDebugLog("updateComponentDefaultLibrary", `library: ${library}`, "");
1010
1010
  const currentDirectory = process.cwd();
1011
1011
  const pegaConfigJsonPath = join(currentDirectory, TASKS_CONFIG_JSON_FILENAME);
1012
1012
 
@@ -1017,12 +1017,12 @@ export const updateComponentDefaultLibrary = async (library) => {
1017
1017
  componentsDefault.library = library;
1018
1018
 
1019
1019
 
1020
- fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(config, null, 4), { encoding: 'utf8', flag: 'w' });
1020
+ fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(config, null, 4), { encoding: 'utf8',flag:'w' });
1021
1021
 
1022
- };
1022
+ }
1023
1023
 
1024
1024
  export const updateComponentDefaultVersion = async (version) => {
1025
- if (showDebug) addDebugLog("updateComponentDefaultVersion", `version: ${version}`, "");
1025
+ if (showDebug) addDebugLog("updateComponentDefaultVersion", `version: ${version}`, "");
1026
1026
  const currentDirectory = process.cwd();
1027
1027
  const pegaConfigJsonPath = join(currentDirectory, TASKS_CONFIG_JSON_FILENAME);
1028
1028
 
@@ -1033,21 +1033,21 @@ export const updateComponentDefaultVersion = async (version) => {
1033
1033
  componentsDefault.version = version;
1034
1034
 
1035
1035
 
1036
- fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(config, null, 4), { encoding: 'utf8', flag: 'w' });
1036
+ fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(config, null, 4), { encoding: 'utf8',flag:'w' });
1037
1037
 
1038
- };
1038
+ }
1039
1039
 
1040
- export const getConfigDevBuild = async () => {
1041
- if (showDebug) addDebugLog("getConfigDevBuild", "", "");
1040
+ export const getConfigDevBuild = async() => {
1041
+ if (showDebug) addDebugLog("getConfigDevBuild", "", "");
1042
1042
  // const serverConfig = await getPegaServerConfig();
1043
1043
 
1044
1044
  // return serverConfig.devBuild;
1045
1045
  return defaultConfigs.devBuild;
1046
1046
 
1047
- };
1047
+ }
1048
1048
 
1049
1049
  export const setConfigDevBuild = async (devBuild) => {
1050
- if (showDebug) addDebugLog("setConfigDevBuild", `devBuild: ${devBuild}`, "");
1050
+ if (showDebug) addDebugLog("setConfigDevBuild", `devBuild: ${devBuild}`, "");
1051
1051
  const currentDirectory = process.cwd();
1052
1052
  const pegaConfigJsonPath = join(currentDirectory, TASKS_CONFIG_JSON_FILENAME);
1053
1053
  let configData = await getPegaConfig(true);
@@ -1056,19 +1056,19 @@ export const setConfigDevBuild = async (devBuild) => {
1056
1056
 
1057
1057
  // update file
1058
1058
  // stringify "4", makes the json string look like JSON in the file, formated instead of a single line
1059
- fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(configData, null, 4), { encoding: 'utf8', flag: 'w' });
1060
- };
1059
+ fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(configData, null, 4), { encoding: 'utf8',flag:'w' });
1060
+ }
1061
1061
 
1062
- export const getConfigDevServerPort = async () => {
1063
- if (showDebug) addDebugLog("getConfigDevServerPort", "", "");
1062
+ export const getConfigDevServerPort = async() => {
1063
+ if (showDebug) addDebugLog("getConfigDevServerPort", "", "");
1064
1064
  // const serverConfig = await getPegaServerConfig();
1065
1065
 
1066
1066
  return defaultConfigs.devServerPort;
1067
1067
 
1068
- };
1068
+ }
1069
1069
 
1070
1070
  export const setConfigImportRelativePath = async (importRelativePath) => {
1071
- if (showDebug) addDebugLog("setConfigImportRelativePath", `importRelativePath: ${importRelativePath}`, "");
1071
+ if (showDebug) addDebugLog("setConfigImportRelativePath", `importRelativePath: ${importRelativePath}`, "");
1072
1072
  const currentDirectory = process.cwd();
1073
1073
  const pegaConfigJsonPath = join(currentDirectory, TASKS_CONFIG_JSON_FILENAME);
1074
1074
  let configData = await getPegaConfig(true);
@@ -1076,11 +1076,11 @@ export const setConfigImportRelativePath = async (importRelativePath) => {
1076
1076
 
1077
1077
  // update file
1078
1078
  // stringify "4", makes the json string look like JSON in the file, formated instead of a single line
1079
- fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(configData, null, 4), { encoding: 'utf8', flag: 'w' });
1080
- };
1079
+ fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(configData, null, 4), { encoding: 'utf8',flag:'w' });
1080
+ }
1081
1081
 
1082
1082
  export const setConfigExportRelativePath = async (exportRelativePath) => {
1083
- if (showDebug) addDebugLog("setConfigExportRelativePath", `exportRelativePath: ${exportRelativePath}`, "");
1083
+ if (showDebug) addDebugLog("setConfigExportRelativePath", `exportRelativePath: ${exportRelativePath}`, "");
1084
1084
  const currentDirectory = process.cwd();
1085
1085
  const pegaConfigJsonPath = join(currentDirectory, TASKS_CONFIG_JSON_FILENAME);
1086
1086
  let configData = await getPegaConfig(true);
@@ -1088,21 +1088,21 @@ export const setConfigExportRelativePath = async (exportRelativePath) => {
1088
1088
 
1089
1089
  // update file
1090
1090
  // stringify "4", makes the json string look like JSON in the file, formated instead of a single line
1091
- fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(configData, null, 4), { encoding: 'utf8', flag: 'w' });
1092
- };
1091
+ fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(configData, null, 4), { encoding: 'utf8',flag:'w' });
1092
+ }
1093
1093
 
1094
1094
  export const updateDefaultOrganization = async (organization) => {
1095
- if (showDebug) addDebugLog("updateDefaultOrganization", `organization: ${organization}`, "");
1095
+ if (showDebug) addDebugLog("updateDefaultOrganization", `organization: ${organization}`, "");
1096
1096
  let packageData = JSON.parse(fs.readFileSync(path.resolve('package.json'), 'utf-8'));
1097
1097
 
1098
1098
  packageData.organization = organization;
1099
1099
 
1100
- fs.writeFileSync(path.resolve('package.json'), JSON.stringify(packageData, null, 4), { encoding: 'utf8', flag: 'w' });
1100
+ fs.writeFileSync(path.resolve('package.json'), JSON.stringify(packageData, null, 4), { encoding: 'utf8',flag:'w' });
1101
1101
 
1102
- };
1102
+ }
1103
1103
 
1104
1104
  export const updateConfigVersion = async (componentKey, buildVersion, currentOrgLib) => {
1105
- if (showDebug) addDebugLog("updateConfigVersion", `componentKey: ${componentKey}, buildVersion: ${buildVersion}, currentOrgLib: ${currentOrgLib}`, "");
1105
+ if (showDebug) addDebugLog("updateConfigVersion", `componentKey: ${componentKey}, buildVersion: ${buildVersion}, currentOrgLib: ${currentOrgLib}`, "");
1106
1106
  const componentDirectory = await getComponentDirectoryPath(componentKey);
1107
1107
  const configFileName = 'config.json';
1108
1108
 
@@ -1144,7 +1144,7 @@ export const updateConfigVersion = async (componentKey, buildVersion, currentOrg
1144
1144
  }
1145
1145
  else {
1146
1146
  // don't have "About"
1147
- const aboutLabelJSON = {
1147
+ const aboutLabelJSON = {
1148
1148
  "format": "LABEL",
1149
1149
  "label": "About",
1150
1150
  "name": "PegaAboutLabel",
@@ -1155,7 +1155,7 @@ export const updateConfigVersion = async (componentKey, buildVersion, currentOrg
1155
1155
  "label": aboutData,
1156
1156
  "name": "PegaAboutData",
1157
1157
  "variant": "primary"
1158
- };
1158
+ }
1159
1159
  properties.push(aboutLabelJSON);
1160
1160
  properties.push(aboutDataJSON);
1161
1161
  }
@@ -1177,20 +1177,20 @@ export const updateConfigVersion = async (componentKey, buildVersion, currentOrg
1177
1177
 
1178
1178
 
1179
1179
  // write back file
1180
- fs.writeFileSync(configFile, JSON.stringify(data, null, 4), { encoding: 'utf8', flag: 'w' });
1180
+ fs.writeFileSync(configFile, JSON.stringify(data, null, 4), { encoding: 'utf8',flag:'w' });
1181
1181
  };
1182
1182
 
1183
- export const getServerType = () => {
1184
- if (showDebug) addDebugLog("getServerType", "", "+");
1185
- // const defaultPegaServerConfig = await getPegaServerConfig();
1186
- // if (showDebug) addDebugLog("getServerType", "serverType:" + defaultPegaServerConfig.serverType, "");
1187
- if (showDebug) addDebugLog("getServerType", "END", "-");
1183
+ export const getServerType = () => {
1184
+ if (showDebug) addDebugLog("getServerType", "", "+");
1185
+ // const defaultPegaServerConfig = await getPegaServerConfig();
1186
+ // if (showDebug) addDebugLog("getServerType", "serverType:" + defaultPegaServerConfig.serverType, "");
1187
+ if (showDebug) addDebugLog("getServerType", "END", "-");
1188
1188
  // return defaultPegaServerConfig.serverType;
1189
1189
  return defaultConfigs.serverType;
1190
- };
1190
+ }
1191
1191
 
1192
- export const setServerType = async (serverType) => {
1193
- if (showDebug) addDebugLog("setServerType", `serverType: ${serverType}`, "");
1192
+ export const setServerType = async(serverType) => {
1193
+ if (showDebug) addDebugLog("setServerType", `serverType: ${serverType}`, "");
1194
1194
  const currentDirectory = process.cwd();
1195
1195
  const pegaConfigJsonPath = join(currentDirectory, TASKS_CONFIG_JSON_FILENAME);
1196
1196
  let configData = await getPegaConfig(true);
@@ -1199,23 +1199,23 @@ export const setServerType = async (serverType) => {
1199
1199
 
1200
1200
  // update file
1201
1201
  // stringify "4", makes the json string look like JSON in the file, formated instead of a single line
1202
- fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(configData, null, 4), { encoding: 'utf8', flag: 'w' });
1202
+ fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(configData, null, 4), { encoding: 'utf8',flag:'w' });
1203
1203
 
1204
1204
  // reset
1205
1205
  pegaData = null;
1206
1206
  pegaConfig = null;
1207
1207
 
1208
1208
  await forceDefaultsUpdate();
1209
- };
1209
+ }
1210
1210
 
1211
1211
  export const getSrcDirectoryPath = async () => {
1212
1212
  const currentDirectory = process.cwd();
1213
1213
 
1214
1214
  return join(currentDirectory, "src");
1215
- };
1215
+ }
1216
1216
 
1217
1217
  export const getComponentDirectoryPath = async (componentKey, overrideDir = null) => {
1218
- if (showDebug) addDebugLog("getComponentDirectoryPath", "", "+");
1218
+ if (showDebug) addDebugLog("getComponentDirectoryPath", "", "+");
1219
1219
  const currentDirectory = process.cwd();
1220
1220
  const pegaConfigJsonPath = join(currentDirectory, TASKS_CONFIG_JSON_FILENAME);
1221
1221
 
@@ -1230,14 +1230,14 @@ export const getComponentDirectoryPath = async (componentKey, overrideDir = null
1230
1230
  );
1231
1231
  process.exit(1);
1232
1232
  }
1233
- if (showDebug) addDebugLog("getComponentDirectoryPath", "path: " + join(currentDirectory, data[COMPONENTS_DIRECTORY_PATH], componentKey), "");
1234
- if (showDebug) addDebugLog("getComponentDirectoryPath", "END", "-");
1233
+ if (showDebug) addDebugLog("getComponentDirectoryPath", "path: " + join(currentDirectory, data[COMPONENTS_DIRECTORY_PATH], componentKey), "");
1234
+ if (showDebug) addDebugLog("getComponentDirectoryPath", "END", "-");
1235
1235
  return overrideDir ? join(overrideDir, componentKey) : join(currentDirectory, data[COMPONENTS_DIRECTORY_PATH], componentKey);
1236
1236
  };
1237
1237
 
1238
1238
 
1239
1239
  export const compileMustacheTemplate = (file, data) => {
1240
- if (showDebug) addDebugLog("compileMustacheTemplate", `file: ${file}`, "");
1240
+ if (showDebug) addDebugLog("compileMustacheTemplate", `file: ${file}`, "");
1241
1241
  const content = fs.readFileSync(file, 'utf8');
1242
1242
  return mustache.render(content, data);
1243
1243
  };
@@ -1251,7 +1251,7 @@ export const convertIntoPascalCase = string => {
1251
1251
  };
1252
1252
 
1253
1253
  export const constructCompleteUrl = (baseServer, endPoint) => {
1254
- if (showDebug) addDebugLog("constructCompleteUrl", "url: " + baseServer.endsWith('/') ? `${baseServer}${endPoint}` : `${baseServer}/${endPoint}`, "");
1254
+ if (showDebug) addDebugLog("constructCompleteUrl", "url: " + baseServer.endsWith('/') ? `${baseServer}${endPoint}` : `${baseServer}/${endPoint}`, "");
1255
1255
  return baseServer.endsWith('/') ? `${baseServer}${endPoint}` : `${baseServer}/${endPoint}`;
1256
1256
  };
1257
1257
 
@@ -1306,7 +1306,7 @@ export const showVersion = async () => {
1306
1306
  const nodeMajorVersion = parseInt(arNodeVersion[0]);
1307
1307
  const nodeMinorVersion = parseInt(arNodeVersion[1]);
1308
1308
 
1309
- if (nodeMajorVersion < 22 && nodeMinorVersion < 15) {
1309
+ if (nodeMajorVersion < 22 && nodeMinorVersion < 15 ) {
1310
1310
  console.log(
1311
1311
  chalk.redBright(
1312
1312
  `DX Component Builder - SDK requires node v20.15.0 or greater, current version: ${process.version}`
@@ -1321,24 +1321,27 @@ export const showVersion = async () => {
1321
1321
 
1322
1322
  };
1323
1323
 
1324
- export const checkForBranch = async (rulesetName) => {
1325
- if (rulesetName === "") {
1326
- const serverConfig = await getPegaServerConfig();
1327
- rulesetName = serverConfig.rulesetName;
1328
- }
1324
+ export const checkForBranch = async(rulesetName) => {
1329
1325
 
1330
- if (rulesetName.toLowerCase().indexOf("_branch") >= 0) {
1331
- console.log(
1332
- chalk.redBright(
1333
- `Ruleset ${chalk.bold(`${rulesetName}`)} cannot be a branch ruleset.`
1334
- )
1335
- );
1336
- process.exit(1);
1326
+ if (getServerType() === "infinity") {
1327
+ if (rulesetName === "") {
1328
+ const serverConfig = await getPegaServerConfig();
1329
+ rulesetName = serverConfig.rulesetName;
1330
+ }
1331
+
1332
+ if (rulesetName.toLowerCase().indexOf("_branch") >= 0) {
1333
+ console.log(
1334
+ chalk.redBright(
1335
+ `Ruleset ${chalk.bold(`${rulesetName}`)} cannot be a branch ruleset.`
1336
+ )
1337
+ );
1338
+ process.exit(1);
1339
+ }
1337
1340
  }
1338
- };
1341
+ }
1339
1342
 
1340
1343
  export const getOOTBComponents = async () => {
1341
- if (showDebug) addDebugLog("getOOTBComponents", "", "");
1344
+ if (showDebug) addDebugLog("getOOTBComponents", "", "");
1342
1345
  return new Promise(resolve => {
1343
1346
  fs.readFile(OOTB_COMPONENTS, 'utf-8', async (error, ootbComponentsData) => {
1344
1347
  if (error) {
@@ -1391,7 +1394,7 @@ export const getOOTBComponents = async () => {
1391
1394
  };
1392
1395
 
1393
1396
  export const deleteInfinityServerComponent = async componentKey => {
1394
- if (showDebug) addDebugLog("deleteInfinityServerComponent", `componentKey: ${componentKey}`, "");
1397
+ if (showDebug) addDebugLog("deleteInfinityServerComponent", `componentKey: ${componentKey}`, "");
1395
1398
  const serverConfig = await getPegaServerConfig();
1396
1399
  const { server } = serverConfig;
1397
1400
  const url = constructCompleteUrl(server, DELETE_COMPONENT_SERVICE_REST_ENDPOINT);
@@ -1422,13 +1425,13 @@ export const deleteInfinityServerComponent = async componentKey => {
1422
1425
  // console.log(accessTokenUri, refreshToken);
1423
1426
  /* TODO - Handle refresh_token */
1424
1427
  }
1425
- else if (status === 404) {
1428
+ else if (status === 404){
1426
1429
  throw new Error('404: Server resource not found');
1427
1430
  }
1428
- else if (status === 405) {
1431
+ else if (status === 405){
1429
1432
  throw new Error('405: Server method not allowed');
1430
1433
  }
1431
- else if (status === 408) {
1434
+ else if (status === 408){
1432
1435
  throw new Error('408: Server timed out');
1433
1436
  }
1434
1437
  else if (response.status === 403) {
@@ -1443,7 +1446,7 @@ export const deleteInfinityServerComponent = async componentKey => {
1443
1446
  try {
1444
1447
  const respData = await response.json();
1445
1448
  console.log(
1446
- chalk.bold.green(`Success : ${respData.message}`)
1449
+ chalk.bold.green(`Success : ${respData.message}`)
1447
1450
  );
1448
1451
 
1449
1452
  if (status === 500) {
@@ -1453,12 +1456,12 @@ export const deleteInfinityServerComponent = async componentKey => {
1453
1456
  }
1454
1457
  catch (err) {
1455
1458
  if (status === 500) {
1456
- throw new Error(
1457
- `Error occurred in authentication. Please regenerate using authenticate`
1458
- );
1459
+ throw new Error(
1460
+ `Error occurred in authentication. Please regenerate using authenticate`
1461
+ );
1459
1462
  }
1460
1463
  else if (status === 999) {
1461
- throw new Error(err);
1464
+ throw new Error (err);
1462
1465
  }
1463
1466
  }
1464
1467
 
@@ -1470,7 +1473,7 @@ export const deleteInfinityServerComponent = async componentKey => {
1470
1473
  };
1471
1474
 
1472
1475
  export const deleteInfinityServerComponentLibrary = async (libraryName, rulesetName, rulesetVersion) => {
1473
- if (showDebug) addDebugLog("deleteInfinityServerComponentLibrary", `componentKey: ${componentKey}, rulesetName: ${rulesetName}, rulesetVersion: ${rulesetVersion}`, "");
1476
+ if (showDebug) addDebugLog("deleteInfinityServerComponentLibrary", `componentKey: ${componentKey}, rulesetName: ${rulesetName}, rulesetVersion: ${rulesetVersion}`, "");
1474
1477
  const serverConfig = await getPegaServerConfig();
1475
1478
  const { server } = serverConfig;
1476
1479
  const url = constructCompleteUrl(server, DELETE_COMPONENT_LIBRARY_SERVICE_REST_ENDPOINT);
@@ -1507,13 +1510,13 @@ export const deleteInfinityServerComponentLibrary = async (libraryName, rulesetN
1507
1510
  // console.log(accessTokenUri, refreshToken);
1508
1511
  /* TODO - Handle refresh_token */
1509
1512
  }
1510
- else if (status === 404) {
1513
+ else if (status === 404){
1511
1514
  throw new Error('404: Server resource not found');
1512
1515
  }
1513
- else if (status === 405) {
1516
+ else if (status === 405){
1514
1517
  throw new Error('405: Server method not allowed');
1515
1518
  }
1516
- else if (status === 408) {
1519
+ else if (status === 408){
1517
1520
  throw new Error('408: Server timed out');
1518
1521
  }
1519
1522
  else if (response.status === 403) {
@@ -1542,12 +1545,12 @@ export const deleteInfinityServerComponentLibrary = async (libraryName, rulesetN
1542
1545
  }
1543
1546
  catch (err) {
1544
1547
  if (status === 500) {
1545
- throw new Error(
1546
- `Error occurred in authentication. Please regenerate using authenticate`
1547
- );
1548
+ throw new Error(
1549
+ `Error occurred in authentication. Please regenerate using authenticate`
1550
+ );
1548
1551
  }
1549
1552
  else if (status === 999) {
1550
- throw new Error(err);
1553
+ throw new Error (err);
1551
1554
  }
1552
1555
  }
1553
1556
 
@@ -1560,7 +1563,7 @@ export const deleteInfinityServerComponentLibrary = async (libraryName, rulesetN
1560
1563
 
1561
1564
 
1562
1565
  export const deleteLaunchpadServerComponent = async componentKey => {
1563
- if (showDebug) addDebugLog("deleteLaunchpadServerComponent", `componentKey: ${componentKey}`, "");
1566
+ if (showDebug) addDebugLog("deleteLaunchpadServerComponent", `componentKey: ${componentKey}`, "");
1564
1567
  const { server, isolationId } = await getPegaServerConfig();
1565
1568
  const deleteUrl = constructCompleteUrl(
1566
1569
  server,
@@ -1604,13 +1607,13 @@ export const deleteLaunchpadServerComponent = async componentKey => {
1604
1607
  // console.log(accessTokenUri, refreshToken);
1605
1608
  /* TODO - Handle refresh_token */
1606
1609
  }
1607
- else if (status === 404) {
1610
+ else if (status === 404){
1608
1611
  throw new Error('404: Server resource not found');
1609
1612
  }
1610
- else if (status === 405) {
1613
+ else if (status === 405){
1611
1614
  throw new Error('405: Server method not allowed');
1612
1615
  }
1613
- else if (status === 408) {
1616
+ else if (status === 408){
1614
1617
  throw new Error('408: Server timed out');
1615
1618
  }
1616
1619
  else if (response.status === 403) {
@@ -1623,7 +1626,7 @@ export const deleteLaunchpadServerComponent = async componentKey => {
1623
1626
  try {
1624
1627
  const respData = await response.text();
1625
1628
  console.log(
1626
- chalk.bold.green(`Success : ${respData}`)
1629
+ chalk.bold.green(`Success : ${respData}`)
1627
1630
  );
1628
1631
 
1629
1632
  if (status === 500) {
@@ -1633,12 +1636,12 @@ export const deleteLaunchpadServerComponent = async componentKey => {
1633
1636
  }
1634
1637
  catch (err) {
1635
1638
  if (status === 500) {
1636
- throw new Error(
1637
- `Error occurred in authentication. Please regenerate using authenticate`
1638
- );
1639
+ throw new Error(
1640
+ `Error occurred in authentication. Please regenerate using authenticate`
1641
+ );
1639
1642
  }
1640
1643
  else if (status === 999) {
1641
- throw new Error(err);
1644
+ throw new Error (err);
1642
1645
  }
1643
1646
  }
1644
1647
  }
@@ -1648,7 +1651,7 @@ export const deleteLaunchpadServerComponent = async componentKey => {
1648
1651
  };
1649
1652
 
1650
1653
  export const getBootstrapConfig = async (restServerUrl, authorizationHeader) => {
1651
- if (showDebug) addDebugLog("getBootstrapConfig", `restServerUrl: ${restServerUrl}`, "");
1654
+ if (showDebug) addDebugLog("getBootstrapConfig", `restServerUrl: ${restServerUrl}`, "");
1652
1655
  const serverConfig = await getPegaServerConfig();
1653
1656
 
1654
1657
  return fetch(`${restServerUrl}/${BOOTSTRAP_CONFIG}`, {
@@ -1666,7 +1669,7 @@ export const getBootstrapConfig = async (restServerUrl, authorizationHeader) =>
1666
1669
  };
1667
1670
 
1668
1671
  export const updateC11NB2SForInfinity = async () => {
1669
- if (showDebug) addDebugLog("updateC11NB2SForInfinity", "", "");
1672
+ if (showDebug) addDebugLog("updateC11NB2SForInfinity", "", "");
1670
1673
  const serverConfig = await getPegaServerConfig();
1671
1674
  const { server } = serverConfig;
1672
1675
  const OAuthData = fs.readFileSync(TOKEN_PATH, 'utf8');
@@ -1685,7 +1688,7 @@ export const updateC11NB2SForInfinity = async () => {
1685
1688
  objOauthData["appStaticContentServer"] = (bootstrap.serviceConfig.appStaticContentServer != "no-cdn" && bootstrap.serviceConfig.appStaticContentServer != "") ? bootstrap.serviceConfig.appStaticContentServer : bootstrap.serviceConfig.staticContentServer;
1686
1689
 
1687
1690
  // write out file
1688
- fs.writeFileSync(TOKEN_PATH, JSON.stringify(objOauthData), { encoding: 'utf8', flag: 'w' });
1691
+ fs.writeFileSync(TOKEN_PATH, JSON.stringify(objOauthData), { encoding: 'utf8',flag:'w' });
1689
1692
  }
1690
1693
 
1691
1694
  }
@@ -1698,7 +1701,7 @@ export const updateC11NB2SForLaunchpad = async () => {
1698
1701
  };
1699
1702
 
1700
1703
  export const getC11NB2STokenAndStaticServer = async () => {
1701
- if (showDebug) addDebugLog("getC11NB2STokenAndStaticServer", "", "");
1704
+ if (showDebug) addDebugLog("getC11NB2STokenAndStaticServer", "", "");
1702
1705
  const serverConfig = await getPegaServerConfig();
1703
1706
  const { server } = serverConfig;
1704
1707
  let OAuthData;
@@ -1710,28 +1713,28 @@ export const getC11NB2STokenAndStaticServer = async () => {
1710
1713
  }
1711
1714
 
1712
1715
  if (OAuthData) {
1713
- const { C11NB2S, appStaticContentServer, access_token } = JSON.parse(OAuthData);
1716
+ const { C11NB2S, appStaticContentServer, access_token } = JSON.parse(OAuthData)
1714
1717
 
1715
- return ({ C11NB2S, appStaticContentServer, access_token });
1718
+ return ({ C11NB2S, appStaticContentServer, access_token});
1716
1719
 
1717
1720
  }
1718
1721
  return ({});
1719
1722
  };
1720
1723
 
1721
1724
  export const getLocalLibraries = async () => {
1722
- if (showDebug) addDebugLog("getLocalLibraries", "", "");
1725
+ if (showDebug) addDebugLog("getLocalLibraries", "" , "");
1723
1726
  const currentDirectory = process.cwd();
1724
1727
  const configDef = getConfigDefaults();
1725
1728
  const libFilter = configDef.organization.concat("_");
1726
1729
 
1727
1730
  return fs
1728
- .readdirSync(currentDirectory, { withFileTypes: true })
1729
- .filter(dirent => dirent.isDirectory() && dirent.name.startsWith(libFilter))
1730
- .map(dirent => dirent.name);
1731
- };
1731
+ .readdirSync(currentDirectory, { withFileTypes: true })
1732
+ .filter(dirent => dirent.isDirectory() && dirent.name.startsWith(libFilter))
1733
+ .map(dirent => dirent.name);
1734
+ }
1732
1735
 
1733
1736
  export const getLocalLibraryVersions = async (libraryName, currentVersion = "0.0.0") => {
1734
- if (showDebug) addDebugLog("getLocalLibraryVersions", `libraryName: ${libraryName}`, "");
1737
+ if (showDebug) addDebugLog("getLocalLibraryVersions", `libraryName: ${libraryName}` , "");
1735
1738
  const currentDirectory = process.cwd();
1736
1739
 
1737
1740
  const directory = join(currentDirectory, libraryName);
@@ -1742,9 +1745,9 @@ export const getLocalLibraryVersions = async (libraryName, currentVersion = "0.0
1742
1745
  };
1743
1746
 
1744
1747
  export const getLocalArchivedLibraryVersions = async (libraryName, currentVersion = "0.0.0") => {
1745
- if (showDebug) addDebugLog("getLocalArchivedLibraryVersions", `libraryName: ${libraryName}`, "");
1748
+ if (showDebug) addDebugLog("getLocalArchivedLibraryVersions", `libraryName: ${libraryName}` , "");
1746
1749
  const currentDirectory = process.cwd();
1747
- const archiveDirectory = join(currentDirectory, ARCHIVES_PATH, `${libraryName}`);
1750
+ const archiveDirectory = join (currentDirectory, ARCHIVES_PATH, `${libraryName}`);
1748
1751
 
1749
1752
  return fs
1750
1753
  .readdirSync(archiveDirectory, { withFileTypes: true })
@@ -1752,31 +1755,31 @@ export const getLocalArchivedLibraryVersions = async (libraryName, currentVersio
1752
1755
  .map(dirent => dirent.name);
1753
1756
  };
1754
1757
 
1755
- export const getLocalArchivedLibrraryVersionData = async (libraryName, libraryVersion) => {
1756
- if (showDebug) addDebugLog("getLocalArchivedLibrraryVersionData", `libraryName: ${libraryName}, libraryVersion: ${libraryVersion}`, "");
1758
+ export const getLocalArchivedLibrraryVersionData = async(libraryName, libraryVersion) => {
1759
+ if (showDebug) addDebugLog("getLocalArchivedLibrraryVersionData", `libraryName: ${libraryName}, libraryVersion: ${libraryVersion}`, "");
1757
1760
  const currentDirectory = process.cwd();
1758
- const archiveDirectory = join(currentDirectory, ARCHIVES_PATH, `${libraryName}`, `${libraryVersion}`);
1761
+ const archiveDirectory = join (currentDirectory, ARCHIVES_PATH, `${libraryName}`, `${libraryVersion}`);
1759
1762
 
1760
- const componentConfigFile = join(archiveDirectory, COMPONENTS_CONFIG_FILE_NAME);
1763
+ const componentConfigFile = join (archiveDirectory, COMPONENTS_CONFIG_FILE_NAME);
1761
1764
 
1762
- let data = fs.readFileSync(componentConfigFile, { encoding: 'utf8' });
1765
+ let data = fs.readFileSync(componentConfigFile, { encoding: 'utf8' })
1763
1766
 
1764
1767
  return data;
1765
- };
1768
+ }
1766
1769
 
1767
1770
  export const getLocalLibraryVersionData = async (libraryName, libraryVersion) => {
1768
- if (showDebug) addDebugLog("getLocalLibraryVersionDate", `libraryName: ${libraryName}, libraryVersion: ${libraryVersion}`, "");
1769
- const currentDirectory = process.cwd();
1770
- const libDir = join(currentDirectory, libraryName, libraryVersion);
1771
- const libDataFile = join(libDir, COMPONENTS_CONFIG_FILE_NAME);
1771
+ if (showDebug) addDebugLog("getLocalLibraryVersionDate", `libraryName: ${libraryName}, libraryVersion: ${libraryVersion}` , "");
1772
+ const currentDirectory = process.cwd();
1773
+ const libDir = join(currentDirectory, libraryName, libraryVersion);
1774
+ const libDataFile = join(libDir, COMPONENTS_CONFIG_FILE_NAME);
1772
1775
 
1773
- let data = fs.readFileSync(libDataFile, { encoding: 'utf8' });
1776
+ let data = fs.readFileSync(libDataFile, { encoding: 'utf8' })
1774
1777
 
1775
- return data;
1778
+ return data;
1776
1779
  };
1777
1780
 
1778
1781
  export const deleteLocalLibrary = async (libraryName) => {
1779
- if (showDebug) addDebugLog("deleteLocalLibrary", `libraryName: ${libraryName}`, "");
1782
+ if (showDebug) addDebugLog("deleteLocalLibrary", `libraryName: ${libraryName}` , "");
1780
1783
  const currentDirectory = process.cwd();
1781
1784
 
1782
1785
  const directory = join(currentDirectory, libraryName);
@@ -1805,7 +1808,7 @@ export const deleteLocalLibrary = async (libraryName) => {
1805
1808
  };
1806
1809
 
1807
1810
  export const deleteLocalLibraryVersion = async (libraryName, libraryVersion) => {
1808
- if (showDebug) addDebugLog("getLocalLibraryVersions", `libraryName: ${libraryName}, libraryVersion: ${libraryVersion}`, "");
1811
+ if (showDebug) addDebugLog("getLocalLibraryVersions", `libraryName: ${libraryName}, libraryVersion: ${libraryVersion}` , "");
1809
1812
  const currentDirectory = process.cwd();
1810
1813
 
1811
1814
  const directory = join(currentDirectory, libraryName, libraryVersion);
@@ -1813,7 +1816,7 @@ export const deleteLocalLibraryVersion = async (libraryName, libraryVersion) =>
1813
1816
  try {
1814
1817
  if (fs.existsSync(directory)) {
1815
1818
  console.log(`Deleting library version: ${chalk.green.bold(libraryName)}:${chalk.green.bold(libraryVersion)}`);
1816
- fs.rmSync(directory, { recursive: true, force: true, maxRetries: 2 });
1819
+ fs.rmSync(directory, { recursive: true, force: true, maxRetries: 2 });
1817
1820
  console.log(`Library version: ${chalk.green.bold(libraryName)}:${chalk.green.bold(libraryVersion)} is deleted from Local`);
1818
1821
  }
1819
1822
  else {
@@ -1828,7 +1831,7 @@ export const deleteLocalLibraryVersion = async (libraryName, libraryVersion) =>
1828
1831
  };
1829
1832
 
1830
1833
  export const deletePublishExtras = async (libraryName, libraryVersion) => {
1831
- if (showDebug) addDebugLog("deletePublishExtras", `libraryName: ${libraryName}, libraryVersion: ${libraryVersion}`, "");
1834
+ if (showDebug) addDebugLog("deletePublishExtras", `libraryName: ${libraryName}, libraryVersion: ${libraryVersion}` , "");
1832
1835
  // this function will delete LibraryName.zip file, so new one created by publish
1833
1836
  // check if .DS_store file exists in Library, if so delete it because causes issue with services
1834
1837
 
@@ -1852,7 +1855,7 @@ export const deletePublishExtras = async (libraryName, libraryVersion) => {
1852
1855
 
1853
1856
 
1854
1857
  export const cleanUp = async () => {
1855
- if (showDebug) addDebugLog("cleanUp", "", "");
1858
+ if (showDebug) addDebugLog("cleanUp", "", "");
1856
1859
  if (fs.existsSync('dist/components')) {
1857
1860
  fs.rm('dist/components', { recursive: true }, err => {
1858
1861
  if (err) {
@@ -1872,7 +1875,7 @@ export const cleanUp = async () => {
1872
1875
  };
1873
1876
 
1874
1877
  export const getComponentsConfigs = async (compDir = null) => {
1875
- if (showDebug) addDebugLog("getComponentsConfigs", "", "");
1878
+ if (showDebug) addDebugLog("getComponentsConfigs", "", "");
1876
1879
  const componentsList = await getComponents(compDir);
1877
1880
 
1878
1881
  let componentsConfigJSON = [];
@@ -1894,22 +1897,22 @@ export const getComponentsConfigs = async (compDir = null) => {
1894
1897
  }
1895
1898
  }
1896
1899
  return componentsConfigJSON;
1897
- };
1900
+ }
1898
1901
 
1899
1902
 
1900
1903
  export const createComponentsConfigFile = async (filePath, compDir) => {
1901
- if (showDebug) addDebugLog("createComponentsConfigFile", `filePath: ${filePath}`, "");
1904
+ if (showDebug) addDebugLog("createComponentsConfigFile", `filePath: ${filePath}`, "");
1902
1905
  const componentsConfigJSON = await getComponentsConfigs(compDir);
1903
1906
  const compConfgFile = join(filePath, COMPONENTS_CONFIG_FILE_NAME);
1904
1907
 
1905
1908
  // write out file
1906
- fs.writeFileSync(compConfgFile, JSON.stringify(componentsConfigJSON), { encoding: 'utf8', flag: 'w' });
1909
+ fs.writeFileSync(compConfgFile, JSON.stringify(componentsConfigJSON), { encoding: 'utf8',flag:'w' });
1907
1910
 
1908
1911
  };
1909
1912
 
1910
1913
 
1911
1914
  export const zipVersionAndArchive = async (orgLibName, version, currentDirectory = "") => {
1912
- if (showDebug) addDebugLog("zipVersionAndArchive", `orgLibName: ${orgLibName}, version: ${version}`, "");
1915
+ if (showDebug) addDebugLog("zipVersionAndArchive", `orgLibName: ${orgLibName}, version: ${version}`, "");
1913
1916
  // const srcDirectoryPath = await getSrcDirectoryPath();
1914
1917
  if (currentDirectory === "") {
1915
1918
  currentDirectory = process.cwd();
@@ -1922,7 +1925,7 @@ export const zipVersionAndArchive = async (orgLibName, version, currentDirectory
1922
1925
 
1923
1926
  // const configContent = Buffer.from(fs.readFileSync(configJson)).toString();
1924
1927
  const mainDirectory = process.cwd();
1925
- const archiveDirectory = join(mainDirectory, ARCHIVES_PATH, `${orgLibName}`, `${version}`);
1928
+ const archiveDirectory = join (mainDirectory, ARCHIVES_PATH, `${orgLibName}`, `${version}`);
1926
1929
  if (!fs.existsSync(archiveDirectory)) {
1927
1930
  fs.mkdirSync(archiveDirectory, { recursive: true });
1928
1931
  }
@@ -1961,13 +1964,13 @@ export const zipVersionAndArchive = async (orgLibName, version, currentDirectory
1961
1964
  // pipe archive data to the file
1962
1965
  archive.pipe(output);
1963
1966
 
1964
- output.on('end', function () {
1967
+ output.on('end', function() {
1965
1968
  console.log('Data has been drained');
1966
1969
  });
1967
1970
 
1968
1971
 
1969
1972
  // good practice to catch warnings (ie stat failures and other non-blocking errors)
1970
- archive.on('warning', function (err) {
1973
+ archive.on('warning', function(err) {
1971
1974
  if (err.code === 'ENOENT') {
1972
1975
  // log warning
1973
1976
  } else {
@@ -1977,7 +1980,7 @@ export const zipVersionAndArchive = async (orgLibName, version, currentDirectory
1977
1980
  });
1978
1981
 
1979
1982
  // good practice to catch this error explicitly
1980
- archive.on('error', function (err) {
1983
+ archive.on('error', function(err) {
1981
1984
  throw err;
1982
1985
  });
1983
1986
 
@@ -1991,7 +1994,7 @@ export const zipVersionAndArchive = async (orgLibName, version, currentDirectory
1991
1994
 
1992
1995
 
1993
1996
  export const zipVersionAndArchiveAndReturnBuffer = async (orgLibName, version, currentDirectory = "") => {
1994
- if (showDebug) addDebugLog("zipVersionAndArchive", `orgLibName: ${orgLibName}, version: ${version}`, "");
1997
+ if (showDebug) addDebugLog("zipVersionAndArchive", `orgLibName: ${orgLibName}, version: ${version}`, "");
1995
1998
  // const srcDirectoryPath = await getSrcDirectoryPath();
1996
1999
  if (currentDirectory === "") {
1997
2000
  currentDirectory = process.cwd();
@@ -2004,7 +2007,7 @@ export const zipVersionAndArchiveAndReturnBuffer = async (orgLibName, version, c
2004
2007
 
2005
2008
  // const configContent = Buffer.from(fs.readFileSync(configJson)).toString();
2006
2009
  const mainDirectory = process.cwd();
2007
- const archiveDirectory = join(mainDirectory, ARCHIVES_PATH, `${orgLibName}`, `${version}`);
2010
+ const archiveDirectory = join (mainDirectory, ARCHIVES_PATH, `${orgLibName}`, `${version}`);
2008
2011
  if (!fs.existsSync(archiveDirectory)) {
2009
2012
  fs.mkdirSync(archiveDirectory, { recursive: true });
2010
2013
  }
@@ -2044,13 +2047,13 @@ export const zipVersionAndArchiveAndReturnBuffer = async (orgLibName, version, c
2044
2047
  // pipe archive data to the file
2045
2048
  archive.pipe(output);
2046
2049
 
2047
- output.on('end', function () {
2050
+ output.on('end', function() {
2048
2051
  console.log('Data has been drained');
2049
2052
  });
2050
2053
 
2051
2054
 
2052
2055
  // good practice to catch warnings (ie stat failures and other non-blocking errors)
2053
- archive.on('warning', function (err) {
2056
+ archive.on('warning', function(err) {
2054
2057
  if (err.code === 'ENOENT') {
2055
2058
  // log warning
2056
2059
  } else {
@@ -2060,7 +2063,7 @@ export const zipVersionAndArchiveAndReturnBuffer = async (orgLibName, version, c
2060
2063
  });
2061
2064
 
2062
2065
  // good practice to catch this error explicitly
2063
- archive.on('error', function (err) {
2066
+ archive.on('error', function(err) {
2064
2067
  throw err;
2065
2068
  });
2066
2069
 
@@ -2069,19 +2072,19 @@ export const zipVersionAndArchiveAndReturnBuffer = async (orgLibName, version, c
2069
2072
  const zipBuffer = Buffer.concat(zipChunks);
2070
2073
  const zipContent = zipBuffer.toString('base64');
2071
2074
 
2072
- return { output, zipContent };
2075
+ return { output, zipContent};
2073
2076
 
2074
2077
  };
2075
2078
 
2076
- export const zipUnArchiveToTempAndReturnBuffer = async (orgLibName, version) => {
2079
+ export const zipUnArchiveToTempAndReturnBuffer = async(orgLibName, version) => {
2077
2080
 
2078
2081
  // unarchive to temp
2079
2082
  const currentDirectory = process.cwd();
2080
- const tempDirectory = join(currentDirectory, TEMP_PATH);
2083
+ const tempDirectory = join (currentDirectory, TEMP_PATH);
2081
2084
  const srcDirectoryPath = join(tempDirectory, "src");
2082
2085
 
2083
2086
  const archiveFileName = `${orgLibName}_${version}.arch.zip`;
2084
- const archiveDirectory = join(currentDirectory, ARCHIVES_PATH, `${orgLibName}`, `${version}`);
2087
+ const archiveDirectory = join (currentDirectory, ARCHIVES_PATH, `${orgLibName}`, `${version}`);
2085
2088
  const archFileName = join(archiveDirectory, archiveFileName);
2086
2089
 
2087
2090
  await unZipFromArchive(archFileName);
@@ -2115,13 +2118,13 @@ export const zipUnArchiveToTempAndReturnBuffer = async (orgLibName, version) =>
2115
2118
  // pipe archive data to the file
2116
2119
  archive.pipe(output);
2117
2120
 
2118
- output.on('end', function () {
2121
+ output.on('end', function() {
2119
2122
  console.log('Data has been drained');
2120
2123
  });
2121
2124
 
2122
2125
 
2123
2126
  // good practice to catch warnings (ie stat failures and other non-blocking errors)
2124
- archive.on('warning', function (err) {
2127
+ archive.on('warning', function(err) {
2125
2128
  if (err.code === 'ENOENT') {
2126
2129
  // log warning
2127
2130
  } else {
@@ -2131,7 +2134,7 @@ export const zipUnArchiveToTempAndReturnBuffer = async (orgLibName, version) =>
2131
2134
  });
2132
2135
 
2133
2136
  // good practice to catch this error explicitly
2134
- archive.on('error', function (err) {
2137
+ archive.on('error', function(err) {
2135
2138
  throw err;
2136
2139
  });
2137
2140
 
@@ -2140,13 +2143,13 @@ export const zipUnArchiveToTempAndReturnBuffer = async (orgLibName, version) =>
2140
2143
  const zipBuffer = Buffer.concat(zipChunks);
2141
2144
  const zipContent = zipBuffer.toString('base64');
2142
2145
 
2143
- return { output, zipContent };
2146
+ return { output, zipContent};
2144
2147
 
2145
2148
 
2146
- };
2149
+ }
2147
2150
 
2148
2151
  export const zipVersionAndArchiveCL = async (orgLibName, version, currentDirectory = "") => {
2149
- if (showDebug) addDebugLog("zipVersionAndArchiveCL", `orgLibName: ${orgLibName}, version: ${version}, currentDirectory: ${currentDirectory}`, "");
2152
+ if (showDebug) addDebugLog("zipVersionAndArchiveCL", `orgLibName: ${orgLibName}, version: ${version}, currentDirectory: ${currentDirectory}`, "");
2150
2153
  // const srcDirectoryPath = await getSrcDirectoryPath();
2151
2154
  if (currentDirectory === "") {
2152
2155
  currentDirectory = process.cwd();
@@ -2159,7 +2162,7 @@ export const zipVersionAndArchiveCL = async (orgLibName, version, currentDirecto
2159
2162
 
2160
2163
  // const configContent = Buffer.from(fs.readFileSync(configJson)).toString();
2161
2164
  const mainDirectory = process.cwd();
2162
- const archiveDirectory = join(mainDirectory, BIN_ARCHIVES_PATH);
2165
+ const archiveDirectory = join (mainDirectory, BIN_ARCHIVES_PATH);
2163
2166
  if (!fs.existsSync(archiveDirectory)) {
2164
2167
  fs.mkdirSync(archiveDirectory, { recursive: true });
2165
2168
  }
@@ -2185,13 +2188,13 @@ export const zipVersionAndArchiveCL = async (orgLibName, version, currentDirecto
2185
2188
  // pipe archive data to the file
2186
2189
  archive.pipe(output);
2187
2190
 
2188
- output.on('end', function () {
2191
+ output.on('end', function() {
2189
2192
  console.log('Data has been drained');
2190
2193
  });
2191
2194
 
2192
2195
 
2193
2196
  // good practice to catch warnings (ie stat failures and other non-blocking errors)
2194
- archive.on('warning', function (err) {
2197
+ archive.on('warning', function(err) {
2195
2198
  if (err.code === 'ENOENT') {
2196
2199
  // log warning
2197
2200
  } else {
@@ -2201,7 +2204,7 @@ export const zipVersionAndArchiveCL = async (orgLibName, version, currentDirecto
2201
2204
  });
2202
2205
 
2203
2206
  // good practice to catch this error explicitly
2204
- archive.on('error', function (err) {
2207
+ archive.on('error', function(err) {
2205
2208
  throw err;
2206
2209
  });
2207
2210
 
@@ -2212,14 +2215,14 @@ export const zipVersionAndArchiveCL = async (orgLibName, version, currentDirecto
2212
2215
  };
2213
2216
 
2214
2217
  export const unZipFromArchive = async (fileName) => {
2215
- if (showDebug) addDebugLog("unZipFromArchive", `fileName: ${fileName}`, "");
2218
+ if (showDebug) addDebugLog("unZipFromArchive", `fileName: ${fileName}`, "");
2216
2219
  await unarchive(fileName, TEMP_PATH);
2217
2220
  };
2218
2221
 
2219
2222
 
2220
2223
 
2221
2224
  export const updateComponentTaskConfig = async () => {
2222
- if (showDebug) addDebugLog("updateComponentTaskConfig", "", "");
2225
+ if (showDebug) addDebugLog("updateComponentTaskConfig", "", "");
2223
2226
  const currentDirectory = process.cwd();
2224
2227
  const tempDirectory = join(currentDirectory, TEMP_PATH);
2225
2228
 
@@ -2243,18 +2246,18 @@ export const updateComponentTaskConfig = async () => {
2243
2246
 
2244
2247
  // if we don't have a devServerPort, add the default
2245
2248
  if (originalContentsData["server-config"].devServerPort === undefined) {
2246
- originalContentsData["server-config"].devServerPort = "3030";
2249
+ originalContentsData["server-config"].devServerPort = "3030"
2247
2250
  }
2248
2251
 
2249
- fs.writeFileSync(currentConfigPath, JSON.stringify(originalContentsData, null, 4), { encoding: 'utf8', flag: 'w' });
2252
+ fs.writeFileSync(currentConfigPath, JSON.stringify(originalContentsData, null, 4), { encoding: 'utf8',flag:'w' });
2250
2253
 
2251
- };
2254
+ }
2252
2255
 
2253
2256
  export const restoreDependenciesFromPackage = async () => {
2254
- if (showDebug) addDebugLog("restoreDependenciesFromPackage", "", "");
2257
+ if (showDebug) addDebugLog("restoreDependenciesFromPackage", "", "");
2255
2258
  const currentDirectory = process.cwd();
2256
2259
  const tempDirectory = join(currentDirectory, TEMP_PATH);
2257
- const tempPackagePath = join(tempDirectory, PACKAGE_JSON_FILENAME);
2260
+ const tempPackagePath = join (tempDirectory, PACKAGE_JSON_FILENAME);
2258
2261
  const currentPackagePath = join(currentDirectory, PACKAGE_JSON_FILENAME);
2259
2262
 
2260
2263
  let retrievedPackageData;
@@ -2267,7 +2270,7 @@ export const restoreDependenciesFromPackage = async () => {
2267
2270
  retrievedPackageData = fs.readFileSync(tempPackagePath);
2268
2271
  }
2269
2272
  catch (ex) {
2270
- console.log(chalk.red(`\nUnable to retrieve package.json from store.`));
2273
+ console.log(chalk.red(`\nUnable to retrieve package.json from store.`))
2271
2274
  process.exit(1);
2272
2275
  }
2273
2276
 
@@ -2275,7 +2278,7 @@ export const restoreDependenciesFromPackage = async () => {
2275
2278
  currentPackageData = fs.readFileSync(currentPackagePath);
2276
2279
  }
2277
2280
  catch (ex) {
2278
- console.log(chalk.red(`\nUnable to retrieve current package.json.`));
2281
+ console.log(chalk.red(`\nUnable to retrieve current package.json.`))
2279
2282
  process.exit(1);
2280
2283
  }
2281
2284
 
@@ -2313,7 +2316,7 @@ export const restoreDependenciesFromPackage = async () => {
2313
2316
  retrievedTemplateData = fs.readFileSync(packageTemplateJsonPath);
2314
2317
  }
2315
2318
  catch (ex) {
2316
- console.log($chalk.red(`\nUnable to retrieve package.json.mustache from code.`));
2319
+ console.log($chalk.red(`\nUnable to retrieve package.json.mustache from code.`))
2317
2320
  process.exit(1);
2318
2321
  }
2319
2322
  const tData = JSON.parse(retrievedTemplateData);
@@ -2335,167 +2338,167 @@ export const restoreDependenciesFromPackage = async () => {
2335
2338
 
2336
2339
 
2337
2340
  // update current package json file
2338
- fs.writeFileSync(currentPackagePath, JSON.stringify(rData, null, 4), { encoding: 'utf8', flag: 'w' });
2341
+ fs.writeFileSync(currentPackagePath, JSON.stringify(rData, null, 4), { encoding: 'utf8',flag:'w' });
2339
2342
 
2340
2343
 
2341
- };
2344
+ }
2342
2345
 
2343
2346
 
2344
2347
  export const restoreDependenciesFromTemplate = async () => {
2345
2348
  if (showDebug) addDebugLog("restoreDependenciesFromTemplate", "", "");
2346
- const currentDirectory = process.cwd();
2347
- const currentPackagePath = join(currentDirectory, PACKAGE_JSON_FILENAME);
2349
+ const currentDirectory = process.cwd();
2350
+ const currentPackagePath = join(currentDirectory, PACKAGE_JSON_FILENAME);
2348
2351
 
2349
- let currentPackageData;
2352
+ let currentPackageData;
2350
2353
 
2351
- // reset
2352
- haveDependencyDifference = true;
2354
+ // reset
2355
+ haveDependencyDifference = true;
2353
2356
 
2354
- try {
2355
- currentPackageData = fs.readFileSync(currentPackagePath);
2356
- }
2357
- catch (ex) {
2358
- console.log(chalk.red(`\nUnable to retrieve current package.json.`));
2359
- process.exit(1);
2360
- }
2357
+ try {
2358
+ currentPackageData = fs.readFileSync(currentPackagePath);
2359
+ }
2360
+ catch (ex) {
2361
+ console.log(chalk.red(`\nUnable to retrieve current package.json.`))
2362
+ process.exit(1);
2363
+ }
2361
2364
 
2362
2365
 
2363
- let cData = JSON.parse(currentPackageData);
2366
+ let cData = JSON.parse(currentPackageData);
2364
2367
 
2365
2368
 
2366
- // we can't loose devDep that is part of install, so go get the template mustache and push
2367
- // those in, replacing any changes there, but allowing additional, an keeping it updated
2368
- // so won't loose new function if an old archive
2369
- const initDir = join(currentDirectory, "node_modules", "@pega", "custom-dx-components", "src", "tasks", "init");
2370
- const templateDir = join(initDir, "template");
2371
- const packageTemplateJsonPath = path.join(templateDir, 'package.json.mustache');
2372
- let retrievedTemplateData;
2373
- try {
2374
- retrievedTemplateData = fs.readFileSync(packageTemplateJsonPath);
2375
- }
2376
- catch (ex) {
2377
- console.log($chalk.red(`\nUnable to retrieve package.json.mustache from code.`));
2378
- process.exit(1);
2379
- }
2380
- const tData = JSON.parse(retrievedTemplateData);
2381
- const tDevDep = tData.devDependencies;
2382
- const tDep = tData.dependencies;
2369
+ // we can't loose devDep that is part of install, so go get the template mustache and push
2370
+ // those in, replacing any changes there, but allowing additional, an keeping it updated
2371
+ // so won't loose new function if an old archive
2372
+ const initDir = join(currentDirectory, "node_modules", "@pega", "custom-dx-components", "src", "tasks", "init");
2373
+ const templateDir = join(initDir, "template");
2374
+ const packageTemplateJsonPath = path.join(templateDir, 'package.json.mustache');
2375
+ let retrievedTemplateData;
2376
+ try {
2377
+ retrievedTemplateData = fs.readFileSync(packageTemplateJsonPath);
2378
+ }
2379
+ catch (ex) {
2380
+ console.log($chalk.red(`\nUnable to retrieve package.json.mustache from code.`))
2381
+ process.exit(1);
2382
+ }
2383
+ const tData = JSON.parse(retrievedTemplateData);
2384
+ const tDevDep = tData.devDependencies;
2385
+ const tDep = tData.dependencies;
2383
2386
 
2384
- for (const [key, value] of Object.entries(tDevDep)) {
2385
- cData.devDependencies[key] = value;
2386
- }
2387
+ for (const [key, value] of Object.entries(tDevDep)) {
2388
+ cData.devDependencies[key] = value;
2389
+ }
2387
2390
 
2388
- for (const [key, value] of Object.entries(tDep)) {
2389
- cData.dependencies[key] = value;
2390
- }
2391
+ for (const [key, value] of Object.entries(tDep)) {
2392
+ cData.dependencies[key] = value;
2393
+ }
2391
2394
 
2392
2395
 
2393
- // update current package json file
2394
- fs.writeFileSync(currentPackagePath, JSON.stringify(cData, null, 4), { encoding: 'utf8', flag: 'w' });
2396
+ // update current package json file
2397
+ fs.writeFileSync(currentPackagePath, JSON.stringify(cData, null, 4), { encoding: 'utf8',flag:'w' });
2395
2398
 
2396
2399
 
2397
- };
2400
+ }
2398
2401
 
2399
2402
 
2400
2403
  export const restoreDependenciesFromPackage_old = async () => {
2401
2404
  if (showDebug) addDebugLog("restoreDependenciesFromPackage", "", "");
2402
- const currentDirectory = process.cwd();
2403
- const tempDirectory = join(currentDirectory, TEMP_PATH);
2404
- const tempPackagePath = join(tempDirectory, PACKAGE_JSON_FILENAME);
2405
- const currentPackagePath = join(currentDirectory, PACKAGE_JSON_FILENAME);
2405
+ const currentDirectory = process.cwd();
2406
+ const tempDirectory = join(currentDirectory, TEMP_PATH);
2407
+ const tempPackagePath = join (tempDirectory, PACKAGE_JSON_FILENAME);
2408
+ const currentPackagePath = join(currentDirectory, PACKAGE_JSON_FILENAME);
2406
2409
 
2407
- let retrievedPackageData;
2408
- let currentPackageData;
2410
+ let retrievedPackageData;
2411
+ let currentPackageData;
2409
2412
 
2410
- // reset
2411
- haveDependencyDifference = false;
2413
+ // reset
2414
+ haveDependencyDifference = false;
2412
2415
 
2413
- try {
2414
- retrievedPackageData = fs.readFileSync(tempPackagePath);
2415
- }
2416
- catch (ex) {
2417
- console.log($chalk.red(`\nUnable to retrieve package.json from store.`));
2418
- process.exit(1);
2419
- }
2416
+ try {
2417
+ retrievedPackageData = fs.readFileSync(tempPackagePath);
2418
+ }
2419
+ catch (ex) {
2420
+ console.log($chalk.red(`\nUnable to retrieve package.json from store.`))
2421
+ process.exit(1);
2422
+ }
2420
2423
 
2421
- try {
2422
- currentPackageData = fs.readFileSync(currentPackagePath);
2423
- }
2424
- catch (ex) {
2425
- console.log($chalk.red(`\nUnable to retrieve current package.json.`));
2426
- process.exit(1);
2427
- }
2424
+ try {
2425
+ currentPackageData = fs.readFileSync(currentPackagePath);
2426
+ }
2427
+ catch (ex) {
2428
+ console.log($chalk.red(`\nUnable to retrieve current package.json.`))
2429
+ process.exit(1);
2430
+ }
2428
2431
 
2429
2432
 
2430
- const rData = JSON.parse(retrievedPackageData);
2431
- let cData = JSON.parse(currentPackageData);
2433
+ const rData = JSON.parse(retrievedPackageData);
2434
+ let cData = JSON.parse(currentPackageData);
2432
2435
 
2433
- // now keep current package.json, but replace devDependencies and dependencies.
2434
- const sDep = JSON.stringify(rData.dependencies);
2435
- const sDevDep = JSON.stringify(rData.devDependencies);
2436
+ // now keep current package.json, but replace devDependencies and dependencies.
2437
+ const sDep = JSON.stringify(rData.dependencies);
2438
+ const sDevDep = JSON.stringify(rData.devDependencies);
2436
2439
 
2437
- const sCurDep = JSON.stringify(cData.dependencies);
2438
- const sCurDevDep = JSON.stringify(cData.devDependencies);
2440
+ const sCurDep = JSON.stringify(cData.dependencies);
2441
+ const sCurDevDep = JSON.stringify(cData.devDependencies);
2439
2442
 
2440
- // any changes, update haveDependencyDifference variable
2441
- if (sDep != sCurDep) {
2442
- haveDependencyDifference = true;
2443
- }
2444
- else if (sDevDep != sCurDevDep) {
2445
- haveDependencyDifference = true;
2446
- }
2443
+ // any changes, update haveDependencyDifference variable
2444
+ if (sDep != sCurDep) {
2445
+ haveDependencyDifference = true;
2446
+ }
2447
+ else if (sDevDep != sCurDevDep) {
2448
+ haveDependencyDifference = true;
2449
+ }
2447
2450
 
2448
2451
 
2449
- cData.dependencies = JSON.parse(sDep);
2450
- cData.devDependencies = JSON.parse(sDevDep);
2452
+ cData.dependencies = JSON.parse(sDep);
2453
+ cData.devDependencies = JSON.parse(sDevDep);
2451
2454
 
2452
- // we can't loose devDep that is part of install, so go get the template mustache and push
2453
- // those in, replacing any changes there, but allowing additional, an keeping it updated
2454
- // so won't loose new function if an old archive
2455
- const initDir = join(currentDirectory, "node_modules", "@pega", "custom-dx-components", "src", "tasks", "init");
2456
- const templateDir = join(initDir, "template");
2457
- const packageTemplateJsonPath = path.join(templateDir, 'package.json.mustache');
2458
- let retrievedTemplateData;
2459
- try {
2460
- retrievedTemplateData = fs.readFileSync(packageTemplateJsonPath);
2461
- }
2462
- catch (ex) {
2463
- console.log($chalk.red(`\nUnable to retrieve package.json.mustache from code.`));
2464
- process.exit(1);
2465
- }
2466
- const tData = JSON.parse(retrievedTemplateData);
2467
- const tDevDep = tData.devDependencies;
2468
- for (const [key, value] of Object.entries(tDevDep)) {
2469
- cData.devDependencies[key] = value;
2470
- }
2455
+ // we can't loose devDep that is part of install, so go get the template mustache and push
2456
+ // those in, replacing any changes there, but allowing additional, an keeping it updated
2457
+ // so won't loose new function if an old archive
2458
+ const initDir = join(currentDirectory, "node_modules", "@pega", "custom-dx-components", "src", "tasks", "init");
2459
+ const templateDir = join(initDir, "template");
2460
+ const packageTemplateJsonPath = path.join(templateDir, 'package.json.mustache');
2461
+ let retrievedTemplateData;
2462
+ try {
2463
+ retrievedTemplateData = fs.readFileSync(packageTemplateJsonPath);
2464
+ }
2465
+ catch (ex) {
2466
+ console.log($chalk.red(`\nUnable to retrieve package.json.mustache from code.`))
2467
+ process.exit(1);
2468
+ }
2469
+ const tData = JSON.parse(retrievedTemplateData);
2470
+ const tDevDep = tData.devDependencies;
2471
+ for (const [key, value] of Object.entries(tDevDep)) {
2472
+ cData.devDependencies[key] = value;
2473
+ }
2471
2474
 
2472
2475
 
2473
- // update current package json file
2474
- fs.writeFileSync(currentPackagePath, JSON.stringify(cData, null, 4), { encoding: 'utf8', flag: 'w' });
2476
+ // update current package json file
2477
+ fs.writeFileSync(currentPackagePath, JSON.stringify(cData, null, 4), { encoding: 'utf8',flag:'w' });
2475
2478
 
2476
2479
 
2477
- };
2480
+ }
2478
2481
 
2479
2482
  export const getHaveDependencyDifference = () => {
2480
- if (showDebug) addDebugLog("getHaveDependencyDifference", ``, "");
2483
+ if (showDebug) addDebugLog("getHaveDependencyDifference", ``, "");
2481
2484
  return haveDependencyDifference;
2482
- };
2485
+ }
2483
2486
 
2484
2487
  export const restoreFromArchive = async (fileName, orgLibName, version) => {
2485
- if (showDebug) addDebugLog("restoreFromArchive", `fileName: ${fileName}, orgLibName: ${orgLibName}, version: ${version}`, "");
2488
+ if (showDebug) addDebugLog("restoreFromArchive", `fileName: ${fileName}, orgLibName: ${orgLibName}, version: ${version}`, "");
2486
2489
  const currentDirectory = process.cwd();
2487
2490
  const tempDirectory = join(currentDirectory, TEMP_PATH);
2488
- const archiveDirectory = join(currentDirectory, ARCHIVES_PATH, `${orgLibName}`, `${version}`);
2491
+ const archiveDirectory = join (currentDirectory, ARCHIVES_PATH, `${orgLibName}`, `${version}`);
2489
2492
  const archFileName = join(archiveDirectory, fileName);
2490
2493
 
2491
2494
 
2492
2495
  if (!fs.existsSync(archiveDirectory)) {
2493
- throw new Error(`Archive ${orgLibName}/${version} does NOT exist.`);
2496
+ throw new Error (`Archive ${orgLibName}/${version} does NOT exist.`);
2494
2497
  }
2495
2498
 
2496
2499
  await unZipFromArchive(archFileName);
2497
2500
 
2498
- const tempPackagePath = join(tempDirectory, PACKAGE_JSON_FILENAME);
2501
+ const tempPackagePath = join (tempDirectory, PACKAGE_JSON_FILENAME);
2499
2502
  const currentPackagePath = join(currentDirectory, PACKAGE_JSON_FILENAME);
2500
2503
  const tempDirectoryComponents = join(tempDirectory, "src");
2501
2504
  const currentComponentsPath = join(currentDirectory, "src");
@@ -2512,11 +2515,11 @@ export const restoreFromArchive = async (fileName, orgLibName, version) => {
2512
2515
  await restoreDependenciesFromPackage();
2513
2516
 
2514
2517
  // remove current components
2515
- fs.rmSync(currentComponentsPath, { recursive: true, force: true, maxRetries: 2 });
2518
+ fs.rmSync(currentComponentsPath, { recursive: true, force: true, maxRetries: 2 });
2516
2519
 
2517
2520
  if (fs.existsSync(currentComponentsPath)) {
2518
2521
  // try another round of rm
2519
- fs.rmSync(currentComponentsPath, { recursive: true, force: true, maxRetries: 2 });
2522
+ fs.rmSync(currentComponentsPath, { recursive: true, force: true, maxRetries: 2 });
2520
2523
 
2521
2524
  if (fs.existsSync(currentComponentsPath)) {
2522
2525
  // still an issue
@@ -2532,29 +2535,29 @@ export const restoreFromArchive = async (fileName, orgLibName, version) => {
2532
2535
  // copy temp src/components
2533
2536
  if (fs.existsSync(tempDirectoryComponents)) {
2534
2537
 
2535
- fs.cpSync(tempDirectoryComponents, currentComponentsPath, { recursive: true, force: true });
2536
- }
2537
- else {
2538
- // nothing was archived (no src/components)
2539
- // so make a src/components if doesn't exist
2540
- if (!fs.existsSync(currentComponentsPath)) {
2541
- fs.mkdirSync(currentComponentsPath, { "recursive": true });
2542
- }
2543
- }
2538
+ fs.cpSync(tempDirectoryComponents, currentComponentsPath, { recursive: true, force: true });
2539
+ }
2540
+ else {
2541
+ // nothing was archived (no src/components)
2542
+ // so make a src/components if doesn't exist
2543
+ if (!fs.existsSync(currentComponentsPath)) {
2544
+ fs.mkdirSync(currentComponentsPath, { "recursive" : true});
2545
+ }
2546
+ }
2544
2547
 
2545
2548
 
2546
- // remove temp (windows not working well with "sync", can be async, since as long as deleted, fine)
2547
- fs.rmSync(tempDirectory, { recursive: true, force: true, maxRetries: 5 }, () => { });
2549
+ // remove temp (windows not working well with "sync", can be async, since as long as deleted, fine)
2550
+ fs.rmSync(tempDirectory, { recursive: true, force: true, maxRetries: 5 }, () => {});
2548
2551
 
2549
2552
  };
2550
2553
 
2551
2554
  export const clearSrcComponentsDirectory = async () => {
2552
- if (showDebug) addDebugLog("clearSrcComponentsDirectory", ``, "");
2555
+ if (showDebug) addDebugLog("clearSrcComponentsDirectory", ``, "");
2553
2556
  const currentDirectory = process.cwd();
2554
2557
  const currentComponentsPath = join(currentDirectory, "src", "components");
2555
2558
 
2556
2559
  // remove current components
2557
- fs.rmSync(currentComponentsPath, { recursive: true, force: true, maxRetries: 2 });
2560
+ fs.rmSync(currentComponentsPath, { recursive: true, force: true, maxRetries: 2 });
2558
2561
 
2559
2562
  // create blank src
2560
2563
  fs.mkdirSync(currentComponentsPath, { recursive: true });
@@ -2568,23 +2571,23 @@ export const isHiddenFile = (fileName) => {
2568
2571
  return false;
2569
2572
  };
2570
2573
 
2571
- export const getCurrentOrgLib = () => {
2574
+ export const getCurrentOrgLib = () =>{
2572
2575
  return defaultConfigs.currentOrgLib;
2573
2576
  };
2574
2577
 
2575
2578
  export const hasArchives = async () => {
2576
- if (showDebug) addDebugLog("hasArchives", "call", "");
2579
+ if (showDebug) addDebugLog("hasArchives", "call", "");
2577
2580
  const currentDirectory = process.cwd();
2578
- const archiveDirectory = join(currentDirectory, ARCHIVES_PATH);
2581
+ const archiveDirectory = join (currentDirectory, ARCHIVES_PATH);
2579
2582
  const hasArc = fs.existsSync(archiveDirectory);
2580
- if (showDebug) addDebugLog("hasArchives", `${hasArc}`, "");
2583
+ if (showDebug) addDebugLog("hasArchives", `${hasArc}`, "");
2581
2584
  return hasArc;
2582
2585
  };
2583
2586
 
2584
2587
  export const deleteArchives = async () => {
2585
- if (showDebug) addDebugLog("deleteArchives", ``, "");
2588
+ if (showDebug) addDebugLog("deleteArchives", ``, "");
2586
2589
  const currentDirectory = process.cwd();
2587
- const archiveDirectory = join(currentDirectory, ARCHIVES_PATH);
2590
+ const archiveDirectory = join (currentDirectory, ARCHIVES_PATH);
2588
2591
  const hasArc = fs.existsSync(archiveDirectory);
2589
2592
 
2590
2593
  if (hasArc) {
@@ -2593,11 +2596,11 @@ export const deleteArchives = async () => {
2593
2596
  } catch (err) {
2594
2597
  }
2595
2598
  }
2596
- };
2599
+ }
2597
2600
 
2598
2601
  export const checkLibraryAndArchives = async () => {
2599
- if (showDebug) addDebugLog("checkLibraryAndArchives", ``, "");
2600
- const isLibraryBased = getLibraryBased();
2602
+ if (showDebug) addDebugLog("checkLibraryAndArchives", ``, "");
2603
+ const isLibraryBased = getLibraryBased();
2601
2604
  const hasArch = await hasArchives();
2602
2605
 
2603
2606
  if (isLibraryBased && !hasArch) {
@@ -2608,7 +2611,7 @@ export const checkLibraryAndArchives = async () => {
2608
2611
  };
2609
2612
 
2610
2613
  export const hasLibraryAndVersion = async (libraryName, version, devBuild) => {
2611
- if (showDebug) addDebugLog("hasLibraryAndVersion", `libraryName: ${libraryName}, version: ${version}, devBuild: ${devBuild}`, "");
2614
+ if (showDebug) addDebugLog("hasLibraryAndVersion", `libraryName: ${libraryName}, version: ${version}, devBuild: ${devBuild}`, "");
2612
2615
 
2613
2616
  const orgLib = getConfigDefaults();
2614
2617
  const currentOrgLib = `${orgLib.organization}_${libraryName}`;
@@ -2628,9 +2631,9 @@ export const hasLibraryAndVersion = async (libraryName, version, devBuild) => {
2628
2631
  };
2629
2632
 
2630
2633
  export const getLibraryArchiveDirectories = async (currentOrgLib = "") => {
2631
- if (showDebug) addDebugLog("getLibraryArchiveDirectories", "", "");
2634
+ if (showDebug) addDebugLog("getLibraryArchiveDirectories", "", "");
2632
2635
  const currentDirectory = process.cwd();
2633
- const archiveDirectory = join(currentDirectory, ARCHIVES_PATH);
2636
+ const archiveDirectory = join (currentDirectory, ARCHIVES_PATH);
2634
2637
 
2635
2638
 
2636
2639
  if (!fs.existsSync(archiveDirectory)) {
@@ -2638,18 +2641,18 @@ export const getLibraryArchiveDirectories = async (currentOrgLib = "") => {
2638
2641
  }
2639
2642
 
2640
2643
  return fs
2641
- .readdirSync(archiveDirectory, { withFileTypes: true })
2642
- .filter(dirent => dirent.isDirectory() && (dirent.name != currentOrgLib))
2643
- .map(dirent => dirent.name);
2644
+ .readdirSync(archiveDirectory, { withFileTypes: true })
2645
+ .filter(dirent => dirent.isDirectory() && (dirent.name != currentOrgLib) )
2646
+ .map(dirent => dirent.name);
2644
2647
  };
2645
2648
 
2646
2649
 
2647
2650
 
2648
2651
  export const getLibraryArchivesVersions = async (orgLibName, currentVersion) => {
2649
- if (showDebug) addDebugLog("getLibraryArchivesVersions", `orgLibName: ${orgLibName}`, "");
2652
+ if (showDebug) addDebugLog("getLibraryArchivesVersions", `orgLibName: ${orgLibName}`, "");
2650
2653
 
2651
2654
  const currentDirectory = process.cwd();
2652
- const archiveDirectory = join(currentDirectory, ARCHIVES_PATH, `${orgLibName}`);
2655
+ const archiveDirectory = join (currentDirectory, ARCHIVES_PATH, `${orgLibName}`);
2653
2656
 
2654
2657
  if (!fs.existsSync(archiveDirectory)) {
2655
2658
  return [];
@@ -2657,17 +2660,17 @@ export const getLibraryArchivesVersions = async (orgLibName, currentVersion) =>
2657
2660
 
2658
2661
  return fs
2659
2662
  .readdirSync(archiveDirectory, { withFileTypes: true })
2660
- .filter(dirent => dirent.isDirectory() && dirent.name != currentVersion)
2663
+ .filter(dirent => dirent.isDirectory() && dirent.name != currentVersion )
2661
2664
  .map(dirent => dirent.name);
2662
2665
 
2663
2666
 
2664
2667
 
2665
2668
  };
2666
2669
 
2667
- export const deleteLocalArchiveLibrary = async (libraryName) => {
2668
- if (showDebug) addDebugLog("deleteLocalArchiveLibrary", `libraryName: ${libraryName}`, "");
2670
+ export const deleteLocalArchiveLibrary = async(libraryName) => {
2671
+ if (showDebug) addDebugLog("deleteLocalArchiveLibrary", `libraryName: ${libraryName}`, "");
2669
2672
  const currentDirectory = process.cwd();
2670
- const archiveDirectory = join(currentDirectory, ARCHIVES_PATH, libraryName);
2673
+ const archiveDirectory = join (currentDirectory, ARCHIVES_PATH, libraryName);
2671
2674
 
2672
2675
  try {
2673
2676
  fs.rmSync(archiveDirectory, { recursive: true });
@@ -2680,17 +2683,17 @@ export const deleteLocalArchiveLibrary = async (libraryName) => {
2680
2683
  // check if no other libraries, the remove /store
2681
2684
  const archList = getLibraryArchiveDirectories();
2682
2685
  if (archList.length === 0) {
2683
- const archPath = join(currentDirectory, ARCHIVES_PATH);
2686
+ const archPath = join (currentDirectory, ARCHIVES_PATH);
2684
2687
 
2685
- fs.rmSync(archPath, { recursive: true });
2688
+ fs.rmSync(archPath, { recursive : true});
2686
2689
  }
2687
2690
 
2688
- };
2691
+ }
2689
2692
 
2690
- export const deleteLocalArchiveLibraryVersion = async (libraryName, version) => {
2691
- if (showDebug) addDebugLog("deleteLocalArchiveLibraryVersion", `libraryName: ${libraryName}, version: ${version}`, "");
2693
+ export const deleteLocalArchiveLibraryVersion = async(libraryName, version) => {
2694
+ if (showDebug) addDebugLog("deleteLocalArchiveLibraryVersion", `libraryName: ${libraryName}, version: ${version}`, "");
2692
2695
  const currentDirectory = process.cwd();
2693
- const archiveDirectory = join(currentDirectory, ARCHIVES_PATH, libraryName, version);
2696
+ const archiveDirectory = join (currentDirectory, ARCHIVES_PATH, libraryName, version);
2694
2697
 
2695
2698
  try {
2696
2699
  fs.rmSync(archiveDirectory, { recursive: true });
@@ -2703,45 +2706,45 @@ export const deleteLocalArchiveLibraryVersion = async (libraryName, version) =>
2703
2706
  // throw new Error(`No such file ${libraryName}/${version}`);
2704
2707
  }
2705
2708
 
2706
- };
2709
+ }
2707
2710
 
2708
- export const cleanUpTemp = async () => {
2709
- if (showDebug) addDebugLog("cleanUpTemp", ``, "");
2711
+ export const cleanUpTemp = async() => {
2712
+ if (showDebug) addDebugLog("cleanUpTemp", ``, "");
2710
2713
  const currentDirectory = process.cwd();
2711
- const tempDirectory = join(currentDirectory, TEMP_PATH);
2714
+ const tempDirectory = join (currentDirectory, TEMP_PATH);
2712
2715
 
2713
2716
  if (fs.existsSync(tempDirectory)) {
2714
2717
  fs.rmSync(tempDirectory, { recursive: true });
2715
2718
  }
2716
2719
 
2717
- };
2720
+ }
2718
2721
 
2719
2722
 
2720
- export const getJestFunctionalTestList = async (whichTests) => {
2721
- if (showDebug) addDebugLog("getJestFunctionalTestList", ``, "");
2723
+ export const getJestFunctionalTestList = async(whichTests) => {
2724
+ if (showDebug) addDebugLog("getJestFunctionalTestList", ``, "");
2722
2725
  const functionalDir = path.join(path.resolve(), JEST_TESTS_FUNCTIONAL_PATH);
2723
2726
  const libFilter = "localLib";
2724
2727
 
2725
2728
  switch (whichTests) {
2726
- case "ALL":
2729
+ case "ALL" :
2727
2730
  return fs
2728
- .readdirSync(functionalDir, { withFileTypes: true })
2729
- .filter(dirent => !dirent.isDirectory())
2730
- .map(dirent => dirent.name);
2731
+ .readdirSync(functionalDir, { withFileTypes: true })
2732
+ .filter(dirent => !dirent.isDirectory() )
2733
+ .map(dirent => dirent.name);
2731
2734
  case "Original":
2732
2735
  return fs
2733
- .readdirSync(functionalDir, { withFileTypes: true })
2734
- .filter(dirent => !dirent.isDirectory() && !dirent.name.startsWith(libFilter))
2735
- .map(dirent => dirent.name);
2736
- case "Library":
2736
+ .readdirSync(functionalDir, { withFileTypes: true })
2737
+ .filter(dirent => !dirent.isDirectory() && !dirent.name.startsWith(libFilter))
2738
+ .map(dirent => dirent.name);
2739
+ case "Library" :
2737
2740
  return fs
2738
- .readdirSync(functionalDir, { withFileTypes: true })
2739
- .filter(dirent => !dirent.isDirectory() && dirent.name.startsWith(libFilter))
2740
- .map(dirent => dirent.name);
2741
+ .readdirSync(functionalDir, { withFileTypes: true })
2742
+ .filter(dirent => !dirent.isDirectory() && dirent.name.startsWith(libFilter))
2743
+ .map(dirent => dirent.name);
2741
2744
  }
2742
2745
 
2743
2746
 
2744
- };
2747
+ }
2745
2748
 
2746
2749
  export const getSubTypeLabel = (type, subtype) => {
2747
2750
  const subTypeList = COMPONENT_SCHEMA.subtype;
@@ -2755,7 +2758,7 @@ export const getSubTypeLabel = (type, subtype) => {
2755
2758
  }
2756
2759
 
2757
2760
  return "";
2758
- };
2761
+ }
2759
2762
 
2760
2763
  export const getMaxComponentNameCount = () => {
2761
2764
  let count = MAX_RFT_CHARS;
@@ -2768,12 +2771,28 @@ export const getMaxComponentNameCount = () => {
2768
2771
 
2769
2772
  return count;
2770
2773
 
2771
- };
2774
+ }
2775
+
2776
+ export const getStandaloneMaxComponentNameCount = () => {
2777
+ let count = MAX_RFT_CHARS;
2778
+ const configDef = getConfigDefaults();
2779
+ const orgLibCount = configDef.currentOrgLib.length + 1;
2780
+
2781
+ count = count - orgLibCount; // 9 chars for trailing hash
2782
+
2783
+ return count;
2784
+
2785
+ }
2772
2786
 
2773
2787
  export const getMaxPrefixCount = () => {
2774
2788
  // TwoColumnDetails is 16 chars
2775
2789
  return (getMaxComponentNameCount() - 16);
2776
- };
2790
+ }
2791
+
2792
+ export const getStandaloneMaxPrefixCount = () => {
2793
+ // TwoColumnDetails is 16 chars
2794
+ return (getStandaloneMaxComponentNameCount() - 16);
2795
+ }
2777
2796
 
2778
2797
  export const isComponentValidLength = (componentKey) => {
2779
2798
  const configDef = getConfigDefaults();
@@ -2783,12 +2802,7 @@ export const isComponentValidLength = (componentKey) => {
2783
2802
  }
2784
2803
 
2785
2804
  return false;
2786
- };
2787
-
2788
- export const emptyDirSync = dir => (
2789
- fs.rmSync(dir, { recursive: true, force: true }),
2790
- fs.mkdirSync(dir, { recursive: true })
2791
- );
2805
+ }
2792
2806
 
2793
2807
  // init
2794
2808
  await forceDefaultsUpdate();