@pega/custom-dx-components 0.25.53 → 0.25.54

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.
package/README.md CHANGED
@@ -4,6 +4,24 @@
4
4
 
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
+ ## Before you begin
8
+ Review the following checklist before you create a Constellation DX component:
9
+
10
+ ## 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
+ ## The Experience Designer must meet the following requirements:
14
+ 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/).
16
+
17
+ ## Functionality considerations
18
+ Check if an existing component in App Studio contains the features you need. If not, check for existing components that contain similar features.
19
+ 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
+
21
+ ## Maintenance considerations
22
+ 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
+ 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
+
7
25
  ## Prerequisites
8
26
 
9
27
  Ensure you have access to the following in your system:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/custom-dx-components",
3
- "version": "0.25.53",
3
+ "version": "0.25.54",
4
4
  "description": "Utility for building custom UI components",
5
5
  "bin": "./bin/index.js",
6
6
  "keywords": [
@@ -242,6 +242,12 @@ addDebugLog("deleteLibrary", "", "+");
242
242
  }
243
243
 
244
244
  libraryName = inputConfig.libraryName;
245
+ if (libraryName.indexOf("_") < 0) {
246
+ // need to add in organization
247
+ libraryName = `${compDef.organization}_${libraryName}`;
248
+ }
249
+
250
+
245
251
  version = inputConfig.libraryVersion;
246
252
  const isPermanent = inputConfig?.isPermanent || "N";
247
253
  let permBuild = convertYNToBoolean(isPermanent);
@@ -4,6 +4,24 @@
4
4
 
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
+ ## Before you begin
8
+ Review the following checklist before you create a Constellation DX component:
9
+
10
+ ## 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
+ ## The Experience Designer must meet the following requirements:
14
+ 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/).
16
+
17
+ ## Functionality considerations
18
+ Check if an existing component in App Studio contains the features you need. If not, check for existing components that contain similar features.
19
+ 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
+
21
+ ## Maintenance considerations
22
+ 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
+ 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
+
7
25
  ## Prerequisites
8
26
 
9
27
  Ensure you have access to the following in your system:
@@ -107,7 +107,7 @@
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": "~0.25.53",
110
+ "@pega/custom-dx-components": "~0.25.54",
111
111
  "@pega/pcore-pconnect-typedefs": "^4.1.0-alpha.1",
112
112
  "@storybook/addon-actions": "^8.6.14",
113
113
  "@storybook/addon-essentials": "^8.6.14",
@@ -11,7 +11,10 @@ import {
11
11
  getLibraryBased,
12
12
  restoreFromArchive,
13
13
  cleanUpTemp,
14
- forceDefaultsUpdate
14
+ forceDefaultsUpdate,
15
+ getUseInputConfig,
16
+ getInputConfigForCommand,
17
+ convertYNToBoolean
15
18
  } from '../../util.js';
16
19
 
17
20
  import { showCurrentStatus } from '../show-status/index.js';
@@ -19,6 +22,7 @@ import {
19
22
  export default async options => {
20
23
  await showVersion();
21
24
  await checkLibraryAndArchives();
25
+ const useInputConfig = getUseInputConfig();
22
26
 
23
27
  addDebugLog("restoreComponent", "", "+");
24
28
 
@@ -31,26 +35,43 @@ addDebugLog("restoreComponent", "", "+");
31
35
  }
32
36
  const confDef = getConfigDefaults();
33
37
 
34
- console.log(chalk.bold.yellow('\nChanges not saved to local storage will be LOST, code will be restored from local storage.'));
35
- console.log("");
36
38
 
37
39
  let restoreFromStore = {};
38
40
 
39
- if (options.params.length === 4) {
40
- const optConfirm = options.params[3];
41
- restoreFromStore["confirmRestore"] = optConfirm === 'Y' || optConfirm === 'y' || optConfirm === true || optConfirm === 'true' ? true : false;
41
+ if (useInputConfig) {
42
+ const inputConfig = await getInputConfigForCommand("restoreLibVersion");
43
+ if (!inputConfig || Object.keys(inputConfig).length === 0) {
44
+ console.log(chalk.redBright("Configured for input config, but no input.config.json file found."));
45
+ process.exit(1);
46
+ }
47
+
48
+ const okToRestore = convertYNToBoolean(inputConfig.okToRestore);
49
+
50
+ restoreFromStore.confirmRestore = okToRestore;
51
+
42
52
  }
43
53
  else {
44
- restoreFromStore = await inquirer.prompt([
45
- {
46
- name: 'confirmRestore',
47
- type: 'confirm',
48
- message: `Restoring ${chalk.bold.green(`${confDef.displayLibVersion}`)} from local storage, proceed ?`,
49
- default: true
50
- }
51
- ]);
54
+ console.log(chalk.bold.yellow('\nChanges not saved to local storage will be LOST, code will be restored from local storage.'));
55
+ console.log("");
56
+
57
+ if (options.params.length === 4) {
58
+ const optConfirm = options.params[3];
59
+ restoreFromStore["confirmRestore"] = optConfirm === 'Y' || optConfirm === 'y' || optConfirm === true || optConfirm === 'true' ? true : false;
60
+ }
61
+ else {
62
+ restoreFromStore = await inquirer.prompt([
63
+ {
64
+ name: 'confirmRestore',
65
+ type: 'confirm',
66
+ message: `Restoring ${chalk.bold.green(`${confDef.displayLibVersion}`)} from local storage, proceed ?`,
67
+ default: true
68
+ }
69
+ ]);
70
+ }
52
71
  }
53
72
 
73
+
74
+
54
75
  if (restoreFromStore.confirmRestore) {
55
76
  const switchToFileName = `${confDef.currentOrgLib}_${confDef.version}.arch.zip`;
56
77
  const tasks = new Listr(
@@ -10,12 +10,16 @@ import {
10
10
  getConfigDefaults,
11
11
  getLibraryBased,
12
12
  zipVersionAndArchive,
13
- cleanUpTemp
13
+ cleanUpTemp,
14
+ getUseInputConfig,
15
+ getInputConfigForCommand,
16
+ convertYNToBoolean
14
17
  } from '../../util.js';
15
18
 
16
19
  export default async options => {
17
20
  await showVersion();
18
21
  await checkLibraryAndArchives();
22
+ const useInputConfig = getUseInputConfig();
19
23
 
20
24
  addDebugLog("storeComponents", "", "+");
21
25
 
@@ -29,26 +33,43 @@ addDebugLog("storeComponents", "", "+");
29
33
  const confDef = getConfigDefaults();
30
34
 
31
35
 
32
- console.log(chalk.bold.yellow('\nBe sure to SAVE all changes before storing, or changes will NOT be stored.'));
33
36
 
34
37
  let answers = {};
35
38
 
36
- if (options.params.length === 4) {
37
- const optConfirm = options.params[3];
38
- answers["confirmStore"] = optConfirm === 'Y' || optConfirm === 'y' || optConfirm === true || optConfirm === 'true' ? true : false;
39
+ if (useInputConfig) {
40
+ const inputConfig = await getInputConfigForCommand("storeLibVersion");
41
+ if (!inputConfig || Object.keys(inputConfig).length === 0) {
42
+ console.log(chalk.redBright("Configured for input config, but no input.config.json file found."));
43
+ process.exit(1);
44
+ }
45
+
46
+ const okToStore = convertYNToBoolean(inputConfig.okToStore);
47
+
48
+ answers.confirmStore = okToStore;
49
+
39
50
  }
40
51
  else {
52
+ console.log(chalk.bold.yellow('\nBe sure to SAVE all changes before storing, or changes will NOT be stored.'));
53
+
54
+ if (options.params.length === 4) {
55
+ const optConfirm = options.params[3];
56
+ answers["confirmStore"] = optConfirm === 'Y' || optConfirm === 'y' || optConfirm === true || optConfirm === 'true' ? true : false;
57
+ }
58
+ else {
41
59
 
42
- answers = await inquirer.prompt([
43
- {
44
- name: 'confirmStore',
45
- type: 'confirm',
46
- message: `Storing ${chalk.green(`${confDef.currentOrgLib}/${confDef.buildVersion}`)} to local storage, proceed ?`,
47
- default: true
48
- }
49
- ]);
60
+ answers = await inquirer.prompt([
61
+ {
62
+ name: 'confirmStore',
63
+ type: 'confirm',
64
+ message: `Storing ${chalk.green(`${confDef.currentOrgLib}/${confDef.buildVersion}`)} to local storage, proceed ?`,
65
+ default: true
66
+ }
67
+ ]);
68
+ }
50
69
  }
51
70
 
71
+
72
+
52
73
  if (answers.confirmStore) {
53
74
  console.log("");
54
75