@pega/custom-dx-components 2.0.23 → 8.5.1
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 -2
- package/src/auth.js +20 -10
- package/src/cli.js +18 -0
- package/src/constants.js +35 -1
- package/src/tasks/authenticate/helper.js +39 -14
- package/src/tasks/authenticate/index.js +101 -48
- package/src/tasks/build/helper.js +3 -3
- package/src/tasks/build-all/helper.js +69 -0
- package/src/tasks/build-all/index.js +79 -0
- package/src/tasks/create/templates/Constellation/Field/Boolean/styles.js.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Date/styles.js.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/DateTime/styles.js.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Decimal/styles.js.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/styles.js.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/styles.js.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Integer/styles.js.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Picklist/styles.js.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Text/config.json.mustache +14 -0
- package/src/tasks/create/templates/Constellation/Field/Text/styles.js.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Text-Email/styles.js.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Text-Input/styles.js.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/styles.js.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/styles.js.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Text-URL/styles.js.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/TimeofDay/styles.js.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Template/DETAILS/styles.js.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/styles.js.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Template/FORM/styles.js.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Template/FORM-region/index.jsx.mustache +4 -1
- package/src/tasks/create/templates/Constellation/Template/FORM-region/styles.js.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Template/PAGE/styles.js.mustache +1 -1
- package/src/tasks/create-all/index.js +400 -0
- package/src/tasks/index.js +3 -0
- package/src/tasks/init/template/package.json.mustache +5 -2
- package/src/tasks/init/template/tasks.config.json +15 -6
- package/src/tasks/list/helper.js +19 -6
- package/src/tasks/publish/helper.js +3 -3
- package/src/tasks/publish-all/helper.js +20 -6
- package/src/tasks/publish-all/index.js +29 -18
- package/src/tasks/rename/index.js +315 -0
- package/src/tasks/validator/index.js +182 -7
- package/src/util.js +66 -3
- package/src/tasks/create/template/config.json.mustache +0 -62
- package/src/tasks/create/template/demo.stories.jsx.mustache +0 -44
- package/src/tasks/create/template/index.jsx.mustache +0 -55
- package/src/tasks/create/template/styles.js.mustache +0 -7
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import inquirer from 'inquirer';
|
|
2
|
+
import Listr from 'listr';
|
|
3
|
+
import chalk from 'chalk';
|
|
4
|
+
|
|
5
|
+
import validate from '../validator/index.js';
|
|
6
|
+
|
|
7
|
+
import bundleComponent from '../bundle/index.js';
|
|
8
|
+
import lintComponent from '../linter/index.js';
|
|
9
|
+
import { getBuildComponentQuestions, cleanUp } from './helper.js';
|
|
10
|
+
import { getComponentDirectoryPath, showVersion, getComponentsObj } from '../../util.js';
|
|
11
|
+
|
|
12
|
+
import { CATEGORY_CONSTELLATION } from '../../constants.js';
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
export function getCustomTasks(componentKey, sourceMap, devBuild) {
|
|
16
|
+
|
|
17
|
+
const customTasks = new Listr(
|
|
18
|
+
[
|
|
19
|
+
{
|
|
20
|
+
title: 'Validate config schema',
|
|
21
|
+
task: async () => {
|
|
22
|
+
await validate(componentKey);
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
title: 'Lint component',
|
|
27
|
+
task: async () => {
|
|
28
|
+
const targetDirectory = await getComponentDirectoryPath(componentKey);
|
|
29
|
+
// console.log(`in buildComponent Lint component task: componentKey: ${componentKey} targetDirectory: ${targetDirectory}`);
|
|
30
|
+
await lintComponent(targetDirectory);
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
title: 'Bundle component',
|
|
35
|
+
task: async () => await bundleComponent(componentKey, sourceMap, devBuild),
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
{
|
|
39
|
+
exitOnError: true
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
return customTasks;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
export default async options => {
|
|
50
|
+
showVersion();
|
|
51
|
+
|
|
52
|
+
let category = CATEGORY_CONSTELLATION;
|
|
53
|
+
|
|
54
|
+
const components = await getComponentsObj();
|
|
55
|
+
const questions = await getBuildComponentQuestions();
|
|
56
|
+
const answers = await inquirer.prompt(questions);
|
|
57
|
+
const { sourceMap, devBuild } = answers;
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
var componentKey;
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
for (var index in components) {
|
|
65
|
+
componentKey = components[index].value;
|
|
66
|
+
console.log(chalk.bold.green("Building: " + components[index].name));
|
|
67
|
+
|
|
68
|
+
let myCustomTasks = getCustomTasks(componentKey, sourceMap, devBuild );
|
|
69
|
+
|
|
70
|
+
await myCustomTasks.run().catch(err => {
|
|
71
|
+
console.log(chalk.bold.red(err.toString()));
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
cleanUp();
|
|
77
|
+
|
|
78
|
+
return true;
|
|
79
|
+
};
|
|
@@ -37,6 +37,20 @@
|
|
|
37
37
|
"name": "required",
|
|
38
38
|
"label": "Required",
|
|
39
39
|
"format": "REQUIRED"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"label": "Advanced",
|
|
43
|
+
"format": "GROUP",
|
|
44
|
+
"collapsible": true,
|
|
45
|
+
"properties": [
|
|
46
|
+
{
|
|
47
|
+
"name": "testId",
|
|
48
|
+
"label": "Test ID",
|
|
49
|
+
"format": "TEXT",
|
|
50
|
+
"ignorePattern": "[^-_\\p{N}\\p{L}]",
|
|
51
|
+
"includeAnnotations": false
|
|
52
|
+
}
|
|
53
|
+
]
|
|
40
54
|
}
|
|
41
55
|
],
|
|
42
56
|
"defaultConfig": {
|
|
@@ -19,13 +19,16 @@ export default function {{COMPONENT_CLASS_NAME}}(props) {
|
|
|
19
19
|
gridContainer.cols = gridRepeat;
|
|
20
20
|
gridContainer.alignItems = 'start';
|
|
21
21
|
|
|
22
|
+
const flexContainer = {direction: 'column'};
|
|
23
|
+
flexContainer.gap = 2;
|
|
24
|
+
|
|
22
25
|
return (
|
|
23
26
|
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
24
27
|
{{! pick new delimiteres for mustache }}
|
|
25
28
|
{{=<% %>=}}
|
|
26
29
|
<Grid container={gridContainer}>
|
|
27
30
|
{children.map((child, i) => (
|
|
28
|
-
<Flex container={
|
|
31
|
+
<Flex container={flexContainer} key={`r-${i + 1}`}>
|
|
29
32
|
{child}
|
|
30
33
|
</Flex>
|
|
31
34
|
))}
|