@pega/dx-component-builder-sdk 0.1.15 → 0.1.17
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 +1 -1
- package/src/cli.js +6 -0
- package/src/constants.js +13 -17
- package/src/tasks/build-all/helper.js +76 -0
- package/src/tasks/build-all/index.js +121 -0
- package/src/tasks/create/index.js +52 -60
- package/src/tasks/create/templates/Constellation/Field/Boolean/demo.stories.jsx.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Field/Date/demo.stories.jsx.mustache +11 -6
- package/src/tasks/create/templates/Constellation/Field/DateTime/demo.stories.jsx.mustache +11 -7
- package/src/tasks/create/templates/Constellation/Field/Decimal/demo.stories.jsx.mustache +7 -7
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/demo.stories.jsx.mustache +9 -8
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/demo.stories.jsx.mustache +7 -7
- package/src/tasks/create/templates/Constellation/Field/Integer/demo.stories.jsx.mustache +7 -7
- package/src/tasks/create/templates/Constellation/Field/Picklist/demo.stories.jsx.mustache +16 -10
- package/src/tasks/create/templates/Constellation/Field/Text/demo.stories.jsx.mustache +9 -7
- package/src/tasks/create/templates/Constellation/Field/Text-Email/demo.stories.jsx.mustache +8 -8
- package/src/tasks/create/templates/Constellation/Field/Text-Input/demo.stories.jsx.mustache +7 -7
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/demo.stories.jsx.mustache +7 -7
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/demo.stories.jsx.mustache +6 -6
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/index.jsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Text-URL/demo.stories.jsx.mustache +6 -6
- package/src/tasks/create/templates/Constellation/Field/Text-URL/index.jsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Text-URL/{text-url.js.mustache → text-url.jsx.mustache} +2 -1
- package/src/tasks/create/templates/Constellation/Field/TimeofDay/demo.stories.jsx.mustache +10 -5
- package/src/tasks/create/templates/Constellation/Template/DETAILS/demo.stories.jsx.mustache +59 -51
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/demo.stories.jsx.mustache +64 -59
- package/src/tasks/create/templates/Constellation/Template/FORM/demo.stories.jsx.mustache +43 -39
- package/src/tasks/create/templates/Constellation/Template/FORM-region/demo.stories.jsx.mustache +46 -46
- package/src/tasks/create/templates/Constellation/Template/PAGE/demo.stories.jsx.mustache +24 -25
- package/src/tasks/create/templates/Constellation/Widget/CASE/demo.stories.jsx.mustache +7 -7
- package/src/tasks/create/templates/Constellation/Widget/CASE/mock.stories.js.mustache +2 -1
- package/src/tasks/create/templates/Constellation/Widget/PAGE/demo.stories.jsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Widget/PAGE/mock.stories.js.mustache +2 -1
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/demo.stories.jsx.mustache +6 -6
- package/src/tasks/create/templates/SDK-React/Field/Date/index.tsx.mustache +2 -2
- package/src/tasks/create/templates/SDK-React/Field/DateTime/index.tsx.mustache +2 -2
- package/src/tasks/create/templates/SDK-React/Field/Decimal/index.tsx.mustache +2 -2
- package/src/tasks/create/templates/SDK-React/Field/Decimal-Currency/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/Field/Decimal-Percentage/index.tsx.mustache +2 -2
- package/src/tasks/create/templates/SDK-React/Field/Integer/index.tsx.mustache +2 -2
- package/src/tasks/create/templates/SDK-React/Field/Text/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/Field/Text-Email/index.tsx.mustache +2 -2
- package/src/tasks/create/templates/SDK-React/Field/Text-Input/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/Field/Text-Paragraph/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/Field/Text-Phone/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/Field/Text-URL/index.tsx.mustache +2 -2
- package/src/tasks/create/templates/SDK-React/Field/TimeofDay/index.tsx.mustache +2 -2
- package/src/tasks/create/templates/SDK-React/Template/DETAILS/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/Template/DETAILS-region/index.tsx.mustache +1 -1
- package/src/tasks/delete/helper.js +1 -0
- package/src/tasks/index.js +1 -0
- package/src/tasks/map/map.js +5 -4
- package/src/tasks/override/index.js +55 -16
- package/src/tasks/validator/index.js +12 -3
- package/src/util.js +18 -32
|
@@ -30,6 +30,15 @@ const allowedSubtypes = [
|
|
|
30
30
|
])
|
|
31
31
|
];
|
|
32
32
|
|
|
33
|
+
// additional subtypes are manually added below
|
|
34
|
+
const allowedOverrideSubtypes = [
|
|
35
|
+
...new Set([
|
|
36
|
+
...COMPONENT_SCHEMA.subtype.field.map(({ value }) => value),
|
|
37
|
+
...COMPONENT_SCHEMA.subtype.template,
|
|
38
|
+
...COMPONENT_SCHEMA.subtype.widget.map(({ value }) => value)
|
|
39
|
+
]), "ACTION", "DATA_CAPTURE", "SUMMARY", "CASEVIEW", "DATAVIEW", "LIST"
|
|
40
|
+
];
|
|
41
|
+
|
|
33
42
|
const schema = {
|
|
34
43
|
type: 'object',
|
|
35
44
|
properties: {
|
|
@@ -183,7 +192,7 @@ const overrideSchema = {
|
|
|
183
192
|
subtype: {
|
|
184
193
|
anyOf: [{ type: 'string' }, { type: 'array' }],
|
|
185
194
|
|
|
186
|
-
enum:
|
|
195
|
+
enum: allowedOverrideSubtypes
|
|
187
196
|
},
|
|
188
197
|
icon: { type: 'string' },
|
|
189
198
|
properties: {
|
|
@@ -300,7 +309,7 @@ const overrideSchema = {
|
|
|
300
309
|
},
|
|
301
310
|
defaultConfig: { type: 'object' }
|
|
302
311
|
},
|
|
303
|
-
required: ['
|
|
312
|
+
required: ['name', 'type', 'subtype', 'properties', 'componentKey'],
|
|
304
313
|
additionalProperties: true
|
|
305
314
|
};
|
|
306
315
|
|
|
@@ -345,7 +354,7 @@ export default async (option, category = CATEGORY_CUSTOM) => {
|
|
|
345
354
|
}
|
|
346
355
|
else if (category === CATEGORY_OVERRIDE) {
|
|
347
356
|
// for now, if now file just end
|
|
348
|
-
console.log(`${chalk.bold.yellow('
|
|
357
|
+
console.log(`${chalk.bold.yellow('Config file not availabe for: ' + componentToValidate)}`);
|
|
349
358
|
return;
|
|
350
359
|
}
|
|
351
360
|
}
|
package/src/util.js
CHANGED
|
@@ -22,22 +22,17 @@ import {
|
|
|
22
22
|
FIELD_PATH,
|
|
23
23
|
WIDGET_PATH,
|
|
24
24
|
TEMPLATE_PATH,
|
|
25
|
-
FORMS_PATH,
|
|
26
|
-
TEMPLATES_PATH,
|
|
27
|
-
WIDGETS_PATH,
|
|
28
25
|
DSE_PATH,
|
|
29
26
|
INFRA_PATH,
|
|
30
27
|
COMPONENT_PREFIX_FIELD_PATH,
|
|
31
28
|
COMPONENT_PREFIX_TEMPLATE_PATH,
|
|
32
29
|
COMPONENT_PREFIX_WIDGET_PATH,
|
|
33
|
-
COMPONENT_PREFIX_FORMS_PATH,
|
|
34
|
-
COMPONENT_PREFIX_TEMPLATES_PATH,
|
|
35
|
-
COMPONENT_PREFIX_WIDGETS_PATH,
|
|
36
30
|
COMPONENT_PREFIX_DSE_PATH,
|
|
37
31
|
COMPONENT_PREFIX_INFRA_PATH,
|
|
38
32
|
CATEGORY_CUSTOM,
|
|
39
33
|
CATEGORY_OVERRIDE,
|
|
40
|
-
CATEGORY_CONSTELLATION
|
|
34
|
+
CATEGORY_CONSTELLATION,
|
|
35
|
+
COMPONENT_DIRECTORY_PREFIX_CUSTOM
|
|
41
36
|
} from './constants.js';
|
|
42
37
|
|
|
43
38
|
|
|
@@ -60,7 +55,7 @@ export const checkPathAccess = async (path, options = {}) => {
|
|
|
60
55
|
export const deleteLocalComponent = async (componentKey, category = CATEGORY_CUSTOM) => {
|
|
61
56
|
const currentDirectory = process.cwd();
|
|
62
57
|
const pegaConfigJsonPath = join(currentDirectory, DXCB_CONFIG_JSON_FILENAME);
|
|
63
|
-
const categoryDirectory = join("/", category.toLowerCase());
|
|
58
|
+
const categoryDirectory = (category === CATEGORY_CONSTELLATION) ? join("/", COMPONENT_DIRECTORY_PREFIX_CUSTOM + category.toLowerCase()) : join("/", category.toLowerCase());
|
|
64
59
|
|
|
65
60
|
await checkPathAccess(pegaConfigJsonPath);
|
|
66
61
|
|
|
@@ -172,7 +167,7 @@ export const getOptionsSource = (options) => {
|
|
|
172
167
|
export const getComponents = async (showSeparator = false, category = CATEGORY_CUSTOM) => {
|
|
173
168
|
const currentDirectory = process.cwd();
|
|
174
169
|
const pegaConfigJsonPath = join(currentDirectory, DXCB_CONFIG_JSON_FILENAME);
|
|
175
|
-
const categoryDirectory = join("/", category.toLowerCase());
|
|
170
|
+
const categoryDirectory = (category === CATEGORY_CONSTELLATION) ? join("/", COMPONENT_DIRECTORY_PREFIX_CUSTOM + category.toLowerCase()) : join("/", category.toLowerCase());
|
|
176
171
|
|
|
177
172
|
await checkPathAccess(pegaConfigJsonPath);
|
|
178
173
|
|
|
@@ -215,14 +210,14 @@ export const getComponents = async (showSeparator = false, category = CATEGORY_C
|
|
|
215
210
|
}
|
|
216
211
|
break;
|
|
217
212
|
case CATEGORY_OVERRIDE:
|
|
218
|
-
const formsComps = await getSubComponents(directory,
|
|
219
|
-
const templatesComps = await getSubComponents(directory,
|
|
220
|
-
const widgetsComps = await getSubComponents(directory,
|
|
213
|
+
const formsComps = await getSubComponents(directory, FIELD_PATH);
|
|
214
|
+
const templatesComps = await getSubComponents(directory, TEMPLATE_PATH);
|
|
215
|
+
const widgetsComps = await getSubComponents(directory, WIDGET_PATH);
|
|
221
216
|
const dseComps = await getSubComponents(directory, DSE_PATH);
|
|
222
217
|
const infraComps = await getSubComponents(directory, INFRA_PATH);
|
|
223
218
|
|
|
224
219
|
if (formsComps.length > 0) {
|
|
225
|
-
if (showSeparator) compList.push(new inquirer.Separator("----
|
|
220
|
+
if (showSeparator) compList.push(new inquirer.Separator("---- fields ----"));
|
|
226
221
|
compList.push(...formsComps);
|
|
227
222
|
}
|
|
228
223
|
|
|
@@ -291,7 +286,7 @@ export const createBlankConfigExt = async (directory, name) => {
|
|
|
291
286
|
export const getComponentsObj = async (showSeparator = false, category = CATEGORY_CUSTOM) => {
|
|
292
287
|
const currentDirectory = process.cwd();
|
|
293
288
|
const pegaConfigJsonPath = join(currentDirectory, DXCB_CONFIG_JSON_FILENAME);
|
|
294
|
-
const categoryDirectory = join("/", category.toLowerCase());
|
|
289
|
+
const categoryDirectory = (category === CATEGORY_CONSTELLATION) ? join("/", COMPONENT_DIRECTORY_PREFIX_CUSTOM + category.toLowerCase()) : join("/", category.toLowerCase());
|
|
295
290
|
|
|
296
291
|
await checkPathAccess(pegaConfigJsonPath);
|
|
297
292
|
|
|
@@ -355,20 +350,20 @@ export const getComponentsObj = async (showSeparator = false, category = CATEGOR
|
|
|
355
350
|
}
|
|
356
351
|
break;
|
|
357
352
|
case CATEGORY_OVERRIDE:
|
|
358
|
-
const formsComps = await getSubComponents(directory,
|
|
359
|
-
const templatesComps = await getSubComponents(directory,
|
|
360
|
-
const widgetsComps = await getSubComponents(directory,
|
|
353
|
+
const formsComps = await getSubComponents(directory, FIELD_PATH);
|
|
354
|
+
const templatesComps = await getSubComponents(directory, TEMPLATE_PATH);
|
|
355
|
+
const widgetsComps = await getSubComponents(directory, WIDGET_PATH);
|
|
361
356
|
const dseComps = await getSubComponents(directory, DSE_PATH);
|
|
362
357
|
const infraComps = await getSubComponents(directory, INFRA_PATH);
|
|
363
358
|
|
|
364
359
|
if (formsComps.length > 0) {
|
|
365
|
-
if (showSeparator) compList.push(new inquirer.Separator("----
|
|
360
|
+
if (showSeparator) compList.push(new inquirer.Separator("---- fields ----"));
|
|
366
361
|
|
|
367
362
|
compList.push(...formsComps.map(
|
|
368
363
|
name => {
|
|
369
364
|
const container = {};
|
|
370
365
|
container.name = name;
|
|
371
|
-
container.value =
|
|
366
|
+
container.value = COMPONENT_PREFIX_FIELD_PATH + name;
|
|
372
367
|
|
|
373
368
|
return container;
|
|
374
369
|
}
|
|
@@ -381,7 +376,7 @@ export const getComponentsObj = async (showSeparator = false, category = CATEGOR
|
|
|
381
376
|
name => {
|
|
382
377
|
const container = {};
|
|
383
378
|
container.name = name;
|
|
384
|
-
container.value =
|
|
379
|
+
container.value = COMPONENT_PREFIX_TEMPLATE_PATH + name;
|
|
385
380
|
|
|
386
381
|
return container;
|
|
387
382
|
}
|
|
@@ -394,7 +389,7 @@ export const getComponentsObj = async (showSeparator = false, category = CATEGOR
|
|
|
394
389
|
name => {
|
|
395
390
|
const container = {};
|
|
396
391
|
container.name = name;
|
|
397
|
-
container.value =
|
|
392
|
+
container.value = COMPONENT_PREFIX_WIDGET_PATH + name;
|
|
398
393
|
|
|
399
394
|
return container;
|
|
400
395
|
}
|
|
@@ -451,7 +446,7 @@ export const getSubComponentsAndDir = async (directory, type) => {
|
|
|
451
446
|
export const getComponentsAndSubDirectory = async (category = CATEGORY_CUSTOM) => {
|
|
452
447
|
const currentDirectory = process.cwd();
|
|
453
448
|
const pegaConfigJsonPath = join(currentDirectory, DXCB_CONFIG_JSON_FILENAME);
|
|
454
|
-
const categoryDirectory = join("/", category.toLowerCase());
|
|
449
|
+
const categoryDirectory = (category === CATEGORY_CONSTELLATION) ? join("/", COMPONENT_DIRECTORY_PREFIX_CUSTOM + category.toLowerCase()) : join("/", category.toLowerCase());
|
|
455
450
|
|
|
456
451
|
await checkPathAccess(pegaConfigJsonPath);
|
|
457
452
|
|
|
@@ -490,15 +485,6 @@ export const removeComponentPrefix = (componentName) => {
|
|
|
490
485
|
else if (componentName.indexOf(COMPONENT_PREFIX_WIDGET_PATH) == 0) {
|
|
491
486
|
componentName = componentName.substring(COMPONENT_PREFIX_WIDGET_PATH.length);
|
|
492
487
|
}
|
|
493
|
-
else if (componentName.indexOf(COMPONENT_PREFIX_FORMS_PATH) == 0) {
|
|
494
|
-
componentName = componentName.substring(COMPONENT_PREFIX_FORMS_PATH.length);
|
|
495
|
-
}
|
|
496
|
-
else if (componentName.indexOf(COMPONENT_PREFIX_TEMPLATES_PATH) == 0) {
|
|
497
|
-
componentName = componentName.substring(COMPONENT_PREFIX_TEMPLATES_PATH.length);
|
|
498
|
-
}
|
|
499
|
-
else if (componentName.indexOf(COMPONENT_PREFIX_WIDGETS_PATH) == 0) {
|
|
500
|
-
componentName = componentName.substring(COMPONENT_PREFIX_WIDGETS_PATH.length);
|
|
501
|
-
}
|
|
502
488
|
else if (componentName.indexOf(COMPONENT_PREFIX_DSE_PATH) == 0) {
|
|
503
489
|
componentName = componentName.substring(COMPONENT_PREFIX_DSE_PATH.length);
|
|
504
490
|
}
|
|
@@ -535,7 +521,7 @@ export const getComponentDefaults = async () => {
|
|
|
535
521
|
export const getComponentDirectoryPath = async (componentKey, category = CATEGORY_CUSTOM) => {
|
|
536
522
|
const currentDirectory = process.cwd();
|
|
537
523
|
const pegaConfigJsonPath = join(currentDirectory, DXCB_CONFIG_JSON_FILENAME);
|
|
538
|
-
const categoryDirectory = join("/", category.toLowerCase());
|
|
524
|
+
const categoryDirectory = (category === CATEGORY_CONSTELLATION) ? join("/", COMPONENT_DIRECTORY_PREFIX_CUSTOM + category.toLowerCase()) : join("/", category.toLowerCase());
|
|
539
525
|
|
|
540
526
|
await checkPathAccess(pegaConfigJsonPath);
|
|
541
527
|
|