@pega/custom-dx-components 0.23.6 → 0.23.8

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 (82) hide show
  1. package/package.json +1 -1
  2. package/src/auth.js +9 -3
  3. package/src/tasks/authenticate/index.js +42 -39
  4. package/src/tasks/build/helper.js +5 -19
  5. package/src/tasks/bundle/builder/webpack.config.js +2 -4
  6. package/src/tasks/create/templates/Constellation/Field/Boolean/styles.js.mustache +13 -6
  7. package/src/tasks/create/templates/Constellation/Field/Date/styles.js.mustache +13 -6
  8. package/src/tasks/create/templates/Constellation/Field/DateTime/styles.js.mustache +13 -6
  9. package/src/tasks/create/templates/Constellation/Field/Decimal/styles.js.mustache +13 -6
  10. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/styles.js.mustache +13 -6
  11. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/styles.js.mustache +13 -6
  12. package/src/tasks/create/templates/Constellation/Field/Integer/styles.js.mustache +13 -6
  13. package/src/tasks/create/templates/Constellation/Field/Picklist/styles.js.mustache +13 -6
  14. package/src/tasks/create/templates/Constellation/Field/Text/styles.js.mustache +13 -6
  15. package/src/tasks/create/templates/Constellation/Field/Text-Email/styles.js.mustache +13 -6
  16. package/src/tasks/create/templates/Constellation/Field/Text-Input/styles.js.mustache +13 -6
  17. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/styles.js.mustache +13 -6
  18. package/src/tasks/create/templates/Constellation/Field/Text-Phone/styles.js.mustache +13 -6
  19. package/src/tasks/create/templates/Constellation/Field/Text-URL/styles.js.mustache +13 -6
  20. package/src/tasks/create/templates/Constellation/Field/TimeOfDay/styles.js.mustache +13 -6
  21. package/src/tasks/create/templates/Constellation/Template/DETAILS/styles.js.mustache +13 -6
  22. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/styles.js.mustache +13 -6
  23. package/src/tasks/create/templates/Constellation/Template/FORM/styles.js.mustache +13 -6
  24. package/src/tasks/create/templates/Constellation/Template/FORM-region/styles.js.mustache +13 -6
  25. package/src/tasks/create/templates/Constellation/Template/PAGE/styles.js.mustache +13 -6
  26. package/src/tasks/create/templates/Constellation/Widget/CASE/styles.js.mustache +13 -6
  27. package/src/tasks/create/templates/Constellation/Widget/PAGE/styles.js.mustache +13 -6
  28. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/styles.js.mustache +13 -6
  29. package/src/tasks/create-all/index.js +51 -116
  30. package/src/tasks/init/index.js +5 -1
  31. package/src/tasks/init/template/package.json.mustache +2 -2
  32. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyBoolean/config.json +2 -2
  33. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyBoolean/styles.js +13 -6
  34. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyCaseWidget/config.json +2 -2
  35. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyCaseWidget/styles.js +13 -6
  36. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyCurrency/config.json +2 -2
  37. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyCurrency/styles.js +13 -6
  38. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDate/config.json +2 -2
  39. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDate/styles.js +13 -6
  40. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDateTime/config.json +2 -2
  41. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDateTime/styles.js +13 -6
  42. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDecimal/config.json +2 -2
  43. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDecimal/styles.js +13 -6
  44. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDetails/config.json +2 -2
  45. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyDetails/styles.js +13 -6
  46. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyEmail/config.json +2 -2
  47. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyEmail/styles.js +13 -6
  48. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyForm/config.json +2 -2
  49. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyForm/styles.js +13 -6
  50. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyInteger/config.json +2 -2
  51. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyInteger/styles.js +13 -6
  52. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPage/config.json +2 -2
  53. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPage/styles.js +13 -6
  54. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPageCaseWidget/config.json +2 -2
  55. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPageCaseWidget/styles.js +13 -6
  56. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPageWidget/config.json +2 -2
  57. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPageWidget/styles.js +13 -6
  58. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyParagraph/config.json +2 -2
  59. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyParagraph/styles.js +13 -6
  60. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPercentage/config.json +2 -2
  61. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPercentage/styles.js +13 -6
  62. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPhone/config.json +2 -2
  63. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPhone/styles.js +13 -6
  64. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPicklist/config.json +2 -2
  65. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyPicklist/styles.js +13 -6
  66. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyText/config.json +2 -2
  67. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyText/styles.js +13 -6
  68. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTextInput/config.json +2 -2
  69. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTextInput/styles.js +13 -6
  70. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTimeOfDay/config.json +2 -2
  71. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTimeOfDay/styles.js +13 -6
  72. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTwoColumnDetails/config.json +2 -2
  73. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTwoColumnDetails/styles.js +13 -6
  74. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTwoColumnForm/config.json +2 -2
  75. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyTwoColumnForm/styles.js +13 -6
  76. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyURL/config.json +2 -2
  77. package/src/tasks/init/template/test/assets/components/createAll/Pega_DXIL_MyURL/styles.js +13 -6
  78. package/src/tasks/init/template/test/functionTest/localCreateAllListDeleteAll.test.js +1 -1
  79. package/src/tasks/list/helper.js +10 -8
  80. package/src/tasks/publish/helper.js +16 -30
  81. package/src/tasks/publish-all/helper.js +9 -27
  82. package/src/util.js +43 -78
@@ -1,7 +1,14 @@
1
- import styled, { css } from 'styled-components';
1
+ // utilizing theming, comment out, if want individual style
2
+ import styled from 'styled-components';
3
+ import { Configuration } from '@pega/cosmos-react-core';
2
4
 
3
- export default styled.div(() => {
4
- return css`
5
- margin: 0px 0px;
6
- `;
7
- });
5
+ export default styled(Configuration)``;
6
+
7
+ // individual style, comment out above, and uncomment here and add styles
8
+ // import styled, { css } from 'styled-components';
9
+ //
10
+ // export default styled.div(() => {
11
+ // return css`
12
+ // margin: 0px 0;
13
+ // `;
14
+ // });
@@ -1,7 +1,14 @@
1
- import styled, { css } from 'styled-components';
1
+ // utilizing theming, comment out, if want individual style
2
+ import styled from 'styled-components';
3
+ import { Configuration } from '@pega/cosmos-react-core';
2
4
 
3
- export default styled.div(() => {
4
- return css`
5
- margin: 0px 0px;
6
- `;
7
- });
5
+ export default styled(Configuration)``;
6
+
7
+ // individual style, comment out above, and uncomment here and add styles
8
+ // import styled, { css } from 'styled-components';
9
+ //
10
+ // export default styled.div(() => {
11
+ // return css`
12
+ // margin: 0px 0;
13
+ // `;
14
+ // });
@@ -1,7 +1,14 @@
1
- import styled, { css } from 'styled-components';
1
+ // utilizing theming, comment out, if want individual style
2
+ import styled from 'styled-components';
3
+ import { Configuration } from '@pega/cosmos-react-core';
2
4
 
3
- export default styled.div(() => {
4
- return css`
5
- margin: 0px 0px;
6
- `;
7
- });
5
+ export default styled(Configuration)``;
6
+
7
+ // individual style, comment out above, and uncomment here and add styles
8
+ // import styled, { css } from 'styled-components';
9
+ //
10
+ // export default styled.div(() => {
11
+ // return css`
12
+ // margin: 0px 0;
13
+ // `;
14
+ // });
@@ -1,7 +1,14 @@
1
- import styled, { css } from 'styled-components';
1
+ // utilizing theming, comment out, if want individual style
2
+ import styled from 'styled-components';
3
+ import { Configuration } from '@pega/cosmos-react-core';
2
4
 
3
- export default styled.div(() => {
4
- return css`
5
- margin: 0px 0px;
6
- `;
7
- });
5
+ export default styled(Configuration)``;
6
+
7
+ // individual style, comment out above, and uncomment here and add styles
8
+ // import styled, { css } from 'styled-components';
9
+ //
10
+ // export default styled.div(() => {
11
+ // return css`
12
+ // margin: 0px 0;
13
+ // `;
14
+ // });
@@ -1,7 +1,14 @@
1
- import styled, { css } from 'styled-components';
1
+ // utilizing theming, comment out, if want individual style
2
+ import styled from 'styled-components';
3
+ import { Configuration } from '@pega/cosmos-react-core';
2
4
 
3
- export default styled.div(() => {
4
- return css`
5
- margin: 0px 0;
6
- `;
7
- });
5
+ export default styled(Configuration)``;
6
+
7
+ // individual style, comment out above, and uncomment here and add styles
8
+ // import styled, { css } from 'styled-components';
9
+ //
10
+ // export default styled.div(() => {
11
+ // return css`
12
+ // margin: 0px 0;
13
+ // `;
14
+ // });
@@ -1,7 +1,14 @@
1
- import styled, { css } from 'styled-components';
1
+ // utilizing theming, comment out, if want individual style
2
+ import styled from 'styled-components';
3
+ import { Configuration } from '@pega/cosmos-react-core';
2
4
 
3
- export default styled.div(() => {
4
- return css`
5
- margin: 0px 0;
6
- `;
7
- });
5
+ export default styled(Configuration)``;
6
+
7
+ // individual style, comment out above, and uncomment here and add styles
8
+ // import styled, { css } from 'styled-components';
9
+ //
10
+ // export default styled.div(() => {
11
+ // return css`
12
+ // margin: 0px 0;
13
+ // `;
14
+ // });
@@ -1,7 +1,14 @@
1
- import styled, { css } from 'styled-components';
1
+ // utilizing theming, comment out, if want individual style
2
+ import styled from 'styled-components';
3
+ import { Configuration } from '@pega/cosmos-react-core';
2
4
 
3
- export default styled.div(() => {
4
- return css`
5
- margin: 0px 0;
6
- `;
7
- });
5
+ export default styled(Configuration)``;
6
+
7
+ // individual style, comment out above, and uncomment here and add styles
8
+ // import styled, { css } from 'styled-components';
9
+ //
10
+ // export default styled.div(() => {
11
+ // return css`
12
+ // margin: 0px 0;
13
+ // `;
14
+ // });
@@ -22,51 +22,32 @@ import {
22
22
  sanitize,
23
23
  validateSemver
24
24
  } from '../../util.js';
25
- import {
26
- COMPONENT_SCHEMA,
27
- COMPONENTS_DIRECTORY_PATH,
28
- TASKS_CONFIG_JSON_FILENAME,
29
- COMPONENTS_PATH,
30
- CATEGORY_CONSTELLATION
31
- } from '../../constants.js';
25
+ import { COMPONENT_SCHEMA, COMPONENTS_DIRECTORY_PATH, TASKS_CONFIG_JSON_FILENAME, COMPONENTS_PATH, CATEGORY_CONSTELLATION } from '../../constants.js';
32
26
 
33
27
  const pegaConfigJsonPath = path.join(path.resolve(), TASKS_CONFIG_JSON_FILENAME);
34
28
 
35
29
  const copy = promisify(ncp);
36
30
 
37
- const copyComponentTemplate = async options => {
31
+ const copyComponentTemplate = async (options) => {
38
32
  if (options.targetDirectory) {
39
33
  return copy(options.templateDirectory, options.targetDirectory, {
40
34
  clobber: false
41
35
  });
42
- }
43
- else {
36
+ } else {
44
37
  return copy(options.templateDirectoryConstellation, options.targetDirectoryConstellation, {
45
38
  clobber: false,
46
39
  filter: (fileName) => {
47
40
  // filter out the file config.json or config.json.mustache
48
- if (fileName.indexOf("config.json") >= 0) return false;
41
+ if (fileName.indexOf('config.json') >= 0) return false;
49
42
  else return true;
50
43
  }
51
44
  });
52
45
  }
53
-
54
46
  };
55
47
 
56
48
  export const compileMustacheTemplates = async (
57
49
  componentDirectory,
58
- {
59
- componentKey,
60
- componentName,
61
- componentLabel,
62
- library,
63
- version,
64
- type,
65
- subtype,
66
- description,
67
- organization,
68
- allowedApplications
69
- }
50
+ { componentKey, componentName, componentLabel, library, version, type, subtype, description, organization, allowedApplications }
70
51
  ) => {
71
52
  const files = fs.readdirSync(componentDirectory);
72
53
  const componentClassName = convertIntoPascalCase(componentKey);
@@ -83,19 +64,18 @@ export const compileMustacheTemplates = async (
83
64
  let mustacheSubType = subtype;
84
65
 
85
66
  // overrides
86
- if (typeof(mustacheSubType) == "string") {
67
+ if (typeof mustacheSubType == 'string') {
87
68
  switch (mustacheSubType) {
88
- case "FORM-region" :
89
- mustacheSubType = "FORM";
69
+ case 'FORM-region':
70
+ mustacheSubType = 'FORM';
90
71
  break;
91
- case "DETAILS-region" :
92
- mustacheSubType = "DETAILS";
72
+ case 'DETAILS-region':
73
+ mustacheSubType = 'DETAILS';
93
74
  break;
94
- case "Text-Input" :
95
- mustacheSubType = "Text";
75
+ case 'Text-Input':
76
+ mustacheSubType = 'Text';
96
77
  break;
97
78
  }
98
-
99
79
  }
100
80
 
101
81
  if (allowedApplications.trim() === '') {
@@ -107,8 +87,8 @@ export const compileMustacheTemplates = async (
107
87
  allowedApplications = [].concat(allowedApplications);
108
88
  }
109
89
 
110
- allowedApplications = allowedApplications.filter(el => !!el.trim()).map(el => el.trim());
111
- files.forEach(file => {
90
+ allowedApplications = allowedApplications.filter((el) => !!el.trim()).map((el) => el.trim());
91
+ files.forEach((file) => {
112
92
  const filePath = path.join(componentDirectory, file);
113
93
 
114
94
  const output = compileMustacheTemplate(filePath, {
@@ -133,27 +113,14 @@ export const compileMustacheTemplates = async (
133
113
  });
134
114
  };
135
115
 
136
-
137
- export const validateCompileAll = async (
138
- {
139
- prefix,
140
- library,
141
- version,
142
- allowedApplications,
143
- organization
144
- },
145
- options,
146
-
147
- ) => {
148
-
149
-
116
+ export const validateCompileAll = async ({ prefix, library, version, allowedApplications, organization }, options) => {
150
117
  for (let fieldIdx in COMPONENT_SCHEMA.subtype.field) {
151
- const type = "Field";
118
+ const type = 'Field';
152
119
  const subtype = COMPONENT_SCHEMA.subtype.field[fieldIdx].value;
153
120
  const prefixNoSpace = prefix.replace(/\s+/g, '');
154
121
  const componentNameNoSpace = COMPONENT_SCHEMA.subtype.field[fieldIdx].name.replace(/\s+/g, '');
155
- const componentName = "".concat(prefixNoSpace).concat(componentNameNoSpace);
156
- const componentLabel = "".concat(prefix).concat(" ").concat(COMPONENT_SCHEMA.subtype.field[fieldIdx].name);
122
+ const componentName = ''.concat(prefixNoSpace).concat(componentNameNoSpace);
123
+ const componentLabel = ''.concat(prefix).concat(' ').concat(COMPONENT_SCHEMA.subtype.field[fieldIdx].name);
157
124
  const description = componentLabel;
158
125
 
159
126
  await validateCompile(
@@ -169,23 +136,23 @@ export const validateCompileAll = async (
169
136
  allowedApplications
170
137
  },
171
138
  options
172
- )
139
+ );
173
140
  }
174
141
 
175
142
  for (let templateIdx in COMPONENT_SCHEMA.subtype.template) {
176
- const type = "Template";
143
+ const type = 'Template';
177
144
  const subtype = COMPONENT_SCHEMA.subtype.template[templateIdx].value;
178
145
  const prefixNoSpace = prefix.replace(/\s+/g, '');
179
- let templateNameOriginal = COMPONENT_SCHEMA.subtype.template[templateIdx].name;
180
- let templateName = convertIntoPascalCase(COMPONENT_SCHEMA.subtype.template[templateIdx].name);
146
+ let templateNameOriginal = COMPONENT_SCHEMA.subtype.template[templateIdx].name;
147
+ let templateName = convertIntoPascalCase(COMPONENT_SCHEMA.subtype.template[templateIdx].name);
181
148
  let templateLabel = convertIntoPascalCase(COMPONENT_SCHEMA.subtype.template[templateIdx].name);
182
- if (templateNameOriginal.indexOf("region") >= 0) {
183
- let templateNameBase = convertIntoPascalCase(templateNameOriginal.replace(" region", ""));
184
- templateName = "TwoColumn".concat(templateNameBase);
185
- templateLabel = "Two Column ".concat(templateNameBase);
149
+ if (templateNameOriginal.indexOf('region') >= 0) {
150
+ let templateNameBase = convertIntoPascalCase(templateNameOriginal.replace(' region', ''));
151
+ templateName = 'TwoColumn'.concat(templateNameBase);
152
+ templateLabel = 'Two Column '.concat(templateNameBase);
186
153
  }
187
- const componentName = "".concat(prefixNoSpace).concat(templateName);
188
- const componentLabel = "".concat(prefix).concat(" ").concat(templateLabel);
154
+ const componentName = ''.concat(prefixNoSpace).concat(templateName);
155
+ const componentLabel = ''.concat(prefix).concat(' ').concat(templateLabel);
189
156
  const description = componentLabel;
190
157
 
191
158
  await validateCompile(
@@ -201,22 +168,21 @@ export const validateCompileAll = async (
201
168
  allowedApplications
202
169
  },
203
170
  options
204
- )
171
+ );
205
172
  }
206
173
 
207
-
208
174
  for (let widgetIdx in COMPONENT_SCHEMA.subtype.widget) {
209
- const type = "Widget";
175
+ const type = 'Widget';
210
176
  const subtype = COMPONENT_SCHEMA.subtype.widget[widgetIdx].value;
211
177
  const prefixNoSpace = prefix.replace(/\s+/g, '');
212
- let widgetNameOriginal = COMPONENT_SCHEMA.subtype.widget[widgetIdx].name;
213
- let widgetName = convertIntoPascalCase(COMPONENT_SCHEMA.subtype.widget[widgetIdx].name).concat("Widget");
214
- let widgetLabel = convertIntoPascalCase(COMPONENT_SCHEMA.subtype.widget[widgetIdx].name).concat(" Widget");
215
- if (widgetName.indexOf("&") >= 0) {
216
- widgetName = convertIntoPascalCase(widgetNameOriginal.replace(" & ", ""));
178
+ let widgetNameOriginal = COMPONENT_SCHEMA.subtype.widget[widgetIdx].name;
179
+ let widgetName = convertIntoPascalCase(COMPONENT_SCHEMA.subtype.widget[widgetIdx].name).concat('Widget');
180
+ let widgetLabel = convertIntoPascalCase(COMPONENT_SCHEMA.subtype.widget[widgetIdx].name).concat(' Widget');
181
+ if (widgetName.indexOf('&') >= 0) {
182
+ widgetName = convertIntoPascalCase(widgetNameOriginal.replace(' & ', ''));
217
183
  }
218
- const componentName = "".concat(prefixNoSpace).concat(widgetName);
219
- const componentLabel = "".concat(prefix).concat(" ").concat(widgetLabel);
184
+ const componentName = ''.concat(prefixNoSpace).concat(widgetName);
185
+ const componentLabel = ''.concat(prefix).concat(' ').concat(widgetLabel);
220
186
  const description = componentLabel;
221
187
 
222
188
  await validateCompile(
@@ -232,32 +198,17 @@ export const validateCompileAll = async (
232
198
  allowedApplications
233
199
  },
234
200
  options
235
- )
201
+ );
236
202
  }
237
-
238
-
239
- }
240
-
203
+ };
241
204
 
242
205
  export const validateCompile = async (
243
- {
244
- library,
245
- organization,
246
- componentName,
247
- componentLabel,
248
- version,
249
- framework,
250
- type,
251
- subtype,
252
- description,
253
- allowedApplications
254
- },
206
+ { library, organization, componentName, componentLabel, version, framework, type, subtype, description, allowedApplications },
255
207
  options
256
208
  ) => {
257
-
258
209
  let sSubType = subtype;
259
210
  if (Array.isArray(subtype)) {
260
- sSubType = subtype.join("-");
211
+ sSubType = subtype.join('-');
261
212
  }
262
213
 
263
214
  const typeLC = type.toLowerCase();
@@ -269,10 +220,9 @@ export const validateCompile = async (
269
220
  let pegaConfig = await getPegaConfig();
270
221
  let templateParentDir = `./templates/${framework}`;
271
222
 
272
-
273
223
  const templateDir = `${templateParentDir}/${type}/${sSubType}`;
274
224
  let templateDirectory = fileURLToPath(new URL(templateDir, import.meta.url));
275
- templateDirectory = templateDirectory.replace( path.sep + "create-all", path.sep + "create");
225
+ templateDirectory = templateDirectory.replace(path.sep + 'create-all', path.sep + 'create');
276
226
 
277
227
  const componentKey = `${organization}_${library}_${componentName}`;
278
228
 
@@ -280,7 +230,6 @@ export const validateCompile = async (
280
230
 
281
231
  const components = await getComponents(false);
282
232
 
283
-
284
233
  if (components.includes(componentKey)) {
285
234
  console.log(chalk.red(`${componentKey} component already exists in ${targetDirectory}`));
286
235
 
@@ -306,14 +255,10 @@ export const validateCompile = async (
306
255
  allowedApplications
307
256
  });
308
257
 
309
-
310
258
  console.log(chalk.green(`created ${componentKey} component in ${targetDirectory}`));
311
-
312
-
313
-
314
259
  };
315
260
 
316
- export default async options => {
261
+ export default async (options) => {
317
262
  showVersion();
318
263
 
319
264
  await checkPathAccess(pegaConfigJsonPath);
@@ -322,9 +267,7 @@ export default async options => {
322
267
  data = data && JSON.parse(data);
323
268
 
324
269
  if (!data[COMPONENTS_DIRECTORY_PATH]) {
325
- console.error(
326
- `${chalk.red.bold('ERROR')} Could not able find components directory path in config.json`
327
- );
270
+ console.error(`${chalk.red.bold('ERROR')} Could not able find components directory path in config.json`);
328
271
  process.exit(1);
329
272
  }
330
273
 
@@ -336,7 +279,6 @@ export default async options => {
336
279
  let componentDefaults = await getComponentDefaults();
337
280
  componentDefaults.library = library;
338
281
 
339
-
340
282
  if (options.params.length >= 8) {
341
283
  const prefix = options.params[3];
342
284
  const version = options.params[4];
@@ -356,8 +298,7 @@ export default async options => {
356
298
  },
357
299
  options
358
300
  );
359
- }
360
- else {
301
+ } else {
361
302
  const questions = [
362
303
  {
363
304
  name: 'prefix',
@@ -367,7 +308,7 @@ export default async options => {
367
308
  name: 'version',
368
309
  message: 'Enter component version',
369
310
  default: componentDefaults.version,
370
- validate: value => {
311
+ validate: (value) => {
371
312
  if (validateSemver(value)) {
372
313
  return true;
373
314
  }
@@ -378,7 +319,7 @@ export default async options => {
378
319
  name: 'library',
379
320
  message: 'Enter library name (required)',
380
321
  default: componentDefaults.library,
381
- validate: value => {
322
+ validate: (value) => {
382
323
  /* value should not be empty
383
324
  It should not have spaces
384
325
  It should not start with a number
@@ -397,13 +338,10 @@ export default async options => {
397
338
  }
398
339
  ];
399
340
 
400
- await inquirer.prompt(questions).then(async answers => {
401
- const {
402
- prefix,
403
- library,
404
- version,
405
- allowedApplications
406
- } = answers;
341
+ await inquirer.prompt(questions).then(async (answers) => {
342
+ const { library, version, allowedApplications } = answers;
343
+ let { prefix } = answers;
344
+ prefix = prefix.replace(/[^a-zA-Z0-9 ]/g, '');
407
345
  await validateCompileAll(
408
346
  {
409
347
  prefix,
@@ -416,7 +354,4 @@ export default async options => {
416
354
  );
417
355
  });
418
356
  }
419
-
420
-
421
-
422
357
  };
@@ -124,8 +124,12 @@ export default async (options) => {
124
124
  task: () => execPromise('npm i --force --production=false', { cwd: options.targetDirectory })
125
125
  },
126
126
  {
127
- title: 'Installing components dependencies',
127
+ title: 'Installing tasks dependencies',
128
128
  task: () => execPromise('npm i --force --production=false', { cwd: options.componentDirectory })
129
+ },
130
+ {
131
+ title: 'Installing quick run',
132
+ task: () => execPromise('npm i -g npm-quick-run', { cwd: options.targetDirectory })
129
133
  }
130
134
  ],
131
135
  {
@@ -4,6 +4,7 @@
4
4
  "description": "{{description}}",
5
5
  "organization": "{{organization}}",
6
6
  "main": "src/index.js",
7
+ "type": "module",
7
8
  "scripts": {
8
9
  "startStorybook": "start-storybook --port 6040 --quiet",
9
10
  "lint": "run-p -cl lint:*",
@@ -64,7 +65,7 @@
64
65
  },
65
66
  "devDependencies": {
66
67
  "@pega/configs": "^0.5.3",
67
- "@pega/custom-dx-components": "^0.23.6",
68
+ "@pega/custom-dx-components": "^0.23.8",
68
69
  "@pega/eslint-config": "^0.3.2",
69
70
  "@storybook/addon-actions": "^6.5.12",
70
71
  "@storybook/addon-essentials": "^6.5.12",
@@ -91,7 +92,6 @@
91
92
  "eslint-plugin-sonarjs": "^0.11.0",
92
93
  "jest": "^29.3.1",
93
94
  "jest-environment-jsdom": "^29.3.1",
94
- "npm-quick-run": "^1.18.0",
95
95
  "npm-run-all": "^4.1.5",
96
96
  "prettier": "2.7.1",
97
97
  "stylelint": "^14.11.0",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "Pega_DXIL_MyBoolean",
3
- "label": "My Boolean",
4
- "description": "My Boolean",
3
+ "label": "My Boolean",
4
+ "description": "My Boolean",
5
5
  "organization": "Pega",
6
6
  "version": "0.0.1",
7
7
  "library": "DXIL",
@@ -1,7 +1,14 @@
1
- import styled, { css } from 'styled-components';
1
+ // utilizing theming, comment out, if want individual style
2
+ import styled from 'styled-components';
3
+ import { Configuration } from '@pega/cosmos-react-core';
2
4
 
3
- export default styled.div(() => {
4
- return css`
5
- margin: 0px 0px;
6
- `;
7
- });
5
+ export default styled(Configuration)``;
6
+
7
+ // individual style, comment out above, and uncomment here and add styles
8
+ // import styled, { css } from 'styled-components';
9
+ //
10
+ // export default styled.div(() => {
11
+ // return css`
12
+ // margin: 0px 0;
13
+ // `;
14
+ // });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "Pega_DXIL_MyCaseWidget",
3
- "label": "My Case Widget",
4
- "description": "My Case Widget",
3
+ "label": "My Case Widget",
4
+ "description": "My Case Widget",
5
5
  "organization": "Pega",
6
6
  "version": "0.0.1",
7
7
  "library": "DXIL",
@@ -1,7 +1,14 @@
1
- import styled, { css } from 'styled-components';
1
+ // utilizing theming, comment out, if want individual style
2
+ import styled from 'styled-components';
3
+ import { Configuration } from '@pega/cosmos-react-core';
2
4
 
3
- export default styled.div(() => {
4
- return css`
5
- margin: 0px 0;
6
- `;
7
- });
5
+ export default styled(Configuration)``;
6
+
7
+ // individual style, comment out above, and uncomment here and add styles
8
+ // import styled, { css } from 'styled-components';
9
+ //
10
+ // export default styled.div(() => {
11
+ // return css`
12
+ // margin: 0px 0;
13
+ // `;
14
+ // });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "Pega_DXIL_MyCurrency",
3
- "label": "My Currency",
4
- "description": "My Currency",
3
+ "label": "My Currency",
4
+ "description": "My Currency",
5
5
  "organization": "Pega",
6
6
  "version": "0.0.1",
7
7
  "library": "DXIL",
@@ -1,7 +1,14 @@
1
- import styled, { css } from 'styled-components';
1
+ // utilizing theming, comment out, if want individual style
2
+ import styled from 'styled-components';
3
+ import { Configuration } from '@pega/cosmos-react-core';
2
4
 
3
- export default styled.div(() => {
4
- return css`
5
- margin: 0px 0px;
6
- `;
7
- });
5
+ export default styled(Configuration)``;
6
+
7
+ // individual style, comment out above, and uncomment here and add styles
8
+ // import styled, { css } from 'styled-components';
9
+ //
10
+ // export default styled.div(() => {
11
+ // return css`
12
+ // margin: 0px 0;
13
+ // `;
14
+ // });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "Pega_DXIL_MyDate",
3
- "label": "My Date",
4
- "description": "My Date",
3
+ "label": "My Date",
4
+ "description": "My Date",
5
5
  "organization": "Pega",
6
6
  "version": "0.0.1",
7
7
  "library": "DXIL",
@@ -1,7 +1,14 @@
1
- import styled, { css } from 'styled-components';
1
+ // utilizing theming, comment out, if want individual style
2
+ import styled from 'styled-components';
3
+ import { Configuration } from '@pega/cosmos-react-core';
2
4
 
3
- export default styled.div(() => {
4
- return css`
5
- margin: 0px 0px;
6
- `;
7
- });
5
+ export default styled(Configuration)``;
6
+
7
+ // individual style, comment out above, and uncomment here and add styles
8
+ // import styled, { css } from 'styled-components';
9
+ //
10
+ // export default styled.div(() => {
11
+ // return css`
12
+ // margin: 0px 0;
13
+ // `;
14
+ // });