@pega/custom-dx-components 25.1.10-alpha-0.13 → 25.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/README.md +9 -2
  2. package/package.json +4 -4
  3. package/src/tasks/build-comp/index.js +1 -1
  4. package/src/tasks/build-jest-assets/index.js +1 -1
  5. package/src/tasks/build-lib/helper.js +1 -1
  6. package/src/tasks/create/templates/Launchpad/Field/Text-Phone/config.json.mustache +146 -0
  7. package/src/tasks/create/templates/Launchpad/Field/Text-Phone/demo.stories.tsx.mustache +61 -0
  8. package/src/tasks/create/templates/Launchpad/Field/Text-Phone/demo.test.tsx.mustache +23 -0
  9. package/src/tasks/create/templates/Launchpad/Field/Text-Phone/event-utils.ts.mustache +18 -0
  10. package/src/tasks/create/templates/Launchpad/Field/Text-Phone/index.tsx.mustache +246 -0
  11. package/src/tasks/create/templates/Launchpad/Field/Text-Phone/mock.ts.mustache +40 -0
  12. package/src/tasks/create/templates/Launchpad/Field/Text-Phone/styles.ts.mustache +8 -0
  13. package/src/tasks/create/templates/Launchpad/Template/FORM/DefaultForm.svg +29 -0
  14. package/src/tasks/create/templates/Launchpad/Template/FORM/DetailsRender.tsx.mustache +59 -0
  15. package/src/tasks/create/templates/Launchpad/Template/FORM/config.json.mustache +45 -0
  16. package/src/tasks/create/templates/Launchpad/Template/FORM/demo.stories.tsx.mustache +255 -0
  17. package/src/tasks/create/templates/Launchpad/Template/FORM/demo.test.tsx.mustache +40 -0
  18. package/src/tasks/create/templates/Launchpad/Template/FORM/index.tsx.mustache +75 -0
  19. package/src/tasks/create/templates/Launchpad/Template/FORM/mock.ts.mustache +135 -0
  20. package/src/tasks/create/templates/Launchpad/Template/FORM/styles.ts.mustache +8 -0
  21. package/src/tasks/create/templates/Launchpad/Template/FORM-region/DetailsRender.tsx.mustache +59 -0
  22. package/src/tasks/create/templates/Launchpad/Template/FORM-region/TwoColumn.svg +38 -0
  23. package/src/tasks/create/templates/Launchpad/Template/FORM-region/config.json.mustache +27 -0
  24. package/src/tasks/create/templates/Launchpad/Template/FORM-region/demo.stories.tsx.mustache +272 -0
  25. package/src/tasks/create/templates/Launchpad/Template/FORM-region/demo.test.tsx.mustache +56 -0
  26. package/src/tasks/create/templates/Launchpad/Template/FORM-region/index.tsx.mustache +80 -0
  27. package/src/tasks/create/templates/Launchpad/Template/FORM-region/mock.ts.mustache +141 -0
  28. package/src/tasks/create/templates/Launchpad/Template/FORM-region/styles.ts.mustache +8 -0
  29. package/src/tasks/create-lib/index.js +3 -3
  30. package/src/tasks/create-version/index.js +1 -1
  31. package/src/tasks/delete/helper.js +1 -1
  32. package/src/tasks/delete-all/helper.js +2 -2
  33. package/src/tasks/delete-pub/helper.js +3 -3
  34. package/src/tasks/delete-pub/index.js +3 -3
  35. package/src/tasks/export-archive/index.js +7 -7
  36. package/src/tasks/import-archive/helper.js +6 -6
  37. package/src/tasks/import-archive/index.js +8 -8
  38. package/src/tasks/import-comp/index.js +1 -1
  39. package/src/tasks/init/template/README.md +9 -2
  40. package/src/tasks/init/template/package.json.mustache +7 -7
  41. package/src/tasks/linter/index.js +1 -1
  42. package/src/tasks/list-lib/index.js +4 -4
  43. package/src/tasks/move/index.js +7 -7
  44. package/src/tasks/publish/index.js +17 -9
  45. package/src/tasks/publish-lib/index.js +11 -4
  46. package/src/tasks/rename/index.js +2 -2
  47. package/src/tasks/rename-lib/index.js +1 -1
  48. package/src/tasks/restore-config/index.js +1 -1
  49. package/src/tasks/show-help/index.js +12 -6
  50. package/src/tasks/switch-lib/index.js +2 -2
  51. package/src/tasks/switch-version/index.js +1 -1
  52. package/src/tasks/validator/index.js +2 -2
  53. package/src/util.js +23 -18
  54. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyForm/mock.ts +0 -4
  55. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPhone/config.json +1 -6
  56. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPhone/mock.ts +1 -6
  57. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/mock.ts +0 -4
  58. package/tests/assets/original/components/createAll/Constellation/shared/suggestions-handler.ts +0 -9
  59. package/tests/assets/original/components/createAll/Launchpad/shared/suggestions-handler.ts +0 -9
  60. /package/{tests/assets/original/components/create/shared/PConnProps.d.ts → src/tasks/create/templates/Launchpad/Field/Text-Phone/PConnProps.d.ts.mustache} +0 -0
  61. /package/{tests/assets/original/components/create/shared/create-nonce.ts → src/tasks/create/templates/Launchpad/Field/Text-Phone/create-nonce.ts.mustache} +0 -0
  62. /package/{tests/assets/original/components/create/shared/suggestions-handler.ts → src/tasks/create/templates/Launchpad/Field/Text-Phone/suggestions-handler.ts.mustache} +0 -0
  63. /package/{tests/assets/original/components/createAll/Launchpad/shared/PConnProps.d.ts → src/tasks/create/templates/Launchpad/Template/FORM/PConnProps.d.ts.mustache} +0 -0
  64. /package/{tests/assets/original/components/createAll/Launchpad/shared/create-nonce.ts → src/tasks/create/templates/Launchpad/Template/FORM/create-nonce.ts.mustache} +0 -0
  65. /package/{tests/assets/original/components/createAll/Constellation/shared/PConnProps.d.ts → src/tasks/create/templates/Launchpad/Template/FORM-region/PConnProps.d.ts.mustache} +0 -0
  66. /package/{tests/assets/original/components/createAll/Constellation/shared/create-nonce.ts → src/tasks/create/templates/Launchpad/Template/FORM-region/create-nonce.ts.mustache} +0 -0
@@ -79,8 +79,8 @@ export const getRulesetAndVersionQuestion = async (serverConfig) => {
79
79
  };
80
80
 
81
81
 
82
- async function fetchComponenLibrariessFromInfinity(apiUrl, headers) {
83
- addDebugLog("fetchComponenLibrariessFromInfinity", `apiUrl: ${apiUrl}`, "");
82
+ async function fetchComponentLibrariesFromInfinity(apiUrl, headers) {
83
+ addDebugLog("fetchComponentLibrariesFromInfinity", `apiUrl: ${apiUrl}`, "");
84
84
  const serverConfig = await getPegaServerConfig();
85
85
  return new Promise((resolve, reject) => {
86
86
  let status = 500;
@@ -160,7 +160,7 @@ addDebugLog("getInfinityLibraries", '', "");
160
160
  const headers = {};
161
161
  headers.Authorization = `${tokenType} ${accessToken}`;
162
162
 
163
- fetchComponenLibrariessFromInfinity(url, headers)
163
+ fetchComponentLibrariesFromInfinity(url, headers)
164
164
  .then((response) => resolve(response))
165
165
  .catch((e) => reject(e));
166
166
 
@@ -93,16 +93,16 @@ addDebugLog("deletePublished", "END", "-");
93
93
 
94
94
  if (isLibraryBasedCL) {
95
95
 
96
- const serverConfg = await getPegaServerConfig();
96
+ const serverConfig = await getPegaServerConfig();
97
97
  const { app_name, app_version } = await getApplicationAndVersionFromToken();
98
98
 
99
99
  console.log();
100
- console.log(`Current server: ${chalk.green.bold(`${serverConfg.server}`)}`);
100
+ console.log(`Current server: ${chalk.green.bold(`${serverConfig.server}`)}`);
101
101
  console.log(`List of libraries for Application: ${chalk.green.bold(`${app_name} - ${app_version}`)}`);
102
102
 
103
103
 
104
104
  // want to get all in application, so ignore ruleset/version questions
105
- // const questions = await getRulesetAndVersionQuestion(serverConfg);
105
+ // const questions = await getRulesetAndVersionQuestion(serverConfig);
106
106
  // const answers = await inquirer.prompt(questions);
107
107
  // const { rulesetName, rulesetVersion } = answers;
108
108
 
@@ -56,7 +56,7 @@ addDebugLog("updateConfig", `oldComponentKey: ${oldComponentKey}, newComponentKe
56
56
  configData.library = library;
57
57
  configData.version = version;
58
58
 
59
- // stringify "4", makes the json string look like JSON in the file, formated instead of a single line
59
+ // stringify "4", makes the json string look like JSON in the file, formatted instead of a single line
60
60
  fs.writeFileSync(join(targetDirectory, "/config.json"), JSON.stringify(configData, null, 4), { encoding: 'utf8',flag:'w' });
61
61
 
62
62
  };
@@ -92,7 +92,7 @@ addDebugLog("exportCLArch", `exportPath: ${exportPath}, orgLibName: ${orgLibName
92
92
  const exportFile = join(exportPath, fileName);
93
93
  let output;
94
94
 
95
- // need to build the libary
95
+ // need to build the library
96
96
  console.log(chalk.green(`\nBuilding binaries...\n`));
97
97
  const arOrgLib = orgLibName.split("_")
98
98
  const arVersion = selectedVersion.split("-");
@@ -132,7 +132,7 @@ addDebugLog("exportCLArch", `exportPath: ${exportPath}, orgLibName: ${orgLibName
132
132
  {
133
133
  name: 'overWriteFile',
134
134
  type: 'confirm',
135
- message: 'Overrwrite',
135
+ message: 'Overwrite',
136
136
  default: true
137
137
  },
138
138
  ]);
@@ -219,7 +219,7 @@ addDebugLog("exportArch", `exportPath: ${exportPath}, orgLibName: ${orgLibName},
219
219
  {
220
220
  name: 'overWriteFile',
221
221
  type: 'confirm',
222
- message: 'Overrwrite',
222
+ message: 'Overwrite',
223
223
  default: true
224
224
  },
225
225
  ]);
@@ -319,7 +319,7 @@ export default async options => {
319
319
  // }
320
320
  // }
321
321
 
322
- // diable question to build "CL"
322
+ // disable question to build "CL"
323
323
  // if (fullArchive === "" ) {
324
324
  // const fullArchiveQuestions = await getFullArchiveQuestions();
325
325
  // const fullArchiveAnswers = await inquirer.prompt(fullArchiveQuestions);
@@ -335,7 +335,7 @@ export default async options => {
335
335
 
336
336
  // if Binary, then we need to just build the current library, get the results and
337
337
  // and export an archive as zip
338
- // currently this is depricated, we are not going to export a CL as of yet.
338
+ // currently this is deprecated, we are not going to export a CL as of yet.
339
339
  if (fullArchive === "Binary") {
340
340
 
341
341
  inquirer.registerPrompt('fuzzypath', inquirerFuzzyPath);
@@ -360,7 +360,7 @@ export default async options => {
360
360
 
361
361
  console.log(`\nExporting library ${chalk.bold.green(`${orgLibName}/${selectedVersion}`)}\n`);
362
362
 
363
- // deprecating this code, only export current libary, don't ask for others
363
+ // deprecating this code, only export current library, don't ask for others
364
364
  // need to switchLib/Version to that library to export it
365
365
 
366
366
  // await zipVersionAndArchive(configDef.currentOrgLib, configDef.buildVersion);
@@ -43,7 +43,7 @@ addDebugLog("setTasksConfig", `libraryName: ${libraryName}, version: ${version},
43
43
  compConfig.version = version;
44
44
 
45
45
  // update file
46
- // stringify "4", makes the json string look like JSON in the file, formated instead of a single line
46
+ // stringify "4", makes the json string look like JSON in the file, formatted instead of a single line
47
47
  fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(configData, null, 4), { encoding: 'utf8',flag:'w' });
48
48
  }
49
49
 
@@ -56,7 +56,7 @@ addDebugLog("setPackageOrg", "", "");
56
56
  packageData.organization = organization;
57
57
 
58
58
  // update file
59
- // stringify "4", makes the json string look like JSON in the file, formated instead of a single line
59
+ // stringify "4", makes the json string look like JSON in the file, formatted instead of a single line
60
60
  fs.writeFileSync(packageJsonPath, JSON.stringify(packageData, null, 4), { encoding: 'utf8',flag:'w' });
61
61
 
62
62
  }
@@ -83,7 +83,7 @@ addDebugLog("updateConfig", `oldComponentKey: ${oldComponentKey}, newComponentKe
83
83
  configData.library = library;
84
84
  configData.version = version;
85
85
 
86
- // stringify "4", makes the json string look like JSON in the file, formated instead of a single line
86
+ // stringify "4", makes the json string look like JSON in the file, formatted instead of a single line
87
87
  fs.writeFileSync(join(currentDirectory, "/config.json"), JSON.stringify(configData, null, 4), { encoding: 'utf8',flag:'w' });
88
88
 
89
89
  };
@@ -107,7 +107,7 @@ addDebugLog("updateFile", `fileName: ${fileName}, oldComponentKeyPC: ${oldCompon
107
107
 
108
108
  };
109
109
 
110
- export const reanmeDirectory = async(currentDirectory, targetDirectory) => {
110
+ export const renameDirectory = async(currentDirectory, targetDirectory) => {
111
111
  if (!fs.existsSync(targetDirectory)) {
112
112
  fs.mkdirSync(targetDirectory, { recursive: true });
113
113
  }
@@ -187,7 +187,7 @@ addDebugLog("renameComponent", `library: ${library}, componentKey: ${componentKe
187
187
 
188
188
 
189
189
  // rename the directory
190
- await reanmeDirectory(currentDirectory, targetDirectory);
190
+ await renameDirectory(currentDirectory, targetDirectory);
191
191
 
192
192
 
193
193
  return newComponentKey;
@@ -255,7 +255,7 @@ addDebugLog("getLibraryVersionQuestion", "", "");
255
255
  type: 'rawlist',
256
256
  message: `Import from`,
257
257
  choices: [{name: 'Local directory', value: 'Directory'}, {name: 'Server', value: 'Server'}],
258
- defaut: 'Directory'
258
+ default: 'Directory'
259
259
  }
260
260
  ];
261
261
  };
@@ -73,7 +73,7 @@ addDebugLog("updateConfig", `oldComponentKey: ${oldComponentKey}, newComponentKe
73
73
  configData.library = library;
74
74
  configData.version = version;
75
75
 
76
- // stringify "4", makes the json string look like JSON in the file, formated instead of a single line
76
+ // stringify "4", makes the json string look like JSON in the file, formatted instead of a single line
77
77
  fs.writeFileSync(join(targetDirectory, "/config.json"), JSON.stringify(configData, null, 4), { encoding: 'utf8',flag:'w' });
78
78
 
79
79
  };
@@ -163,7 +163,7 @@ addDebugLog("renameComponent", `library: ${library}, componentKey: ${componentKe
163
163
 
164
164
  };
165
165
 
166
- export const getPackgeOrg = async(packagePath) => {
166
+ export const getPackageOrg = async(packagePath) => {
167
167
  const sPackData = fs.readFileSync(packagePath, { encoding: 'utf8' });
168
168
  const packData = sPackData && JSON.parse(sPackData);
169
169
 
@@ -213,7 +213,7 @@ export const moveComp = async(componentKey, orgLibName, version, copyShared, opt
213
213
  const tempDirectoryComponents = join(tempCompPath, `${newComponentKey}`);
214
214
 
215
215
  const currentSharedPath = join(currentCompPath, "shared");
216
- const targetSharedPatah = join(tempCompPath, "shared");
216
+ const targetSharedPath = join(tempCompPath, "shared");
217
217
 
218
218
  // copy component into temp directory
219
219
  fs.cpSync(currentComponentsPath, tempDirectoryComponents, { recursive: true, force: true });
@@ -223,7 +223,7 @@ export const moveComp = async(componentKey, orgLibName, version, copyShared, opt
223
223
 
224
224
  // copy shared
225
225
  if (copyShared) {
226
- fs.cpSync(currentSharedPath, targetSharedPatah, { recursive: true, force: true });
226
+ fs.cpSync(currentSharedPath, targetSharedPath, { recursive: true, force: true });
227
227
  }
228
228
 
229
229
  console.log(`\nCopied ${chalk.green(`${componentKey}`)} to ${chalk.green(`${orgLibName}/${version}`)} as ${chalk.green(`${newComponentKey}`)}\n`);
@@ -290,7 +290,7 @@ export const importArch = async(filePath, fileName, hadArchive) => {
290
290
  // need to get info from tasks.config and package.json
291
291
  // we won't rely on name of file, as owner can change it
292
292
 
293
- let organization = await getPackgeOrg(tempPackage);
293
+ let organization = await getPackageOrg(tempPackage);
294
294
  let localConfig = await getLocalConfigData(tempTasksConfig);
295
295
 
296
296
  let libName = localConfig.library;
@@ -504,7 +504,7 @@ addDebugLog("importArch", `filePath: ${filePath}, fileName: ${fileName}`, "");
504
504
  // need to get info from tasks.config and package.json
505
505
  // we won't rely on name of file, as owner can change it
506
506
 
507
- let organization = await getPackgeOrg(tempPackage);
507
+ let organization = await getPackageOrg(tempPackage);
508
508
  let localConfig = await getLocalConfigData(tempTasksConfig);
509
509
 
510
510
  let libName = localConfig.library;
@@ -817,7 +817,7 @@ export default async options => {
817
817
 
818
818
  console.log("");
819
819
 
820
- // reapply to save if changed, because imported task.config may have overriden and we want
820
+ // reapply to save if changed, because imported task.config may have overridden and we want
821
821
  // to keep what was entered as the latest
822
822
  await updateSavedFilePath(filePath);
823
823
  }
@@ -973,7 +973,7 @@ export default async options => {
973
973
  console.log("");
974
974
 
975
975
 
976
- // reapply to save if changed, because imported task.config may have overriden and we want
976
+ // reapply to save if changed, because imported task.config may have overridden and we want
977
977
  // to keep what was entered as the latest
978
978
  await updateSavedFilePath(filePath);
979
979
  }
@@ -69,7 +69,7 @@ addDebugLog("updateConfig", `oldComponentKey: ${oldComponentKey}, newComponentKe
69
69
  configData.description = newLabel;
70
70
  }
71
71
 
72
- // stringify "4", makes the json string look like JSON in the file, formated instead of a single line
72
+ // stringify "4", makes the json string look like JSON in the file, formatted instead of a single line
73
73
  fs.writeFileSync(join(targetDirectory, "/config.json"), JSON.stringify(configData, null, 4), { encoding: 'utf8' });
74
74
 
75
75
  };
@@ -5,23 +5,30 @@
5
5
  This project provides you with an environment to extend Constellation by giving you tools to create and publish custom components that are not available from the Constellation installation.
6
6
 
7
7
  ## Before you begin
8
+
8
9
  Review the following checklist before you create a Constellation DX component:
9
10
 
10
11
  ## Design considerations
11
- Involve an Experience Designer in your process. This will help you determine the exact issue to be resolved. For more information on the role of an Experience Designer, see **Experience Designer**[here](https://community.pega.com/roles/experience-designer).
12
+
13
+ Involve an Experience Designer in your process. This will help you determine the exact issue to be resolved. For more information on the role of an Experience Designer, see **Experience Designer** [here](https://community.pega.com/roles/experience-designer).
12
14
 
13
15
  ## The Experience Designer must meet the following requirements:
16
+
14
17
  Must have a background in UI and UX design.
15
- Must understand Pega's best practices for design. For more information, see **Best practices for designing with the Constellation design system**[here](https://design.pega.com/design/getting-started/).
18
+ Must understand Pega's best practices for design. For more information, see **Best practices for designing with the Constellation design system** [here](https://design.pega.com/design/getting-started/).
16
19
 
17
20
  ## Functionality considerations
21
+
18
22
  Check if an existing component in App Studio contains the features you need. If not, check for existing components that contain similar features.
19
23
  Connect with Pega Support to find out if a component containing a similar feature will be included in the next release. If yes, assess if you can wait for the next release.
20
24
 
21
25
  ## Maintenance considerations
26
+
22
27
  Ensure you have the bandwidth to maintain the Constellation DX component and keep it up-to-date with every release of Pega Infinity. Evaluate if doing this might prevent you from upgrading to future releases of Pega Infinity.
23
28
  Evaluate if you are able to meet the compliance standards for data privacy and accessibility for Constellation DX components. Note that not meeting these standards might lead to legal compliance issues.
24
29
 
30
+ For more info [here](https://pega-dev.zoominsoftware.io/bundle/constellation-dx-components/page/constellation-dx-components/custom-components/design-requirements-constellation-dx-components.html).
31
+
25
32
  ## Prerequisites
26
33
 
27
34
  Ensure you have access to the following in your system:
@@ -3,6 +3,8 @@
3
3
  "description": "{{description}}",
4
4
  "organization": "{{organization}}",
5
5
  "version": "1.0.0",
6
+ "author": "{{author}}",
7
+ "license": "Enter License",
6
8
  "main": "src/index.js",
7
9
  "type": "module",
8
10
  "scripts": {
@@ -79,12 +81,10 @@
79
81
  "keywords": [
80
82
  "pega"
81
83
  ],
82
- "author": "",
83
- "license": "Enter License",
84
84
  "dependencies": {
85
- "@pega/cosmos-react-condition-builder": "^8.1.0",
86
- "@pega/cosmos-react-core": "^8.1.0",
87
- "@pega/cosmos-react-work": "^8.1.0",
85
+ "@pega/cosmos-react-condition-builder": "^8.4.1",
86
+ "@pega/cosmos-react-core": "^8.4.1",
87
+ "@pega/cosmos-react-work": "^8.4.1",
88
88
  "@pega/eslint-config": "^0.16.3",
89
89
  "@pega/tsconfig": "^0.16.3",
90
90
  "babel-loader": "^10.0.0",
@@ -107,8 +107,8 @@
107
107
  "@babel/preset-react": "^7.27.1",
108
108
  "@babel/preset-typescript": "^7.27.1",
109
109
  "@pega/configs": "^0.16.3",
110
- "@pega/custom-dx-components": "~25.1.10-alpha-0.13",
111
- "@pega/pcore-pconnect-typedefs": "^4.1.0-alpha.1",
110
+ "@pega/custom-dx-components": "~25.1.10",
111
+ "@pega/pcore-pconnect-typedefs": "^4.1.0",
112
112
  "@storybook/addon-actions": "^8.6.14",
113
113
  "@storybook/addon-essentials": "^8.6.14",
114
114
  "@storybook/addon-links": "^8.6.14",
@@ -30,7 +30,7 @@ export const lintComponent = async (dirToLint) => {
30
30
  }
31
31
  };
32
32
 
33
- // inpsired by https://eslint.org/docs/latest/developer-guide/nodejs-api
33
+ // inspired by https://eslint.org/docs/latest/developer-guide/nodejs-api
34
34
 
35
35
  // (async function main() {
36
36
  // // 1. Create an instance.
@@ -8,7 +8,7 @@ import {
8
8
  checkLibraryAndArchives,
9
9
  getLibraryArchivesVersions,
10
10
  getConfigDefaults,
11
- getLocalArchivedLibrraryVersionData,
11
+ getLocalArchivedLibraryVersionData,
12
12
  getComponentsConfigs,
13
13
  cleanUpTemp } from '../../util.js';
14
14
  import { getArchiveLibraryQuestions } from './helper.js';
@@ -34,7 +34,7 @@ addDebugLog("listLibrary", "", "+");
34
34
  organization = compDef.organization;
35
35
  library = compDef.library;
36
36
  let libraryName;
37
- const currnetVersion = compDef.buildVersion;
37
+ const currentVersion = compDef.buildVersion;
38
38
  let selectedVersion;
39
39
  let libVersions = [];
40
40
  let currentOrStore = "";
@@ -114,7 +114,7 @@ addDebugLog("listLibrary", "", "+");
114
114
  builtOn = "(no date - current)";
115
115
  }
116
116
  else {
117
- data = await getLocalArchivedLibrraryVersionData(libraryName, selectedVersion);
117
+ data = await getLocalArchivedLibraryVersionData(libraryName, selectedVersion);
118
118
  data = JSON.parse(data);
119
119
 
120
120
  if (data[0] && data[0].buildDate) {
@@ -124,7 +124,7 @@ addDebugLog("listLibrary", "", "+");
124
124
 
125
125
  }
126
126
  else {
127
- data = await getLocalArchivedLibrraryVersionData(libraryName, selectedVersion);
127
+ data = await getLocalArchivedLibraryVersionData(libraryName, selectedVersion);
128
128
  data = JSON.parse(data);
129
129
 
130
130
  if (data[0] && data[0].buildDate) {
@@ -68,7 +68,7 @@ addDebugLog("updateConfig", `oldComponentKey: ${oldComponentKey}, newComponentKe
68
68
  configData.description = compLabel;
69
69
  }
70
70
 
71
- // stringify "4", makes the json string look like JSON in the file, formated instead of a single line
71
+ // stringify "4", makes the json string look like JSON in the file, formatted instead of a single line
72
72
  fs.writeFileSync(join(targetDirectory, "/config.json"), JSON.stringify(configData, null, 4), { encoding: 'utf8', flag:'w' });
73
73
 
74
74
  };
@@ -205,11 +205,11 @@ export const moveComp = async(componentKey, copyMove, orgLibName, version, copyS
205
205
  }
206
206
 
207
207
  const currentSharedPath = join(currentCompPath, "shared");
208
- const targetSharedPatah = join(tempCompPath, "shared");
208
+ const targetSharedPath = join(tempCompPath, "shared");
209
209
 
210
210
  // copy shared
211
211
  if (copyShared) {
212
- fs.cpSync(currentSharedPath, targetSharedPatah, { recursive: true, force: true });
212
+ fs.cpSync(currentSharedPath, targetSharedPath, { recursive: true, force: true });
213
213
  }
214
214
 
215
215
  // rearchive temp directory
@@ -225,11 +225,11 @@ export const moveComp = async(componentKey, copyMove, orgLibName, version, copyS
225
225
 
226
226
  if (newComponentKey) {
227
227
  const currentSharedPath = join(currentCompPath, "shared");
228
- const targetSharedPatah = join(tempCompPath, "shared");
228
+ const targetSharedPath = join(tempCompPath, "shared");
229
229
 
230
230
  // copy shared
231
231
  if (copyShared) {
232
- fs.cpSync(currentSharedPath, targetSharedPatah, { recursive: true, force: true });
232
+ fs.cpSync(currentSharedPath, targetSharedPath, { recursive: true, force: true });
233
233
  }
234
234
 
235
235
  console.log(`\n${copiedOrMoved} ${chalk.green(`${componentKey}`)} to ${chalk.green(`${orgLibName}/${version}`)} as ${chalk.green(`${newComponentKey}`)}\n`);
@@ -387,7 +387,7 @@ addDebugLog("move", "", "+");
387
387
  }
388
388
  else {
389
389
 
390
- // VS Code pluggin would send in the component
390
+ // VS Code plugin would send in the component
391
391
  let paramComponentKey;
392
392
  if (options.params.length == 4) {
393
393
  paramComponentKey = options.params[3];
@@ -396,7 +396,7 @@ addDebugLog("move", "", "+");
396
396
  const configDef = getConfigDefaults();
397
397
  console.log(`Current library: ${chalk.green(`${configDef.displayLibVersion}`)}`);
398
398
 
399
- // test to see if currnet library has more than one version
399
+ // test to see if current library has more than one version
400
400
  // if no available versions can not move/copy to it, so send in current lib
401
401
  // as library to be removed from the list
402
402
  let removeOrgLib = "";
@@ -24,6 +24,7 @@ import {
24
24
  convertYNToBoolean,
25
25
  checkForBranch,
26
26
  getApplicationAndVersionFromToken,
27
+ zipVersionAndArchive,
27
28
  applyPegaData } from '../../util.js';
28
29
 
29
30
  import { getPublishComponentQuestions, publishComponentToServer, zipComponent } from './helper.js';
@@ -62,13 +63,13 @@ addDebugLog("publish", "", "+");
62
63
  const currentOrgLib = orgLib.currentOrgLib;
63
64
  // const currentVersion = devBuild ? `${orgLib.version}-dev`: orgLib.version;
64
65
  const currentVersion = orgLib.buildVersion;
65
- const serverConfg = await getPegaServerConfig();
66
+ const serverConfig = await getPegaServerConfig();
66
67
  let configJson = {};
67
68
  await applyPegaData(configJson);
68
69
  const {app_name, app_version, sub } = await getApplicationAndVersionFromToken();
69
70
 
70
71
  console.log();
71
- console.log(`Publishing to server: ${chalk.green.bold(`${serverConfg.server}`)}`);
72
+ console.log(`Publishing to server: ${chalk.green.bold(`${serverConfig.server}`)}`);
72
73
  console.log(`Cosmos version: ${chalk.green.bold(`${configJson.packageCosmosVersion}`)}`);
73
74
  console.log(`Application: ${chalk.green.bold(`${app_name} - ${app_version}`)} for ${chalk.magentaBright.bold(`${sub}`)}`);
74
75
  console.log();
@@ -122,7 +123,7 @@ addDebugLog("publish", "", "+");
122
123
 
123
124
  // content = { rulesetName, rulesetVersion };
124
125
  } else {
125
- // VS Code pluggin would send in the component
126
+ // VS Code plugin would send in the component
126
127
  let paramComponentKey;
127
128
  if (options.params.length == 4) {
128
129
  paramComponentKey = options.params[3];
@@ -166,9 +167,15 @@ addDebugLog("publish", "", "+");
166
167
  options.params.push("internal");
167
168
 
168
169
 
169
- await buildLibrary(options);
170
- await publishLibrary(options);
171
-
170
+ try {
171
+ await buildLibrary(options);
172
+ await zipVersionAndArchive(orgLib.currentOrgLib, orgLib.buildVersion);
173
+ await publishLibrary(options);
174
+ }
175
+ catch (err) {
176
+ console.log(chalk.redBright(err));
177
+ process.exit(1);
178
+ }
172
179
 
173
180
  }
174
181
 
@@ -179,10 +186,10 @@ addDebugLog("publish", "", "+");
179
186
 
180
187
  }
181
188
 
182
- // otherwise continue with original V1 publishig of individual components
189
+ // otherwise continue with original V1 publishing of individual components
183
190
 
184
191
  //
185
- // orginial V1 publish
192
+ // original V1 publish
186
193
  //
187
194
 
188
195
  let OauthData;
@@ -222,7 +229,7 @@ addDebugLog("publish", "", "+");
222
229
 
223
230
  content = { componentKey, rulesetName, rulesetVersion, devBuild };
224
231
  } else {
225
- // VS Code pluggin would send in the component
232
+ // VS Code plugin would send in the component
226
233
  let paramComponentKey;
227
234
  if (options.params.length == 4) {
228
235
  paramComponentKey = options.params[3];
@@ -287,6 +294,7 @@ addDebugLog("publish", "", "+");
287
294
 
288
295
  await tasks.run().catch(err => {
289
296
  console.log(chalk.bold.red(err.toString()));
297
+ process.exit(1);
290
298
  });
291
299
 
292
300
 
@@ -93,7 +93,7 @@ addDebugLog("zipLibraryComponent", `libraryName: ${libraryName}, libraryVersion:
93
93
  archive.file(componentsConfigJson, { name: path.basename(componentsConfigJson) });
94
94
  }
95
95
 
96
- // Add componentslocalization.jspon (array of component localizations) file
96
+ // Add componentslocalization.json (array of component localizations) file
97
97
  if (fs.existsSync(localizationsJson)) {
98
98
  archive.file(localizationsJson, { name: path.basename(localizationsJson) });
99
99
  }
@@ -258,6 +258,7 @@ addDebugLog("publishUILibraryComponentToInfinity", `content: ${content}`, "");
258
258
  // strip all Error:
259
259
  sErr = sErr.replaceAll("Error: ", "");
260
260
  console.log(chalk.bold.red("Error: " + sErr));
261
+ process.exit(1);
261
262
  }
262
263
 
263
264
  }
@@ -398,6 +399,7 @@ addDebugLog("publishLibrary", "", "+");
398
399
  return;
399
400
  }
400
401
 
402
+ // This is for 24.2 version of libraryMode, libraryModeCL doesn't do "permanent"
401
403
  if (!version.includes("-dev") && !internalPublish && !isLibraryBasedCL) {
402
404
  okToPublish = false;
403
405
  const publishAnswers = await inquirer.prompt([
@@ -421,16 +423,20 @@ addDebugLog("publishLibrary", "", "+");
421
423
  }
422
424
 
423
425
 
424
- const isLibraryBasedCL = getLibraryBasedCL();
425
426
  if (okToPublish) {
426
427
  if (isLibraryBasedCL) {
427
- // developer test
428
428
 
429
+ // for Library Mode CL (25.1 and greater), this is the default
429
430
  let content = { libraryName, version, rulesetName, rulesetVersion };
430
431
  await publishUILibraryComponentToInfinity(content);
431
432
 
432
433
  }
433
434
  else {
435
+ //
436
+ // This is 24.2 library mode with App Static (old)
437
+ // at some point need to deprecate and remove this code
438
+ //
439
+
434
440
  let libVersionExists = await doesLibraryExist(libraryName, version);
435
441
  let overrideExisting = false;
436
442
  let checkDeleted = false;
@@ -444,7 +450,7 @@ addDebugLog("publishLibrary", "", "+");
444
450
  {
445
451
  name: 'override',
446
452
  type: 'confirm',
447
- message: `Do you wish to overrite it`,
453
+ message: `Do you wish to overwrite it`,
448
454
  default: false
449
455
  }
450
456
  ];
@@ -483,6 +489,7 @@ addDebugLog("publishLibrary", "", "+");
483
489
  else {
484
490
  console.log(chalk.bold.redBright(`No library versions named ${libraryName}.`));
485
491
  console.log(chalk.bold.redBright(`You need to build library ${libraryName} first.`));
492
+ process.exit(1);
486
493
  }
487
494
 
488
495
 
@@ -80,7 +80,7 @@ addDebugLog("updateConfig", `oldComponentKey: ${oldComponentKey}, newComponentKe
80
80
 
81
81
  // configData.allowedApplications = allowedApplications;
82
82
 
83
- // stringify "4", makes the json string look like JSON in the file, formated instead of a single line
83
+ // stringify "4", makes the json string look like JSON in the file, formatted instead of a single line
84
84
  fs.writeFileSync(join(targetDirectory, "/config.json"), JSON.stringify(configData, null, 4), { encoding: 'utf8' });
85
85
 
86
86
  };
@@ -242,7 +242,7 @@ addDebugLog("rename", "", "+");
242
242
  }
243
243
  else {
244
244
 
245
- // VS Code pluggin would send in the component
245
+ // VS Code plugin would send in the component
246
246
  let paramComponentKey;
247
247
  if (options.params.length == 4) {
248
248
  paramComponentKey = options.params[3];
@@ -76,7 +76,7 @@ addDebugLog("updateConfig", "", "");
76
76
 
77
77
  configData.allowedApplications = allowedApplications;
78
78
 
79
- // stringify "4", makes the json string look like JSON in the file, formated instead of a single line
79
+ // stringify "4", makes the json string look like JSON in the file, formatted instead of a single line
80
80
  fs.writeFileSync(join(targetDirectory, '/config.json'), JSON.stringify(configData, null, 4), {
81
81
  encoding: 'utf8',flag:'w'
82
82
  });
@@ -32,7 +32,7 @@ addDebugLog("restoreConfig", "", "+");
32
32
  {
33
33
  name: 'restoreDev',
34
34
  type: 'confirm',
35
- message: 'Also restore package dependencies/devDepencies ?',
35
+ message: 'Also restore package dependencies/devDependencies ?',
36
36
  default: false
37
37
  },
38
38
  ]);