@pega/custom-dx-components 24.2.13 → 24.2.14
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
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
},
|
|
102
102
|
"devDependencies": {
|
|
103
103
|
"@pega/configs": "^0.15.1",
|
|
104
|
-
"@pega/custom-dx-components": "~24.2.
|
|
104
|
+
"@pega/custom-dx-components": "~24.2.14",
|
|
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 {
|