@pega/custom-dx-components 25.1.10-alpha-0.6 → 25.1.10-alpha-0.8

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
@@ -14,7 +14,7 @@ Ensure you have access to the following in your system:
14
14
 
15
15
  - System node version >= 22.15.0
16
16
 
17
- - System npm version 10
17
+ - System npm version 10.9.2
18
18
 
19
19
  ## Latest Documentation
20
20
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/custom-dx-components",
3
- "version": "25.1.10-alpha-0.6",
3
+ "version": "25.1.10-alpha-0.8",
4
4
  "description": "Utility for building custom UI components",
5
5
  "bin": "./bin/index.js",
6
6
  "scripts": {
@@ -19,7 +19,7 @@
19
19
  "@babel/plugin-transform-class-properties": "^7.27.1",
20
20
  "@babel/preset-react": "^7.27.1",
21
21
  "@pega/auth": "^0.2.24",
22
- "@pega/constellation-dx-components-build-utils": "^2.0.6",
22
+ "@pega/constellation-dx-components-build-utils": "^2.0.7",
23
23
  "@pega/inquirer-fuzzy-path": "^3.0.0",
24
24
  "ajv": "^8.17.1",
25
25
  "ajv-keywords": "^5.1.0",
@@ -89,6 +89,7 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = (args: any) => {
89
89
  />
90
90
  );
91
91
  }
92
+ return <></>;
92
93
  },
93
94
  ignoreSuggestion: () => {/* nothing */},
94
95
  acceptSuggestion: () => {/* nothing */},
@@ -122,7 +122,8 @@ addDebugLog("fetchComponenLibrariessFromInfinity", `apiUrl: ${apiUrl}`, "");
122
122
  });
123
123
  }
124
124
 
125
- export const getInfinityLibraries = async(rulesetName, rulesetVersion) => {
125
+ // const getInfinityLibraries = async(rulesetName, rulesetVersion) => {
126
+ export const getInfinityLibraries = async() => {
126
127
  addDebugLog("getInfinityLibraries", '', "");
127
128
 
128
129
  const { app_name, app_version } = await getApplicationAndVersionFromToken();
@@ -140,10 +141,9 @@ addDebugLog("getInfinityLibraries", '', "");
140
141
 
141
142
  // inquire
142
143
 
143
- let urlParams = `/app-name/${ApplicationName}/app-version/${ApplicationVersion}/rulesetname/${rulesetName}/rulesetversion/${rulesetVersion}`;
144
- //let urlParams = `&ApplicationName=${ApplicationName}&ApplicationVersion=${ApplicationVersion}&RulesetName=${rulesetName}&RulesetVersion=${rulesetVersion}`;
145
- //urlParams = encodeURIComponent(urlParams);
146
-
144
+ // want to get a list of all for application, so make ruleset/version blank
145
+ let urlParams = `/app-name/${ApplicationName}/app-version/${ApplicationVersion}/rulesetname/""/rulesetversion/""`;
146
+ // let urlParams = `/app-name/${ApplicationName}/app-version/${ApplicationVersion}/rulesetname/${rulesetName}/rulesetversion/${rulesetVersion}`;
147
147
 
148
148
  url = url.concat(urlParams);
149
149
 
@@ -3,7 +3,7 @@ import ora from 'ora';
3
3
 
4
4
  import chalk from 'chalk';
5
5
 
6
- import { showVersion, getC11NB2STokenAndStaticServer, getLocalLibraryVersions, getLibraryBased, deleteLocalLibrary, deleteLocalLibraryVersion, addDebugLog, getConfigDefaults, getLibraryBasedCL, getPegaServerConfig, deleteInfinityServerComponentLibrary, checkAccessTokenExpiration } from '../../util.js';
6
+ import { showVersion, getC11NB2STokenAndStaticServer, getLocalLibraryVersions, getLibraryBased, deleteLocalLibrary, deleteLocalLibraryVersion, addDebugLog, getConfigDefaults, getLibraryBasedCL, getPegaServerConfig, deleteInfinityServerComponentLibrary, checkAccessTokenExpiration, getApplicationAndVersionFromToken } from '../../util.js';
7
7
  import { deleteLib } from '@pega/constellation-dx-components-build-utils/index.js';
8
8
 
9
9
  import { getDeleteLibraryQuestions, getLibraryVersionQuestion, getRulesetAndVersionQuestion, SOURCE_OF_COMPONENT_TYPES, getInfinityLibraries } from './helper.js';
@@ -94,19 +94,27 @@ addDebugLog("deletePublished", "END", "-");
94
94
  if (isLibraryBasedCL) {
95
95
 
96
96
  const serverConfg = await getPegaServerConfig();
97
+ const { app_name, app_version } = await getApplicationAndVersionFromToken();
97
98
 
98
99
  console.log();
99
100
  console.log(`Current server: ${chalk.green.bold(`${serverConfg.server}`)}`);
101
+ console.log(`List of libraries for Application: ${chalk.green.bold(`${app_name} - ${app_version}`)}`);
102
+ console.log(chalk.bold.yellow(`>> Caution...`));
103
+ console.log(chalk.bold.yellow(`>> This list may contain built on libraries if your application is built on an application.`));
104
+ console.log(chalk.bold.yellow(`>> Deleting built on libraries may cause issues with built on application.`));
100
105
 
101
- const questions = await getRulesetAndVersionQuestion(serverConfg);
102
- const answers = await inquirer.prompt(questions);
103
- const { rulesetName, rulesetVersion } = answers;
104
106
 
105
- const arLibs = await getInfinityLibraries(rulesetName, rulesetVersion);
107
+ // want to get all in application, so ignore ruleset/version questions
108
+ // const questions = await getRulesetAndVersionQuestion(serverConfg);
109
+ // const answers = await inquirer.prompt(questions);
110
+ // const { rulesetName, rulesetVersion } = answers;
111
+
112
+ // const arLibs = await getInfinityLibraries(rulesetName, rulesetVersion);
113
+ const arLibs = await getInfinityLibraries();
106
114
 
107
115
  if (arLibs && arLibs.pxResults && arLibs.pxResults.length > 0) {
108
116
 
109
- const libs = arLibs.pxResults.map((oLib, index) => ({ name: oLib.pyLabel, value: oLib.pyRuleName}));
117
+ const libs = arLibs.pxResults.map((oLib, index) => ({ name: oLib.pyLabel + " (" + oLib.pyRuleSet + ":" + oLib.pyRuleSetVersion + ")", value: index}));
110
118
 
111
119
  const libAnswers = await inquirer.prompt([
112
120
  {
@@ -117,7 +125,9 @@ addDebugLog("deletePublished", "END", "-");
117
125
  }
118
126
  ]);
119
127
 
120
- const libraryName = libAnswers.library;
128
+ const libraryName = arLibs.pxResults[libAnswers.library].pyRuleName;
129
+ const rulesetName = arLibs.pxResults[libAnswers.library].pyRuleSet;
130
+ const rulesetVersion = arLibs.pxResults[libAnswers.library].pyRuleSetVersion;
121
131
  // let spinner;
122
132
 
123
133
 
@@ -138,8 +148,10 @@ addDebugLog("deletePublished", "END", "-");
138
148
  else {
139
149
  // No library with that name
140
150
  const serverConfig = await getPegaServerConfig();
141
- console.log(chalk.redBright(`No server component libraries exist in given ruleset ${chalk.bold(`${rulesetName}:${rulesetVersion}`)}`));
142
- addDebugLog("listPublished", "END", "-");
151
+ // console.log(chalk.redBright(`No server component libraries exist in given ruleset ${chalk.bold(`${rulesetName}:${rulesetVersion}`)}`));
152
+ console.log(chalk.redBright(`No server component libraries exist in given application`));
153
+
154
+ addDebugLog("listPublished", "END", "-");
143
155
  process.exit(1);
144
156
 
145
157
  }
@@ -14,7 +14,7 @@ Ensure you have access to the following in your system:
14
14
 
15
15
  - System node version >= 22.15.0
16
16
 
17
- - System npm version 10
17
+ - System npm version 10.9.2
18
18
 
19
19
  ## Latest Documentation
20
20
 
@@ -108,7 +108,7 @@
108
108
  "@babel/preset-react": "^7.27.1",
109
109
  "@babel/preset-typescript": "^7.27.1",
110
110
  "@pega/configs": "^0.16.3",
111
- "@pega/custom-dx-components": "~25.1.10-alpha-0.6",
111
+ "@pega/custom-dx-components": "~25.1.10-alpha-0.8",
112
112
  "@pega/pcore-pconnect-typedefs": "^4.1.0-alpha.1",
113
113
  "@storybook/addon-actions": "^8.6.14",
114
114
  "@storybook/addon-essentials": "^8.6.14",
@@ -136,10 +136,13 @@ addDebugLog("getInfinityLibraries", '', "");
136
136
 
137
137
  const ApplicationName = app_name;
138
138
  const ApplicationVersion = app_version;
139
- const rulesetName = defaultPegaServerConfig.rulesetName;
140
- const rulesetVersion = defaultPegaServerConfig.rulesetVersion;
139
+ // const rulesetName = defaultPegaServerConfig.rulesetName;
140
+ // const rulesetVersion = defaultPegaServerConfig.rulesetVersion;
141
+ // let urlParams = `/app-name/${ApplicationName}/app-version/${ApplicationVersion}/rulesetname/${rulesetName}/rulesetversion/${rulesetVersion}`;
142
+
143
+ // currently want to get all published libraries for an application, so make ruleset/version blank
144
+ let urlParams = `/app-name/${ApplicationName}/app-version/${ApplicationVersion}/rulesetname/""/rulesetversion/""`;
141
145
 
142
- let urlParams = `/app-name/${ApplicationName}/app-version/${ApplicationVersion}/rulesetname/${rulesetName}/rulesetversion/${rulesetVersion}`;
143
146
 
144
147
  url = url.concat(urlParams);
145
148
 
@@ -158,21 +158,22 @@ addDebugLog("listPublished", "END", "-");
158
158
 
159
159
  if (arLibs && arLibs.pxResults && arLibs.pxResults.length > 0) {
160
160
 
161
- const libs = arLibs.pxResults.map((oLib, index) => ({ name: oLib.pyLabel, value: index}));
161
+ // const libs = arLibs.pxResults.map((oLib, index) => ({ name: oLib.pyLabel, value: index}));
162
+ const libs = arLibs.pxResults.map((oLib, index) => ({ name: oLib.pyLabel + " (" + oLib.pyRuleSet + ":" + oLib.pyRuleSetVersion + ")", value: index}));
162
163
 
163
164
 
164
165
  const {app_name, app_version } = await getApplicationAndVersionFromToken();
165
166
  const serverConfig = await getPegaServerConfig();
166
167
  console.log(`\nServer ${chalk.green.bold(`${serverConfig.server}`)}.`);
167
- console.log(chalk.green(`List of libraries for Application: ${chalk.bold.green(`${app_name} - ${app_version}`)}`));
168
- console.log(`in ruleset: ${chalk.green.bold(`${serverConfig.rulesetName}:${serverConfig.rulesetVersion}`)}`);
168
+ console.log(`List of libraries (including built on) for Application: ${chalk.bold.green(`${app_name} - ${app_version}`)}`);
169
+ // console.log(`in ruleset: ${chalk.green.bold(`${serverConfig.rulesetName}:${serverConfig.rulesetVersion}`)}`);
169
170
 
170
171
 
171
172
  const libAnswers = await inquirer.prompt([
172
173
  {
173
174
  name: 'library',
174
175
  type: 'rawlist',
175
- message: 'Pick library',
176
+ message: 'Pick component library',
176
177
  choices: libs
177
178
  }
178
179
  ]);
@@ -22,7 +22,8 @@ import {
22
22
  getConfigDefaults,
23
23
  getInputConfigForCommand,
24
24
  convertYNToBoolean,
25
- checkForBranch } from '../../util.js';
25
+ checkForBranch,
26
+ applyPegaData } from '../../util.js';
26
27
 
27
28
  import { getPublishComponentQuestions, publishComponentToServer, zipComponent } from './helper.js';
28
29
  import { default as buildLibrary } from '../build-lib/index.js';
@@ -61,9 +62,12 @@ addDebugLog("publish", "", "+");
61
62
  // const currentVersion = devBuild ? `${orgLib.version}-dev`: orgLib.version;
62
63
  const currentVersion = orgLib.buildVersion;
63
64
  const serverConfg = await getPegaServerConfig();
65
+ let configJson = {};
66
+ await applyPegaData(configJson);
64
67
 
65
68
  console.log();
66
69
  console.log(`Publishing to server: ${chalk.green.bold(`${serverConfg.server}`)}`);
70
+ console.log(`Cosmos version: ${chalk.green.bold(`${configJson.packageCosmosVersion}`)}`);
67
71
 
68
72
  if (useInputConfig) {
69
73
  const inputConfig = await getInputConfigForCommand("publish");
@@ -7,7 +7,8 @@ import {
7
7
  getComponents,
8
8
  checkLibraryAndArchives,
9
9
  getPegaServerConfig,
10
- getLibraryBasedCL } from '../../util.js';
10
+ getLibraryBasedCL,
11
+ applyPegaData } from '../../util.js';
11
12
 
12
13
  export const showCurrentStatus = async () => {
13
14
 
@@ -15,7 +16,7 @@ export const showCurrentStatus = async () => {
15
16
  const componentList = await getComponents();
16
17
  const isLibraryBased = getLibraryBased();
17
18
  const isLibraryBasedCL = getLibraryBasedCL();
18
- const pegaServer = await getPegaServerConfig();
19
+ const pegaServer = await getPegaServerConfig(true);
19
20
 
20
21
  console.log("");
21
22
  console.log("\tCurrent status");
@@ -89,6 +89,7 @@ export const BasePegaDxilMyPage: Story = (args: any) => {
89
89
  />
90
90
  );
91
91
  }
92
+ return <></>;
92
93
  },
93
94
  ignoreSuggestion: () => {/* nothing */},
94
95
  acceptSuggestion: () => {/* nothing */},
@@ -89,6 +89,7 @@ export const BasePegaDxilMyPage: Story = (args: any) => {
89
89
  />
90
90
  );
91
91
  }
92
+ return <></>;
92
93
  },
93
94
  ignoreSuggestion: () => {/* nothing */},
94
95
  acceptSuggestion: () => {/* nothing */},
@@ -89,6 +89,7 @@ export const BasePegaDxilMyPage: Story = (args: any) => {
89
89
  />
90
90
  );
91
91
  }
92
+ return <></>;
92
93
  },
93
94
  ignoreSuggestion: () => {/* nothing */},
94
95
  acceptSuggestion: () => {/* nothing */},