@pega/custom-dx-components 0.25.41 → 0.25.43

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/custom-dx-components",
3
- "version": "0.25.41",
3
+ "version": "0.25.43",
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.5",
22
+ "@pega/constellation-dx-components-build-utils": "^2.0.6",
23
23
  "@pega/inquirer-fuzzy-path": "^3.0.0",
24
24
  "ajv": "^8.17.1",
25
25
  "ajv-keywords": "^5.1.0",
@@ -3,7 +3,9 @@ import chalk from 'chalk';
3
3
 
4
4
  import {
5
5
  showVersion,
6
+ getLibraryBased,
6
7
  getConfigDefaults,
8
+ checkLibraryAndArchives,
7
9
  getConfigDevServerPort
8
10
  } from '../../util.js';
9
11
 
@@ -15,12 +17,22 @@ import {
15
17
 
16
18
 
17
19
  await showVersion();
20
+
21
+
22
+ const isLibraryBased = getLibraryBased();
23
+ if (!isLibraryBased) {
24
+ console.log(`Command only supported for ${chalk.bold.green('library mode')} components.`);
25
+ process.exit();
26
+ }
27
+
28
+ await checkLibraryAndArchives();
29
+
18
30
  const devPort = await getConfigDevServerPort();
19
31
  const confDef = getConfigDefaults();
20
32
 
21
33
  console.log("");
22
34
  console.log(`Debugging Library: ${chalk.bold.green(`${confDef.currentOrgLib}/${confDef.version}`)}`);
23
- console.log(`Starting dev server: ${chalk.bold.green(`http://localhost:${confDef.devServerPort}`)}\n`);
35
+ console.log(`Starting dev server: ${chalk.bold.green(`http://localhost:${confDef.devServerPort}/`)}\n`);
24
36
  console.log(chalk.yellow(`Be sure you have your PegaInfinity Operator using the above URL.`));
25
37
  console.log("");
26
38
 
@@ -380,9 +380,25 @@ export const importArch = async(filePath, fileName, hadArchive) => {
380
380
 
381
381
 
382
382
  if (hadArchive) {
383
- console.log(`\n${chalk.green(`${fileName}`)} has been imported!`);
384
- console.log(`You can switch to ${chalk.green(`${orgLibName}/${version}`)} via npm run switchLib.`);
385
- console.log("");
383
+
384
+ if (orgLibName === configDef.currentOrgLib && version === configDef.version) {
385
+ console.log(`\n${chalk.green(`${fileName}`)} has been imported!`);
386
+ console.log(`It is the same library/version as your current source.`);
387
+ console.log(`--> You can retrieve and replace current source via ${chalk.green(`npm run restoreLibVersion`)}.`);
388
+ console.log("\n");
389
+ }
390
+ else if (orgLibName === configDef.currentOrgLib && version != configDef.version) {
391
+ console.log(`\n${chalk.green(`${fileName}`)} has been imported!`);
392
+ console.log(`--> You can switch to ${chalk.green(`${orgLibName}/${version}`)} via ${chalk.green(`npm run switchLibVersion`)}.`);
393
+ console.log("\n");
394
+ }
395
+ else {
396
+ console.log(`\n${chalk.green(`${fileName}`)} has been imported!`);
397
+ console.log(`--> You can switch to ${chalk.green(`${orgLibName}/${version}`)} via ${chalk.green(`npm run switchLib`)}.`);
398
+ console.log("\n");
399
+ }
400
+
401
+
386
402
  }
387
403
  else {
388
404
  const switchToFileName = `${orgLibName}_${version}.arch.zip`;
@@ -578,9 +594,23 @@ addDebugLog("importArch", `filePath: ${filePath}, fileName: ${fileName}`, "");
578
594
 
579
595
 
580
596
  if (hadArchive) {
581
- console.log(`\n${chalk.green(`${fileName}`)} has been imported!`);
582
- console.log(`You can switch to ${chalk.green(`${orgLibName}/${version}`)} via npm run switchLib.`);
583
- console.log("");
597
+ if (orgLibName === configDef.currentOrgLib && version === configDef.version) {
598
+ console.log(`\n${chalk.green(`${fileName}`)} has been imported!`);
599
+ console.log(`It is the same library/version as your current source.`);
600
+ console.log(`--> You can retrieve and replace current source via ${chalk.green(`npm run restoreLibVersion`)}.`);
601
+ console.log("\n");
602
+ }
603
+ else if (orgLibName === configDef.currentOrgLib && version != configDef.version) {
604
+ console.log(`\n${chalk.green(`${fileName}`)} has been imported!`);
605
+ console.log(`--> You can switch to ${chalk.green(`${orgLibName}/${version}`)} via ${chalk.green(`npm run switchLibVersion`)}.`);
606
+ console.log("\n");
607
+ }
608
+ else {
609
+ console.log(`\n${chalk.green(`${fileName}`)} has been imported!`);
610
+ console.log(`--> You can switch to ${chalk.green(`${orgLibName}/${version}`)} via ${chalk.green(`npm run switchLib`)}.`);
611
+ console.log("\n");
612
+ }
613
+
584
614
  }
585
615
  else {
586
616
  const switchToFileName = `${orgLibName}_${version}.arch.zip`;
@@ -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": "~0.25.41",
111
+ "@pega/custom-dx-components": "~0.25.43",
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",
@@ -116,7 +116,7 @@ export const showHelpV2 = (isCL) => {
116
116
  console.log(`${chalk.cyan('npm run startStorybook')}\t\tstorybook components for testing`);
117
117
  console.log(`${chalk.cyan('npm run test')}\t\t\trun component unit tests`);
118
118
  if (isCL) {
119
- console.log(`${chalk.cyan('npm run startDevServer')}\t\tdebug runtime with VS Code break points using a local component server`);
119
+ console.log(`${chalk.cyan('npm run startDevServer')}\t\tdebug runtime with browser break points using a local component server`);
120
120
  }
121
121
 
122
122
  console.log("");
package/src/util.js CHANGED
@@ -2232,6 +2232,11 @@ if (showDebug) addDebugLog("updateComponentTaskConfig", "", "");
2232
2232
  originalContentsData["server-config"].devBuild = contentsData["server-config"].devBuild;
2233
2233
  originalContentsData["component"] = contentsData["component"];
2234
2234
 
2235
+ // if we don't have a devServerPort, add the default
2236
+ if (originalContentsData["server-config"].devServerPort === undefined) {
2237
+ originalContentsData["server-config"].devServerPort = "3030"
2238
+ }
2239
+
2235
2240
  fs.writeFileSync(currentConfigPath, JSON.stringify(originalContentsData, null, 4), { encoding: 'utf8',flag:'w' });
2236
2241
 
2237
2242
  }