@pega/custom-dx-components 2.0.23 → 8.8.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.
Files changed (46) hide show
  1. package/package.json +1 -2
  2. package/src/auth.js +20 -10
  3. package/src/cli.js +18 -0
  4. package/src/constants.js +35 -1
  5. package/src/tasks/authenticate/helper.js +39 -14
  6. package/src/tasks/authenticate/index.js +101 -48
  7. package/src/tasks/build/helper.js +3 -3
  8. package/src/tasks/build-all/helper.js +69 -0
  9. package/src/tasks/build-all/index.js +79 -0
  10. package/src/tasks/create/templates/Constellation/Field/Boolean/styles.js.mustache +1 -1
  11. package/src/tasks/create/templates/Constellation/Field/Date/styles.js.mustache +1 -1
  12. package/src/tasks/create/templates/Constellation/Field/DateTime/styles.js.mustache +1 -1
  13. package/src/tasks/create/templates/Constellation/Field/Decimal/styles.js.mustache +1 -1
  14. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/styles.js.mustache +1 -1
  15. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/styles.js.mustache +1 -1
  16. package/src/tasks/create/templates/Constellation/Field/Integer/styles.js.mustache +1 -1
  17. package/src/tasks/create/templates/Constellation/Field/Picklist/styles.js.mustache +1 -1
  18. package/src/tasks/create/templates/Constellation/Field/Text/config.json.mustache +14 -0
  19. package/src/tasks/create/templates/Constellation/Field/Text/styles.js.mustache +1 -1
  20. package/src/tasks/create/templates/Constellation/Field/Text-Email/styles.js.mustache +1 -1
  21. package/src/tasks/create/templates/Constellation/Field/Text-Input/styles.js.mustache +1 -1
  22. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/styles.js.mustache +1 -1
  23. package/src/tasks/create/templates/Constellation/Field/Text-Phone/styles.js.mustache +1 -1
  24. package/src/tasks/create/templates/Constellation/Field/Text-URL/styles.js.mustache +1 -1
  25. package/src/tasks/create/templates/Constellation/Field/TimeofDay/styles.js.mustache +1 -1
  26. package/src/tasks/create/templates/Constellation/Template/DETAILS/styles.js.mustache +1 -1
  27. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/styles.js.mustache +1 -1
  28. package/src/tasks/create/templates/Constellation/Template/FORM/styles.js.mustache +1 -1
  29. package/src/tasks/create/templates/Constellation/Template/FORM-region/index.jsx.mustache +4 -1
  30. package/src/tasks/create/templates/Constellation/Template/FORM-region/styles.js.mustache +1 -1
  31. package/src/tasks/create/templates/Constellation/Template/PAGE/styles.js.mustache +1 -1
  32. package/src/tasks/create-all/index.js +400 -0
  33. package/src/tasks/index.js +3 -0
  34. package/src/tasks/init/template/package.json.mustache +5 -2
  35. package/src/tasks/init/template/tasks.config.json +15 -6
  36. package/src/tasks/list/helper.js +19 -6
  37. package/src/tasks/publish/helper.js +3 -3
  38. package/src/tasks/publish-all/helper.js +20 -6
  39. package/src/tasks/publish-all/index.js +29 -18
  40. package/src/tasks/rename/index.js +315 -0
  41. package/src/tasks/validator/index.js +182 -7
  42. package/src/util.js +66 -3
  43. package/src/tasks/create/template/config.json.mustache +0 -62
  44. package/src/tasks/create/template/demo.stories.jsx.mustache +0 -44
  45. package/src/tasks/create/template/index.jsx.mustache +0 -55
  46. 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
+ };
@@ -2,6 +2,6 @@ import styled, { css } from 'styled-components';
2
2
 
3
3
  export default styled.div(() => {
4
4
  return css`
5
- margin: 8px 0;
5
+ margin: 0px 0px;
6
6
  `;
7
7
  });
@@ -2,6 +2,6 @@ import styled, { css } from 'styled-components';
2
2
 
3
3
  export default styled.div(() => {
4
4
  return css`
5
- margin: 8px 0;
5
+ margin: 0px 0px;
6
6
  `;
7
7
  });
@@ -2,6 +2,6 @@ import styled, { css } from 'styled-components';
2
2
 
3
3
  export default styled.div(() => {
4
4
  return css`
5
- margin: 8px 0;
5
+ margin: 0px 0px;
6
6
  `;
7
7
  });
@@ -2,6 +2,6 @@ import styled, { css } from 'styled-components';
2
2
 
3
3
  export default styled.div(() => {
4
4
  return css`
5
- margin: 8px 0;
5
+ margin: 0px 0px;
6
6
  `;
7
7
  });
@@ -2,6 +2,6 @@ import styled, { css } from 'styled-components';
2
2
 
3
3
  export default styled.div(() => {
4
4
  return css`
5
- margin: 8px 0;
5
+ margin: 0px 0px;
6
6
  `;
7
7
  });
@@ -2,6 +2,6 @@ import styled, { css } from 'styled-components';
2
2
 
3
3
  export default styled.div(() => {
4
4
  return css`
5
- margin: 8px 0;
5
+ margin: 0px 0px;
6
6
  `;
7
7
  });
@@ -2,6 +2,6 @@ import styled, { css } from 'styled-components';
2
2
 
3
3
  export default styled.div(() => {
4
4
  return css`
5
- margin: 8px 0;
5
+ margin: 0px 0px;
6
6
  `;
7
7
  });
@@ -2,6 +2,6 @@ import styled, { css } from 'styled-components';
2
2
 
3
3
  export default styled.div(() => {
4
4
  return css`
5
- margin: 8px 0;
5
+ margin: 0px 0px;
6
6
  `;
7
7
  });
@@ -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": {
@@ -2,6 +2,6 @@ import styled, { css } from 'styled-components';
2
2
 
3
3
  export default styled.div(() => {
4
4
  return css`
5
- margin: 8px 0;
5
+ margin: 0px 0px;
6
6
  `;
7
7
  });
@@ -2,6 +2,6 @@ import styled, { css } from 'styled-components';
2
2
 
3
3
  export default styled.div(() => {
4
4
  return css`
5
- margin: 8px 0;
5
+ margin: 0px 0px;
6
6
  `;
7
7
  });
@@ -2,6 +2,6 @@ import styled, { css } from 'styled-components';
2
2
 
3
3
  export default styled.div(() => {
4
4
  return css`
5
- margin: 8px 0;
5
+ margin: 0px 0px;
6
6
  `;
7
7
  });
@@ -2,6 +2,6 @@ import styled, { css } from 'styled-components';
2
2
 
3
3
  export default styled.div(() => {
4
4
  return css`
5
- margin: 8px 0;
5
+ margin: 0px 0px;
6
6
  `;
7
7
  });
@@ -2,6 +2,6 @@ import styled, { css } from 'styled-components';
2
2
 
3
3
  export default styled.div(() => {
4
4
  return css`
5
- margin: 8px 0;
5
+ margin: 0px 0px;
6
6
  `;
7
7
  });
@@ -2,6 +2,6 @@ import styled, { css } from 'styled-components';
2
2
 
3
3
  export default styled.div(() => {
4
4
  return css`
5
- margin: 8px 0;
5
+ margin: 0px 0px;
6
6
  `;
7
7
  });
@@ -2,6 +2,6 @@ import styled, { css } from 'styled-components';
2
2
 
3
3
  export default styled.div(() => {
4
4
  return css`
5
- margin: 8px 0;
5
+ margin: 0px 0px;
6
6
  `;
7
7
  });
@@ -2,6 +2,6 @@ import styled, { css } from 'styled-components';
2
2
 
3
3
  export default styled.div(() => {
4
4
  return css`
5
- margin: 8px 0;
5
+ margin: 0px 0px;
6
6
  `;
7
7
  });
@@ -2,6 +2,6 @@ import styled, { css } from 'styled-components';
2
2
 
3
3
  export default styled.div(() => {
4
4
  return css`
5
- margin: 8px 0;
5
+ margin: 0px 0px;
6
6
  `;
7
7
  });
@@ -2,6 +2,6 @@ import styled, { css } from 'styled-components';
2
2
 
3
3
  export default styled.div(() => {
4
4
  return css`
5
- margin: 8px 0;
5
+ margin: 0px 0px;
6
6
  `;
7
7
  });
@@ -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={{ direction: 'column'}} key={`r-${i + 1}`}>
31
+ <Flex container={flexContainer} key={`r-${i + 1}`}>
29
32
  {child}
30
33
  </Flex>
31
34
  ))}
@@ -2,6 +2,6 @@ import styled, { css } from 'styled-components';
2
2
 
3
3
  export default styled.div(() => {
4
4
  return css`
5
- margin: 8px 0;
5
+ margin: 0px 0px;
6
6
  `;
7
7
  });
@@ -2,6 +2,6 @@ import styled, { css } from 'styled-components';
2
2
 
3
3
  export default styled.div(() => {
4
4
  return css`
5
- margin: 0px 0;
5
+ margin: 0px 0px;
6
6
  `;
7
7
  });