@pega/custom-dx-components 0.25.58 → 0.25.60
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 +9 -2
- package/package.json +4 -4
- package/src/tasks/init/template/README.md +9 -2
- package/src/tasks/init/template/package.json.mustache +5 -5
- package/src/tasks/publish/index.js +11 -3
- package/src/tasks/publish-lib/index.js +9 -2
- package/src/tasks/show-help/index.js +11 -5
- package/src/util.js +5 -0
package/README.md
CHANGED
|
@@ -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
|
-
|
|
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:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pega/custom-dx-components",
|
|
3
|
-
"version": "0.25.
|
|
3
|
+
"version": "0.25.60",
|
|
4
4
|
"description": "Utility for building custom UI components",
|
|
5
5
|
"bin": "./bin/index.js",
|
|
6
6
|
"keywords": [
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"@babel/core": "^7.28.0",
|
|
25
25
|
"@babel/plugin-transform-class-properties": "^7.27.1",
|
|
26
26
|
"@babel/preset-react": "^7.27.1",
|
|
27
|
-
"@pega/auth": "^0.2.
|
|
28
|
-
"@pega/constellation-dx-components-build-utils": "^2.0.
|
|
27
|
+
"@pega/auth": "^0.2.31",
|
|
28
|
+
"@pega/constellation-dx-components-build-utils": "^2.0.11",
|
|
29
29
|
"@pega/inquirer-fuzzy-path": "^3.0.0",
|
|
30
30
|
"ajv": "^8.17.1",
|
|
31
31
|
"ajv-keywords": "^5.1.0",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"typescript": "~5.8.3",
|
|
67
67
|
"unarchive": "^1.1.3",
|
|
68
68
|
"url-loader": "4.1.1",
|
|
69
|
-
"webpack": "5.
|
|
69
|
+
"webpack": "5.101.0",
|
|
70
70
|
"webpack-cli": "^6.0.1"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
@@ -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
|
-
|
|
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:
|
|
@@ -82,9 +82,9 @@
|
|
|
82
82
|
"pega"
|
|
83
83
|
],
|
|
84
84
|
"dependencies": {
|
|
85
|
-
"@pega/cosmos-react-condition-builder": "^8.1
|
|
86
|
-
"@pega/cosmos-react-core": "^8.1
|
|
87
|
-
"@pega/cosmos-react-work": "^8.1
|
|
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": "~0.25.
|
|
111
|
-
"@pega/pcore-pconnect-typedefs": "^4.
|
|
110
|
+
"@pega/custom-dx-components": "~0.25.60",
|
|
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",
|
|
@@ -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';
|
|
@@ -166,9 +167,15 @@ addDebugLog("publish", "", "+");
|
|
|
166
167
|
options.params.push("internal");
|
|
167
168
|
|
|
168
169
|
|
|
169
|
-
|
|
170
|
-
|
|
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
|
|
|
@@ -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
|
|
|
@@ -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;
|
|
@@ -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
|
|
|
@@ -39,19 +39,23 @@ export const showHelpV1 = () => {
|
|
|
39
39
|
console.log(`${chalk.cyan('npm run buildAllComponents')}\tvalidate and build ALL components before publishing, checking for errors`);
|
|
40
40
|
console.log(`${chalk.cyan('npm run rename ')}\trename a component`);
|
|
41
41
|
console.log(`${chalk.cyan('npm run importComponent ')}\timport a component from a path`);
|
|
42
|
+
console.log("");
|
|
42
43
|
console.log(`${chalk.cyan('npm run startStorybook ')}\tstorybook components for testing`);
|
|
44
|
+
console.log(`${chalk.cyan('npm run test')}\t\t\trun component unit tests`);
|
|
43
45
|
|
|
44
|
-
console.log(`\n${chalk.underline(`Local and Server(needs authentication)`)}`);
|
|
46
|
+
console.log(`\n${chalk.underline(`Local and Server (needs authentication)`)}`);
|
|
45
47
|
console.log(`${chalk.cyan('npm run list ')}\tget list of components`);
|
|
46
48
|
console.log(`${chalk.cyan('npm run delete ')}\tdelete a component`);
|
|
47
49
|
console.log(`${chalk.cyan('npm run deleteAll ')}\tdelete ALL components`);
|
|
48
50
|
|
|
49
|
-
console.log(`\n${chalk.underline(`Server(needs authentication)`)}`);
|
|
51
|
+
console.log(`\n${chalk.underline(`Server (needs authentication)`)}`);
|
|
50
52
|
console.log(`${chalk.cyan('npm run publish ')}\tpublish a component to server`);
|
|
51
53
|
console.log(`${chalk.cyan('npm run publishAll ')}\tpublish ALL components to server`);
|
|
52
54
|
|
|
53
55
|
console.log("");
|
|
54
56
|
console.log(`\n${chalk.underline(`Notes`)}`);
|
|
57
|
+
console.log(`${chalk.yellow('>> By choosing to create and use custom components, you agree to keep them up-to-date with every release of Pega Infinity,')}`);
|
|
58
|
+
console.log(`${chalk.yellow('>> as well as meeting compliance standards for data privacy and accessibility.')}\n`);
|
|
55
59
|
console.log(`Cannot publish a component with prefix (Org_Lib) that matches a Rule-UI-ComponentLibrary (libraryModeCL) in same ruleset.`);
|
|
56
60
|
|
|
57
61
|
console.log("");
|
|
@@ -68,7 +72,7 @@ export const showHelpV2 = (isCL) => {
|
|
|
68
72
|
console.log(`\nUsage:`);
|
|
69
73
|
|
|
70
74
|
|
|
71
|
-
console.log(`\n${chalk.underline(`Authenticate`)}`);
|
|
75
|
+
console.log(`\n${chalk.underline(`Authenticate (for Server commands)`)}`);
|
|
72
76
|
console.log(`${chalk.cyan('npm run authenticate')}\t\tauthenticate to a server (required for publish commands)`);
|
|
73
77
|
|
|
74
78
|
console.log(`\n${chalk.underline(`Library`)}`);
|
|
@@ -122,8 +126,10 @@ export const showHelpV2 = (isCL) => {
|
|
|
122
126
|
console.log("");
|
|
123
127
|
|
|
124
128
|
console.log(`\n${chalk.underline(`Notes`)}`);
|
|
129
|
+
console.log(`${chalk.yellow('>> By choosing to create and use custom components, you agree to keep them up-to-date with every release of Pega Infinity,')}`);
|
|
130
|
+
console.log(`${chalk.yellow('>> as well as meeting compliance standards for data privacy and accessibility.')}\n`);
|
|
125
131
|
console.log(`The following commands will store existing version in storage before executing the command:`);
|
|
126
|
-
console.log(`${chalk.cyan(`createLib, switchLib, createLibVersion, switchLibVersion,
|
|
132
|
+
console.log(`${chalk.cyan(`createLib, switchLib, createLibVersion, switchLibVersion, publish, exportLibVersion, storeLibVersion`)}`);
|
|
127
133
|
console.log(`\nWhen editing in an IDE, always ${chalk.yellow("SAVE")} changes to components before doing a library/version context switch`);
|
|
128
134
|
console.log(`or changes will be lost!`);
|
|
129
135
|
console.log(`\nStoring is to LOCAL storage and is not backed up. You should export your library/versions archives to ${chalk.yellow("git")}`);
|
|
@@ -133,7 +139,7 @@ export const showHelpV2 = (isCL) => {
|
|
|
133
139
|
else {
|
|
134
140
|
console.log(`for backup storage.`);
|
|
135
141
|
}
|
|
136
|
-
console.log(`\nIn tasks.config.json, set ${chalk.yellow("libraryModeCL")} to ${chalk.yellow("false")} for original
|
|
142
|
+
console.log(`\nIn tasks.config.json, set ${chalk.yellow("libraryModeCL")} to ${chalk.yellow("false")} for original stand alone components or for ${chalk.yellow("Launchpad")} components.`);
|
|
137
143
|
console.log("");
|
|
138
144
|
}
|
|
139
145
|
|
package/src/util.js
CHANGED
|
@@ -1962,6 +1962,11 @@ if (showDebug) addDebugLog("zipVersionAndArchive", `orgLibName: ${orgLibName}, v
|
|
|
1962
1962
|
const packageJson = join(currentDirectory, PACKAGE_JSON_FILENAME);
|
|
1963
1963
|
const archiveFileName = `${orgLibName}_${version}.arch.zip`;
|
|
1964
1964
|
|
|
1965
|
+
// check if components directory exists and if not, create a blank one
|
|
1966
|
+
const componentsDirectory = join(srcDirectoryPath, "components");
|
|
1967
|
+
if (!fs.existsSync(componentsDirectory)) {
|
|
1968
|
+
fs.mkdirSync(componentsDirectory, { recursive: true });
|
|
1969
|
+
}
|
|
1965
1970
|
|
|
1966
1971
|
// const configContent = Buffer.from(fs.readFileSync(configJson)).toString();
|
|
1967
1972
|
const mainDirectory = process.cwd();
|