@pega/custom-dx-components 0.25.52 → 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 +18 -0
- package/package.json +1 -1
- package/src/tasks/create-lib/index.js +4 -0
- package/src/tasks/create-version/index.js +4 -0
- package/src/tasks/delete-lib/index.js +11 -0
- package/src/tasks/delete-version/index.js +5 -0
- package/src/tasks/import-archive/index.js +5 -0
- package/src/tasks/init/template/README.md +18 -0
- package/src/tasks/init/template/package.json.mustache +1 -1
- package/src/tasks/publish/index.js +4 -0
- package/src/tasks/restore/index.js +35 -14
- package/src/tasks/set-perm/index.js +5 -0
- package/src/tasks/store/index.js +34 -13
- package/src/tasks/switch-lib/index.js +4 -0
- package/src/tasks/switch-version/index.js +4 -0
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
|
@@ -45,6 +45,10 @@ export default async options => {
|
|
|
45
45
|
// process and exit
|
|
46
46
|
if (useInputConfig) {
|
|
47
47
|
const inputConfig = await getInputConfigForCommand("createLib");
|
|
48
|
+
if (!inputConfig || Object.keys(inputConfig).length === 0) {
|
|
49
|
+
console.log(chalk.redBright("Configured for input config, but no input.config.json file found."));
|
|
50
|
+
process.exit(1);
|
|
51
|
+
}
|
|
48
52
|
|
|
49
53
|
if (convertYNToBoolean(inputConfig.okToContinue)) {
|
|
50
54
|
const libraryName = inputConfig.libraryName;
|
|
@@ -58,6 +58,10 @@ addDebugLog("createVersion", "", "+");
|
|
|
58
58
|
// process and no inputs
|
|
59
59
|
if (useInputConfig) {
|
|
60
60
|
const inputConfig = await getInputConfigForCommand("createLibVersion");
|
|
61
|
+
if (!inputConfig || Object.keys(inputConfig).length === 0) {
|
|
62
|
+
console.log(chalk.redBright("Configured for input config, but no input.config.json file found."));
|
|
63
|
+
process.exit(1);
|
|
64
|
+
}
|
|
61
65
|
|
|
62
66
|
if (convertYNToBoolean(inputConfig.okToContinue)) {
|
|
63
67
|
version = inputConfig.libraryVersion;
|
|
@@ -236,7 +236,18 @@ addDebugLog("deleteLibrary", "", "+");
|
|
|
236
236
|
|
|
237
237
|
if (useInputConfig) {
|
|
238
238
|
const inputConfig = await getInputConfigForCommand("deleteLib");
|
|
239
|
+
if (!inputConfig || Object.keys(inputConfig).length === 0) {
|
|
240
|
+
console.log(chalk.redBright("Configured for input config, but no input.config.json file found."));
|
|
241
|
+
process.exit(1);
|
|
242
|
+
}
|
|
243
|
+
|
|
239
244
|
libraryName = inputConfig.libraryName;
|
|
245
|
+
if (libraryName.indexOf("_") < 0) {
|
|
246
|
+
// need to add in organization
|
|
247
|
+
libraryName = `${compDef.organization}_${libraryName}`;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
|
|
240
251
|
version = inputConfig.libraryVersion;
|
|
241
252
|
const isPermanent = inputConfig?.isPermanent || "N";
|
|
242
253
|
let permBuild = convertYNToBoolean(isPermanent);
|
|
@@ -41,6 +41,11 @@ addDebugLog("deleteVersion", "", "+");
|
|
|
41
41
|
|
|
42
42
|
if (useInputConfig) {
|
|
43
43
|
const inputConfig = await getInputConfigForCommand("deleteLibVersion");
|
|
44
|
+
if (!inputConfig || Object.keys(inputConfig).length === 0) {
|
|
45
|
+
console.log(chalk.redBright("Configured for input config, but no input.config.json file found."));
|
|
46
|
+
process.exit(1);
|
|
47
|
+
}
|
|
48
|
+
|
|
44
49
|
version = inputConfig.libraryVersion;
|
|
45
50
|
const isPermanent = inputConfig?.isPermanent || "N";
|
|
46
51
|
let permBuild = convertYNToBoolean(isPermanent);
|
|
@@ -726,6 +726,11 @@ export default async options => {
|
|
|
726
726
|
|
|
727
727
|
if (useInputConfig) {
|
|
728
728
|
const inputConfig = await getInputConfigForCommand("importLibVersion");
|
|
729
|
+
if (!inputConfig || Object.keys(inputConfig).length === 0) {
|
|
730
|
+
console.log(chalk.redBright("Configured for input config, but no input.config.json file found."));
|
|
731
|
+
process.exit(1);
|
|
732
|
+
}
|
|
733
|
+
|
|
729
734
|
const serverOrDirectory = inputConfig.serverOrDirectory;
|
|
730
735
|
const filePath = inputConfig.fileLocation;
|
|
731
736
|
const fileName = inputConfig.fileName;
|
|
@@ -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.
|
|
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",
|
|
@@ -75,6 +75,10 @@ addDebugLog("publish", "", "+");
|
|
|
75
75
|
|
|
76
76
|
if (useInputConfig) {
|
|
77
77
|
const inputConfig = await getInputConfigForCommand("publish");
|
|
78
|
+
if (!inputConfig || Object.keys(inputConfig).length === 0) {
|
|
79
|
+
console.log(chalk.redBright("Configured for input config, but no input.config.json file found."));
|
|
80
|
+
process.exit(1);
|
|
81
|
+
}
|
|
78
82
|
|
|
79
83
|
const okToPubPerm = inputConfig?.okToPublishPermanent || "Y";
|
|
80
84
|
const okToPublishPerm = convertYNToBoolean(okToPubPerm);
|
|
@@ -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 (
|
|
40
|
-
const
|
|
41
|
-
|
|
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
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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(
|
|
@@ -141,6 +141,11 @@ addDebugLog("setPerm", "", "+");
|
|
|
141
141
|
|
|
142
142
|
if (useInputConfig) {
|
|
143
143
|
const inputConfig = await getInputConfigForCommand("setPermanent");
|
|
144
|
+
if (!inputConfig || Object.keys(inputConfig).length === 0) {
|
|
145
|
+
console.log(chalk.redBright("Configured for input config, but no input.config.json file found."));
|
|
146
|
+
process.exit(1);
|
|
147
|
+
}
|
|
148
|
+
|
|
144
149
|
inputYN = inputConfig.makePermanent;
|
|
145
150
|
|
|
146
151
|
}
|
package/src/tasks/store/index.js
CHANGED
|
@@ -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 (
|
|
37
|
-
const
|
|
38
|
-
|
|
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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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
|
|
|
@@ -62,6 +62,10 @@ addDebugLog("switchLibrary", "", "+");
|
|
|
62
62
|
// process and no inputs
|
|
63
63
|
if (useInputConfig) {
|
|
64
64
|
const inputConfig = await getInputConfigForCommand("switchLib");
|
|
65
|
+
if (!inputConfig || Object.keys(inputConfig).length === 0) {
|
|
66
|
+
console.log(chalk.redBright("Configured for input config, but no input.config.json file found."));
|
|
67
|
+
process.exit(1);
|
|
68
|
+
}
|
|
65
69
|
|
|
66
70
|
if (convertYNToBoolean(inputConfig.okToContinue)) {
|
|
67
71
|
const newLibraryName = inputConfig.libraryName;
|
|
@@ -62,6 +62,10 @@ addDebugLog("switchVersion", "", "+");
|
|
|
62
62
|
// process and no inputs
|
|
63
63
|
if (useInputConfig) {
|
|
64
64
|
const inputConfig = await getInputConfigForCommand("switchLibVersion");
|
|
65
|
+
if (!inputConfig || Object.keys(inputConfig).length === 0) {
|
|
66
|
+
console.log(chalk.redBright("Configured for input config, but no input.config.json file found."));
|
|
67
|
+
process.exit(1);
|
|
68
|
+
}
|
|
65
69
|
|
|
66
70
|
okToContinue = convertYNToBoolean(inputConfig.okToContinue);
|
|
67
71
|
if (okToContinue) {
|