@pega/custom-dx-components 24.2.13 → 24.2.15

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": "24.2.13",
3
+ "version": "24.2.15",
4
4
  "description": "Utility for building custom UI components",
5
5
  "bin": "./bin/index.js",
6
6
  "scripts": {
@@ -101,7 +101,7 @@
101
101
  },
102
102
  "devDependencies": {
103
103
  "@pega/configs": "^0.15.1",
104
- "@pega/custom-dx-components": "~24.2.13",
104
+ "@pega/custom-dx-components": "~24.2.15",
105
105
  "@pega/pcore-pconnect-typedefs": "3.2.1",
106
106
  "@storybook/addon-actions": "^7.6.19",
107
107
  "@storybook/addon-essentials": "^7.6.19",
@@ -315,11 +315,13 @@ const validateOverideSchema = ajv.compile(overrideSchema);
315
315
 
316
316
 
317
317
  export default async (option) => {
318
- // addDebugLog("validate","", "");
318
+ // addDebugLog("validate","", "");
319
319
 
320
320
  let componentToValidate = null;
321
+ let throwTheError = false;
321
322
  if (option.params && option.params[3]) {
322
323
  componentToValidate = option.params[3];
324
+ throwTheError = true;
323
325
  } else if (option && option.task === 'validateSchema') {
324
326
  const localComponents = await getComponents();
325
327
  const answer = await inquirer.prompt({
@@ -332,8 +334,10 @@ export default async (option) => {
332
334
  componentToValidate = answer.component;
333
335
  } else if (option.name) {
334
336
  componentToValidate = option.value;
337
+ throwTheError = true;
335
338
  } else {
336
339
  componentToValidate = option;
340
+ throwTheError = true;
337
341
  }
338
342
 
339
343
  const componentDirectory = await getComponentDirectoryPath(componentToValidate);
@@ -369,13 +373,14 @@ export default async (option) => {
369
373
  componentToValidate &&
370
374
  !/^[A-Za-z0-9]+_[A-Za-z0-9]+_[A-Za-z0-9]+$/.test(componentToValidate)
371
375
  ) {
372
- const ootbComponents = await getOOTBComponents();
373
- if (ootbComponents.includes(componentToValidate)) {
374
- throw new Error(`Invalid: Error occurred in validating ${componentToValidate}`);
375
- }
376
- }
377
376
 
377
+ if (throwTheError) {
378
+ throw new Error (`${chalk.redBright(`Error: Invalid name of component '${componentToValidate}' .\n Component name (and component folder) MUST be of the form: 'Org_Lib_ComponentName'.`)}`);
378
379
 
380
+ }
381
+ console.log(`${chalk.redBright(`Error: Invalid name of component '${componentToValidate}' .\n Component name (and component folder) MUST be of the form: 'Org_Lib_ComponentName'.`)}`);
382
+ process.exit(1);
383
+ }
379
384
 
380
385
  console.log(`${chalk.bold.green(componentToValidate)} schema is valid`);
381
386
  } else {
package/src/util.js CHANGED
@@ -1453,7 +1453,8 @@ if (showDebug) addDebugLog("updateC11NB2SForInfinity", "", "");
1453
1453
 
1454
1454
  const objOauthData = JSON.parse(OAuthData);
1455
1455
  objOauthData["C11NB2S"] = bootstrap.tokens.C11NB2S;
1456
- objOauthData["appStaticContentServer"] = bootstrap.serviceConfig.appStaticContentServer;
1456
+ // objOauthData["appStaticContentServer"] = bootstrap.serviceConfig.appStaticContentServer;
1457
+ objOauthData["appStaticContentServer"] = (bootstrap.serviceConfig.appStaticContentServer != "no-cdn" && bootstrap.serviceConfig.appStaticContentServer != "") ? bootstrap.serviceConfig.appStaticContentServer : bootstrap.serviceConfig.staticContentServer;
1457
1458
 
1458
1459
  // write out file
1459
1460
  fs.writeFileSync(TOKEN_PATH, JSON.stringify(objOauthData), { encoding: 'utf8',flag:'w' });