@pega/custom-dx-components 0.25.64 → 0.25.65

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.64",
3
+ "version": "0.25.65",
4
4
  "description": "Utility for building custom UI components",
5
5
  "bin": "./bin/index.js",
6
6
  "keywords": [
@@ -13,6 +13,7 @@ import {
13
13
  getComponentDirectoryPath,
14
14
  getComponents,
15
15
  getPegaServerConfig,
16
+ getServerType,
16
17
  sanitize,
17
18
  validateSemver,
18
19
  showVersion,
@@ -37,7 +38,6 @@ const copyComponentTemplate = async options => {
37
38
  });
38
39
  };
39
40
 
40
-
41
41
  const compileMustacheTemplates = async (
42
42
  componentDirectory,
43
43
  {
@@ -306,6 +306,7 @@ addDebugLog("create", "", "+");
306
306
  );
307
307
  } else {
308
308
  const componentDefaults = getConfigDefaults();
309
+ const serverType = getServerType();
309
310
  const maxChars = isLibraryBased ? getMaxComponentNameCount() : getStandaloneMaxComponentNameCount();
310
311
  const questions = [
311
312
  {
@@ -354,7 +355,14 @@ addDebugLog("create", "", "+");
354
355
  },
355
356
  {
356
357
  name: 'componentName',
357
- message: `Enter component name (required) (${maxChars} max chars)`,
358
+ message: value => {
359
+ if (serverType === "launchpad") {
360
+ return `Enter component name (required)`;
361
+ }
362
+ else {
363
+ return `Enter component name (required) (${maxChars} max chars)`;
364
+ }
365
+ },
358
366
  validate: value => {
359
367
  /* value should not be empty
360
368
  It should not have spaces
@@ -362,7 +370,7 @@ addDebugLog("create", "", "+");
362
370
  Only case-insensitive alphanumeric values are allowed
363
371
  */
364
372
  if (value && !/^\d/.test(value) && value === sanitize(value)) {
365
- if (value.length > maxChars) {
373
+ if (value.length > maxChars && serverType != "launchpad") {
366
374
  return `${value.length - maxChars} too many characters.`
367
375
  }
368
376
  return true;
@@ -14,6 +14,7 @@ import { checkPathAccess, showVersion ,
14
14
  compileMustacheTemplate,
15
15
  getComponentDirectoryPath,
16
16
  getPegaServerConfig,
17
+ getServerType,
17
18
  getComponents,
18
19
  sanitize,
19
20
  validateSemver,
@@ -405,17 +406,25 @@ addDebugLog("createAll", "", "+");
405
406
  );
406
407
  } else {
407
408
  const maxPrefixCount = isLibraryBased ? getMaxPrefixCount() : getStandaloneMaxPrefixCount();
409
+ const serverType = getServerType();
408
410
  const questions = [
409
411
  {
410
412
  name: 'prefix',
411
- message: `Enter prefix label (${maxPrefixCount} max chars)`,
413
+ message: value => {
414
+ if (serverType === "launchpad") {
415
+ return `Enter prefix label`;
416
+ }
417
+ else {
418
+ return `Enter prefix label (${maxPrefixCount} max chars)`;
419
+ }
420
+ },
412
421
  validate: value => {
413
422
  /* value should not be empty
414
423
  It should not start with a number
415
424
  Only case-insensitive alphanumeric values are allowed
416
425
  */
417
426
  if (value && !/^\d/.test(value) ) {
418
- if (value.length > maxPrefixCount) {
427
+ if (value.length > maxPrefixCount && serverType != "launchpad") {
419
428
  return `${value.length - maxPrefixCount} too many characters.`
420
429
  }
421
430
  return true;
@@ -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.64",
111
+ "@pega/custom-dx-components": "~0.25.65",
112
112
  "@pega/pcore-pconnect-typedefs": "^4.1.0",
113
113
  "@storybook/addon-actions": "^8.6.14",
114
114
  "@storybook/addon-essentials": "^8.6.14",
package/src/util.js CHANGED
@@ -1327,15 +1327,17 @@ export const showVersion = async () => {
1327
1327
  // get package version, so can display at start
1328
1328
  // const require = createRequire(import.meta.url);
1329
1329
  const require = createRequire(currentPath.default);
1330
- const sLibMode = getLibraryBased() ? "(library mode)" : "";
1330
+ const serverType = getServerType();
1331
+ const sLibMode = getLibraryBased() ? "(library mode)" : serverType === "launchpad" ? "(LaunchPad)" : "";
1331
1332
 
1332
1333
  const pData = require('@pega/custom-dx-components/package.json');
1333
1334
  const serverConfig = await getPegaServerConfig();
1334
1335
 
1336
+
1335
1337
  console.log(chalk.green(`DX Component Builder${sLibMode} v${pData.version}`));
1336
1338
  showDebug = getShowDebug();
1337
1339
 
1338
- if (getLibraryBased() && getServerType() === "launchpad") {
1340
+ if (getLibraryBased() && serverType === "launchpad") {
1339
1341
  console.log(`\nLaunchpad commands only supported for ${chalk.bold.green('non library mode')} components.\n`);
1340
1342
  process.exit();
1341
1343
  }
@@ -2848,6 +2850,11 @@ export const getStandaloneMaxPrefixCount = () => {
2848
2850
  }
2849
2851
 
2850
2852
  export const isComponentValidLength = (componentKey) => {
2853
+ const serverType = getServerType();
2854
+ if (serverType === "launchpad") {
2855
+ return true;
2856
+ }
2857
+
2851
2858
  const configDef = getConfigDefaults();
2852
2859
  const componentName = componentKey.replace(configDef.currentOrgLib + "_", "");
2853
2860
  if (componentName.length <= getMaxComponentNameCount()) {