@pega/dx-component-builder-sdk 0.1.1 → 0.1.3

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 (35) hide show
  1. package/package.json +1 -1
  2. package/src/constants.js +26 -6
  3. package/src/tasks/authenticate/index.js +3 -1
  4. package/src/tasks/build/index.js +3 -1
  5. package/src/tasks/create/index.js +3 -7
  6. package/src/tasks/create/templates/SDK-React/Field/Date/demo.stories.jsx.mustache +15 -11
  7. package/src/tasks/create/templates/SDK-React/Field/Date/index.tsx.mustache +28 -26
  8. package/src/tasks/create/templates/SDK-React/Field/Date/mock.stories.js.mustache +13 -0
  9. package/src/tasks/create/templates/SDK-React/Field/DateTime/demo.stories.jsx.mustache +14 -11
  10. package/src/tasks/create/templates/SDK-React/Field/DateTime/index.tsx.mustache +24 -22
  11. package/src/tasks/create/templates/SDK-React/Field/DateTime/mock.stories.js.mustache +12 -0
  12. package/src/tasks/create/templates/SDK-React/Field/Text/demo.stories.jsx.mustache +14 -25
  13. package/src/tasks/create/templates/SDK-React/Field/Text/mock.stories.js.mustache +13 -0
  14. package/src/tasks/create/templates/SDK-React/Field/Text-Email/demo.stories.jsx.mustache +15 -27
  15. package/src/tasks/create/templates/SDK-React/Field/Text-Email/mock.stories.js.mustache +13 -0
  16. package/src/tasks/create/templates/SDK-React/Field/Text-Input/demo.stories.jsx.mustache +11 -26
  17. package/src/tasks/create/templates/SDK-React/Field/Text-Input/mock.stories.js.mustache +20 -0
  18. package/src/tasks/create/templates/SDK-React/Field/Text-Paragraph/demo.stories.jsx.mustache +15 -24
  19. package/src/tasks/create/templates/SDK-React/Field/Text-Paragraph/mock.stories.js.mustache +20 -0
  20. package/src/tasks/create/templates/SDK-React/Field/Text-Phone/demo.stories.jsx.mustache +15 -26
  21. package/src/tasks/create/templates/SDK-React/Field/Text-Phone/mock.stories.js.mustache +31 -0
  22. package/src/tasks/create/templates/SDK-React/Field/Text-URL/demo.stories.jsx.mustache +14 -25
  23. package/src/tasks/create/templates/SDK-React/Field/Text-URL/mock.stories.js.mustache +13 -0
  24. package/src/tasks/create/templates/SDK-React/Field/TimeofDay/demo.stories.jsx.mustache +15 -11
  25. package/src/tasks/create/templates/SDK-React/Field/TimeofDay/index.tsx.mustache +23 -21
  26. package/src/tasks/create/templates/SDK-React/Field/TimeofDay/mock.stories.js.mustache +12 -0
  27. package/src/tasks/create/templates/SDK-React/Widget/PAGE/demo.stories.jsx.mustache +29 -0
  28. package/src/tasks/create/templates/SDK-React/Widget/PAGE/mock.stories.js.mustache +23 -0
  29. package/src/tasks/delete/index.js +3 -0
  30. package/src/tasks/delete-all/index.js +4 -0
  31. package/src/tasks/list/index.js +4 -0
  32. package/src/tasks/override/index.js +2 -6
  33. package/src/tasks/publish/index.js +3 -1
  34. package/src/tasks/publish-all/index.js +5 -2
  35. package/src/util.js +10 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/dx-component-builder-sdk",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Utility for building custom UI components",
5
5
  "bin": "./bin/index.js",
6
6
  "scripts": {
package/src/constants.js CHANGED
@@ -221,7 +221,7 @@ export const COMPONENT_SCHEMA = {
221
221
  },
222
222
  {
223
223
  name: 'Phone',
224
- value: 'Phopne'
224
+ value: 'Phone'
225
225
  },
226
226
  {
227
227
  name: 'Radio Buttons',
@@ -252,8 +252,8 @@ export const COMPONENT_SCHEMA = {
252
252
  value: 'URL'
253
253
  },
254
254
  {
255
- name: 'User Referene',
256
- value: 'UserRefernece'
255
+ name: 'User Reference',
256
+ value: 'UserReference'
257
257
  }
258
258
  ],
259
259
  designSystemExtensions: [
@@ -299,6 +299,10 @@ export const COMPONENT_SCHEMA = {
299
299
  name: 'Assignment Card',
300
300
  value: 'AssignmentCard'
301
301
  },
302
+ {
303
+ name: 'Attachment',
304
+ value: 'Attachment'
305
+ },
302
306
  {
303
307
  name: 'Dashboard Filter',
304
308
  value: 'DashboardFilter'
@@ -309,7 +313,7 @@ export const COMPONENT_SCHEMA = {
309
313
  },
310
314
  {
311
315
  name: 'Error Boundry',
312
- value: 'ErroBoundry'
316
+ value: 'ErrorBoundry'
313
317
  },
314
318
  {
315
319
  name: 'Multi Step',
@@ -389,9 +393,17 @@ export const COMPONENT_SCHEMA = {
389
393
  name: 'Inline Dashboard',
390
394
  value: 'InlineDashboard'
391
395
  },
396
+ {
397
+ name: 'Inline Dashboard Page',
398
+ value: 'InlineDashboardPage'
399
+ },
392
400
  {
393
401
  name: 'List Page',
394
- value: 'List Page'
402
+ value: 'ListPage'
403
+ },
404
+ {
405
+ name: 'List View',
406
+ value: 'ListView'
395
407
  },
396
408
  {
397
409
  name: 'Multi Reference - ReadOnly',
@@ -431,7 +443,15 @@ export const COMPONENT_SCHEMA = {
431
443
  },
432
444
  {
433
445
  name: 'Simple Table',
434
- value: 'SimpleTable'
446
+ value: 'SimpleTable/SimpleTable'
447
+ },
448
+ {
449
+ name: 'Simple Table Manual',
450
+ value: 'SimpleTable/SimpleTableManual'
451
+ },
452
+ {
453
+ name: 'Simple Table Select',
454
+ value: 'SimpleTable/SimpleTableSelect'
435
455
  },
436
456
  {
437
457
  name: 'Single Reference - ReadOnly',
@@ -6,7 +6,7 @@ import chalk from 'chalk';
6
6
  import inquirer from 'inquirer';
7
7
  import fetch from 'node-fetch';
8
8
 
9
- import { checkPathAccess, getTokenUrl } from '../../util.js';
9
+ import { checkPathAccess, getTokenUrl, showVersion } from '../../util.js';
10
10
  import { TOKEN_PATH } from '../../constants.js';
11
11
 
12
12
  import { getAuthQuestions } from './helper.js';
@@ -57,6 +57,8 @@ const generateAccessToken = async config => {
57
57
  };
58
58
 
59
59
  export default async options => {
60
+ showVersion();
61
+
60
62
  await checkPathAccess(pegaConfigJsonPath);
61
63
 
62
64
  let data = fs.readFileSync(pegaConfigJsonPath, { encoding: 'utf8' });
@@ -7,9 +7,11 @@ import validate from '../validator/index.js';
7
7
  import bundleComponent from '../bundle/index.js';
8
8
  import lintComponent from '../linter/index.js';
9
9
  import { getBuildComponentQuestions, getBuildCategory, getOptionsCategory } from './helper.js';
10
- import { getComponentDirectoryPath } from '../../util.js';
10
+ import { getComponentDirectoryPath, showVersion } from '../../util.js';
11
11
 
12
12
  export default async options => {
13
+ showVersion();
14
+
13
15
  const catQuestion = await getBuildCategory(options);
14
16
  const catAnwers = await inquirer.prompt(catQuestion);
15
17
 
@@ -2,14 +2,13 @@ import path from 'path';
2
2
  import { URL, fileURLToPath } from 'url';
3
3
  import fs from 'fs';
4
4
  import { promisify } from 'util';
5
- import { createRequire } from "module";
6
5
  import { join } from 'path';
7
6
 
8
7
  import inquirer from 'inquirer';
9
8
  import ncp from 'ncp';
10
9
  import chalk from 'chalk';
11
10
 
12
- import { checkPathAccess, getTokenUrl } from '../../util.js';
11
+ import { checkPathAccess, getTokenUrl, showVersion } from '../../util.js';
13
12
 
14
13
 
15
14
  export const DXCB_CONFIG_JSON_FILENAME = 'dxcb.config.json';
@@ -186,6 +185,8 @@ const validateCompile = async (
186
185
  };
187
186
 
188
187
  export default async options => {
188
+ showVersion();
189
+
189
190
  if (options.params[10]) {
190
191
  const componentName = options.params[3];
191
192
  const componentLabel = options.params[4];
@@ -343,11 +344,6 @@ export default async options => {
343
344
  }
344
345
  ];
345
346
 
346
- // get package version, so can display at create
347
- const require = createRequire(import.meta.url);
348
- const pData = require("../../../package.json");
349
-
350
- console.log(chalk.green("DX Component Builder - SDK v" + pData.version));
351
347
  await inquirer.prompt(questions).then(async answers => {
352
348
  const {
353
349
  componentName,
@@ -1,5 +1,7 @@
1
1
  import { useState } from 'react';
2
- import { withKnobs, text, boolean } from '@storybook/addon-knobs';
2
+ import { withKnobs } from '@storybook/addon-knobs';
3
+
4
+ import { configProps, stateProps } from './mock.stories';
3
5
 
4
6
  import {{COMPONENT_CLASS_NAME}} from './index.jsx';
5
7
 
@@ -10,30 +12,32 @@ export default {
10
12
  };
11
13
 
12
14
  export const Base{{COMPONENT_CLASS_NAME}} = () => {
13
- const [value, setValue] = useState('test value');
15
+ const [value, setValue] = useState(configProps.value);
14
16
 
15
17
  const props = {
18
+ value,
19
+ label: configProps.label,
20
+ hideLabel: configProps.hideLabel,
21
+ displayMode: configProps.displayMode,
22
+
16
23
  getPConnect: () => {
17
24
  return {
18
25
  getActionsApi: () => {
19
26
  return {
20
27
  updateFieldValue: (propName, theValue) => {
21
28
  setValue(theValue);
22
- }
29
+ },
30
+ triggerFieldChange: () => {/* nothing */}
23
31
  };
24
32
  },
25
33
  getStateProps: () => {
26
- return { value: '.name' };
34
+ return stateProps;
27
35
  }
28
36
  };
29
37
  },
30
- value,
31
- placeholder: text('Placeholder', 'Test placeholder'),
32
- disabled: boolean('Disabled', false),
33
- readOnly: boolean('Disabled', false),
34
- required: boolean('Disabled', false),
35
- label: text('Label', 'Sample Label'),
36
- testId: text('Test id', 'text-12344566')
38
+ onChange: date => {
39
+ setValue(date.value);
40
+ }
37
41
  };
38
42
 
39
43
  return (
@@ -1,6 +1,6 @@
1
- /* eslint-disable react/no-unused-prop-types */
2
1
  import React from 'react';
3
- import { KeyboardDatePicker } from '@material-ui/pickers';
2
+ import { KeyboardDatePicker, MuiPickersUtilsProvider } from '@material-ui/pickers';
3
+ import DayjsUtils from '@date-io/dayjs';
4
4
  import TextInput from '@pega/react-sdk-components/lib/components/forms/TextInput';
5
5
  import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
6
6
  import FieldValueList from '@pega/react-sdk-components/lib/components/designSystemExtensions/FieldValueList';
@@ -65,30 +65,32 @@ export default function {{COMPONENT_CLASS_NAME}}(props: any) {
65
65
 
66
66
  return (
67
67
  <Styled{{COMPONENT_CLASS_NAME}}Wrapper>
68
- <KeyboardDatePicker
69
- disableToolbar
70
- variant='inline'
71
- inputVariant='outlined'
72
- placeholder='mm/dd/yyyy'
73
- fullWidth
74
- autoOk
75
- required={required}
76
- disabled={disabled}
77
- format='MM/DD/YYYY'
78
- mask='__/__/____'
79
- error={status === 'error'}
80
- helperText={helperTextToDisplay}
81
- size='small'
82
- label={label}
83
- value={value || null}
84
- onChange={handleChange}
85
- onBlur={onBlur}
86
- onAccept={handleAccept}
87
- {{! pick new delimiteres for mustache }}
88
- {{=<% %>=}}
89
- InputProps={{ ...testProp }}
90
- <%={{ }}=%> {{! revert delimiteres for mustache }}
91
- />
68
+ <MuiPickersUtilsProvider utils={DayjsUtils}>
69
+ <KeyboardDatePicker
70
+ disableToolbar
71
+ variant='inline'
72
+ inputVariant='outlined'
73
+ placeholder='mm/dd/yyyy'
74
+ fullWidth
75
+ autoOk
76
+ required={required}
77
+ disabled={disabled}
78
+ format='MM/DD/YYYY'
79
+ mask='__/__/____'
80
+ error={status === 'error'}
81
+ helperText={helperTextToDisplay}
82
+ size='small'
83
+ label={label}
84
+ value={value || null}
85
+ onChange={handleChange}
86
+ onBlur={onBlur}
87
+ onAccept={handleAccept}
88
+ {{! pick new delimiteres for mustache }}
89
+ {{=<% %>=}}
90
+ InputProps={{ ...testProp }}
91
+ <%={{ }}=%> {{! revert delimiteres for mustache }}
92
+ />
93
+ </MuiPickersUtilsProvider>
92
94
  </Styled{{COMPONENT_CLASS_NAME}}Wrapper>
93
95
  );
94
96
  }
@@ -0,0 +1,13 @@
1
+ export const configProps = {
2
+ "value": "",
3
+ "label": "Date Sample",
4
+ "helperText": "Date Helper Text",
5
+ "testId": "date-12345678",
6
+ "hasSuggestions": false
7
+ }
8
+
9
+
10
+ export const stateProps = {
11
+ "value": ".DateSample",
12
+ "hasSuggestions": false
13
+ }
@@ -1,5 +1,7 @@
1
1
  import { useState } from 'react';
2
- import { withKnobs, text, boolean } from '@storybook/addon-knobs';
2
+ import { withKnobs } from '@storybook/addon-knobs';
3
+
4
+ import { configProps, stateProps } from './mock.stories';
3
5
 
4
6
  import {{COMPONENT_CLASS_NAME}} from './index.jsx';
5
7
 
@@ -10,30 +12,31 @@ export default {
10
12
  };
11
13
 
12
14
  export const Base{{COMPONENT_CLASS_NAME}} = () => {
13
- const [value, setValue] = useState('test value');
15
+ const [value, setValue] = useState(configProps.value);
14
16
 
15
17
  const props = {
18
+ value,
19
+ label: configProps.label,
20
+ hideLabel: configProps.hideLabel,
21
+ displayMode: configProps.displayMode,
16
22
  getPConnect: () => {
17
23
  return {
18
24
  getActionsApi: () => {
19
25
  return {
20
26
  updateFieldValue: (propName, theValue) => {
21
27
  setValue(theValue);
22
- }
28
+ },
29
+ triggerFieldChange: () => {/* nothing */}
23
30
  };
24
31
  },
25
32
  getStateProps: () => {
26
- return { value: '.name' };
33
+ return stateProps;
27
34
  }
28
35
  };
29
36
  },
30
- value,
31
- placeholder: text('Placeholder', 'Test placeholder'),
32
- disabled: boolean('Disabled', false),
33
- readOnly: boolean('Disabled', false),
34
- required: boolean('Disabled', false),
35
- label: text('Label', 'Sample Label'),
36
- testId: text('Test id', 'text-12344566')
37
+ onChange: dateTime => {
38
+ setValue(dateTime.value);
39
+ }
37
40
  };
38
41
 
39
42
  return (
@@ -1,6 +1,6 @@
1
- /* eslint-disable react/no-unused-prop-types */
2
1
  import React from 'react';
3
- import { KeyboardDateTimePicker } from '@material-ui/pickers';
2
+ import { KeyboardDatePicker, MuiPickersUtilsProvider } from '@material-ui/pickers';
3
+ import DayjsUtils from '@date-io/dayjs';
4
4
  import TextInput from '@pega/react-sdk-components/lib/components/forms/TextInput';
5
5
  import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
6
6
  import FieldValueList from '@pega/react-sdk-components/lib/components/designSystemExtensions/FieldValueList';
@@ -59,26 +59,28 @@ export default function {{COMPONENT_CLASS_NAME}}(props: any) {
59
59
 
60
60
  return (
61
61
  <Styled{{COMPONENT_CLASS_NAME}}Wrapper>
62
- <KeyboardDateTimePicker
63
- variant='inline'
64
- inputVariant='outlined'
65
- fullWidth
66
- autoOk
67
- required={required}
68
- disabled={disabled}
69
- placeholder='mm/dd/yyyy hh:mm am'
70
- format='MM/DD/YYYY hh:mm a'
71
- mask='__/__/____ __:__ _m'
72
- minutesStep={5}
73
- error={status === 'error'}
74
- helperText={helperTextToDisplay}
75
- size='small'
76
- label={label}
77
- value={value || null}
78
- onChange={handleChange}
79
- onAccept={handleAccept}
80
- data-test-id={testId}
81
- />
62
+ <MuiPickersUtilsProvider utils={DayjsUtils}>
63
+ <KeyboardDateTimePicker
64
+ variant='inline'
65
+ inputVariant='outlined'
66
+ fullWidth
67
+ autoOk
68
+ required={required}
69
+ disabled={disabled}
70
+ placeholder='mm/dd/yyyy hh:mm am'
71
+ format='MM/DD/YYYY hh:mm a'
72
+ mask='__/__/____ __:__ _m'
73
+ minutesStep={5}
74
+ error={status === 'error'}
75
+ helperText={helperTextToDisplay}
76
+ size='small'
77
+ label={label}
78
+ value={value || null}
79
+ onChange={handleChange}
80
+ onAccept={handleAccept}
81
+ data-test-id={testId}
82
+ />
83
+ </MuiPickersUtilsProvider>
82
84
  </Styled{{COMPONENT_CLASS_NAME}}Wrapper>
83
85
  );
84
86
  }
@@ -0,0 +1,12 @@
1
+ export const configProps = {
2
+ "value": "",
3
+ "label": "Date Time Sample",
4
+ "helperText": "Date Time Helper Text",
5
+ "testId": "datetime-12345678",
6
+ "hasSuggestions": false
7
+ };
8
+
9
+ export const stateProps = {
10
+ "value": ".DateTimeSample",
11
+ "hasSuggestions": false
12
+ };
@@ -1,7 +1,6 @@
1
- import { useState } from 'react';
2
- import { withKnobs, text, boolean } from '@storybook/addon-knobs';
3
-
4
1
  import {{COMPONENT_CLASS_NAME}} from './index.jsx';
2
+ import { withKnobs } from '@storybook/addon-knobs';
3
+ import { configProps } from './mock.stories';
5
4
 
6
5
  export default {
7
6
  title: '{{COMPONENT_CLASS_NAME}}',
@@ -10,30 +9,20 @@ export default {
10
9
  };
11
10
 
12
11
  export const Base{{COMPONENT_CLASS_NAME}} = () => {
13
- const [value, setValue] = useState('test value');
14
12
 
15
13
  const props = {
16
- getPConnect: () => {
17
- return {
18
- getActionsApi: () => {
19
- return {
20
- updateFieldValue: (propName, theValue) => {
21
- setValue(theValue);
22
- }
23
- };
24
- },
25
- getStateProps: () => {
26
- return { value: '.name' };
27
- }
28
- };
29
- },
30
- value,
31
- placeholder: text('Placeholder', 'Test placeholder'),
32
- disabled: boolean('Disabled', false),
33
- readOnly: boolean('Disabled', false),
34
- required: boolean('Disabled', false),
35
- label: text('Label', 'Sample Label'),
36
- testId: text('Test id', 'text-12344566')
14
+ value: configProps.value,
15
+ placeholder: configProps.placeholder,
16
+ label: configProps.label,
17
+ testId: configProps.testId,
18
+ hasSuggestions: configProps.hasSuggestions,
19
+ helperText: configProps.helperText,
20
+ disabled: configProps.disabled,
21
+ required: configProps.required,
22
+ readOnly: configProps.readOnly,
23
+ displayMode: configProps.displayMode,
24
+ onchange: () => { return configProps.value; },
25
+ onBlur: () => { return configProps.value; }
37
26
  };
38
27
 
39
28
  return (
@@ -0,0 +1,13 @@
1
+ // eslint-disable-next-line import/prefer-default-export
2
+ export const configProps = {
3
+ value: '',
4
+ label: 'Text Sample',
5
+ placeholder: 'Text Placeholder',
6
+ helperText: 'Text Helper Text',
7
+ testId: 'Text-12345678',
8
+ hasSuggestions: false,
9
+ disabled: false,
10
+ readOnly: false,
11
+ required: false,
12
+ displayMode: ''
13
+ };
@@ -1,7 +1,6 @@
1
- import { useState } from 'react';
2
- import { withKnobs, text, boolean } from '@storybook/addon-knobs';
3
-
4
1
  import {{COMPONENT_CLASS_NAME}} from './index.jsx';
2
+ import { withKnobs } from '@storybook/addon-knobs';
3
+ import { configProps } from './mock.stories';
5
4
 
6
5
  export default {
7
6
  title: '{{COMPONENT_CLASS_NAME}}',
@@ -10,32 +9,21 @@ export default {
10
9
  };
11
10
 
12
11
  export const Base{{COMPONENT_CLASS_NAME}} = () => {
13
- const [value, setValue] = useState('test value');
14
-
12
+
15
13
  const props = {
16
- getPConnect: () => {
17
- return {
18
- getActionsApi: () => {
19
- return {
20
- updateFieldValue: (propName, theValue) => {
21
- setValue(theValue);
22
- }
23
- };
24
- },
25
- getStateProps: () => {
26
- return { value: '.name' };
27
- }
28
- };
29
- },
30
- value,
31
- placeholder: text('Placeholder', 'Test placeholder'),
32
- disabled: boolean('Disabled', false),
33
- readOnly: boolean('Disabled', false),
34
- required: boolean('Disabled', false),
35
- label: text('Label', 'Sample Label'),
36
- testId: text('Test id', 'text-12344566')
14
+ value: configProps.value,
15
+ placeholder: configProps.placeholder,
16
+ label: configProps.label,
17
+ testId: configProps.testId,
18
+ hasSuggestions: configProps.hasSuggestions,
19
+ helperText: configProps.helperText,
20
+ disabled: configProps.disabled,
21
+ required: configProps.required,
22
+ readOnly: configProps.readOnly,
23
+ displayMode: configProps.displayMode,
24
+ onchange: () => { return configProps.value; },
25
+ onBlur: () => { return configProps.value; }
37
26
  };
38
-
39
27
  return (
40
28
  <>
41
29
  <{{COMPONENT_CLASS_NAME}} {...props} />
@@ -0,0 +1,13 @@
1
+ // eslint-disable-next-line import/prefer-default-export
2
+ export const configProps = {
3
+ value: '',
4
+ label: 'Email Sample',
5
+ placeholder: 'Email Placeholder',
6
+ helperText: 'Email Helper Text',
7
+ testId: 'email-12345678',
8
+ hasSuggestions: false,
9
+ readOnly: false,
10
+ required: false,
11
+ disabled: false,
12
+ displayMode: ''
13
+ };
@@ -1,7 +1,6 @@
1
- import { useState } from 'react';
2
- import { withKnobs, text, boolean } from '@storybook/addon-knobs';
3
-
4
1
  import {{COMPONENT_CLASS_NAME}} from './index.jsx';
2
+ import { withKnobs } from '@storybook/addon-knobs';
3
+ import { configProps, fieldMetadata } from './mock.stories';
5
4
 
6
5
  export default {
7
6
  title: '{{COMPONENT_CLASS_NAME}}',
@@ -10,30 +9,16 @@ export default {
10
9
  };
11
10
 
12
11
  export const Base{{COMPONENT_CLASS_NAME}} = () => {
13
- const [value, setValue] = useState('test value');
14
-
15
12
  const props = {
16
- getPConnect: () => {
17
- return {
18
- getActionsApi: () => {
19
- return {
20
- updateFieldValue: (propName, theValue) => {
21
- setValue(theValue);
22
- }
23
- };
24
- },
25
- getStateProps: () => {
26
- return { value: '.name' };
27
- }
28
- };
29
- },
30
- value,
31
- placeholder: text('Placeholder', 'Test placeholder'),
32
- disabled: boolean('Disabled', false),
33
- readOnly: boolean('Disabled', false),
34
- required: boolean('Disabled', false),
35
- label: text('Label', 'Sample Label'),
36
- testId: text('Test id', 'text-12344566')
13
+ value: configProps.value,
14
+ placeholder: configProps.placeholder,
15
+ label: configProps.label,
16
+ helperText: configProps.helperText,
17
+ testId: configProps.testId,
18
+ hasSuggestions: configProps.hasSuggestions,
19
+ fieldMetadata,
20
+ onchange: () => { return configProps.value; },
21
+ onBlur: () => { return configProps.value; }
37
22
  };
38
23
 
39
24
  return (
@@ -0,0 +1,20 @@
1
+ export const configProps = {
2
+ value: '',
3
+ label: 'TextInput Sample',
4
+ placeholder: 'TextInput Placeholder',
5
+ helperText: 'TextInput Helper Text',
6
+ testId: 'TextInput-12345678',
7
+ hasSuggestions: false,
8
+ required: false,
9
+ disabled: false,
10
+ readOnly: false,
11
+ displayMode: ''
12
+ };
13
+
14
+ export const fieldMetadata = {
15
+ classID: 'DIXL-MediaCo-Work-NewService',
16
+ type: 'Text',
17
+ maxLength: 256,
18
+ displayAs: 'pxTextInput',
19
+ label: 'TextInput Sample'
20
+ };
@@ -1,7 +1,7 @@
1
- import { useState } from 'react';
2
- import { withKnobs, text, boolean } from '@storybook/addon-knobs';
3
1
 
4
2
  import {{COMPONENT_CLASS_NAME}} from './index.jsx';
3
+ import { configProps, fieldMetadata } from './mock.stories';
4
+ import { withKnobs } from '@storybook/addon-knobs';
5
5
 
6
6
  export default {
7
7
  title: '{{COMPONENT_CLASS_NAME}}',
@@ -10,30 +10,21 @@ export default {
10
10
  };
11
11
 
12
12
  export const Base{{COMPONENT_CLASS_NAME}} = () => {
13
- const [value, setValue] = useState('test value');
14
13
 
15
14
  const props = {
16
- getPConnect: () => {
17
- return {
18
- getActionsApi: () => {
19
- return {
20
- updateFieldValue: (propName, theValue) => {
21
- setValue(theValue);
22
- }
23
- };
24
- },
25
- getStateProps: () => {
26
- return { value: '.name' };
27
- }
28
- };
29
- },
30
- value,
31
- placeholder: text('Placeholder', 'Test placeholder'),
32
- disabled: boolean('Disabled', false),
33
- readOnly: boolean('Disabled', false),
34
- required: boolean('Disabled', false),
35
- label: text('Label', 'Sample Label'),
36
- testId: text('Test id', 'text-12344566')
15
+ value: configProps.value,
16
+ placeholder: configProps.placeholder,
17
+ label: configProps.label,
18
+ testId: configProps.testId,
19
+ hasSuggestions: configProps.hasSuggestions,
20
+ helperText: configProps.helperText,
21
+ disabled: configProps.disabled,
22
+ required: configProps.required,
23
+ readOnly: configProps.readOnly,
24
+ displayMode: configProps.displayMode,
25
+ fieldMetadata,
26
+ onchange: () => { return configProps.value; },
27
+ onBlur: () => { return configProps.value; }
37
28
  };
38
29
 
39
30
  return (
@@ -0,0 +1,20 @@
1
+ export const configProps = {
2
+ value: '',
3
+ label: 'Paragraph Sample',
4
+ placeholder: 'Paragraph Placeholder',
5
+ helperText: 'Paragraph Helper Text',
6
+ testId: 'paragraph-12345678',
7
+ hasSuggestions: false,
8
+ required: false,
9
+ disabled: false,
10
+ readOnly: false,
11
+ displayMode: ''
12
+ };
13
+
14
+ export const fieldMetadata = {
15
+ classID: 'DIXL-MediaCo-Work-NewService',
16
+ type: 'Text',
17
+ displayAs: 'pxTextArea',
18
+ label: 'Paragraph sample',
19
+ maxLength: 256
20
+ };
@@ -1,7 +1,6 @@
1
- import { useState } from 'react';
2
- import { withKnobs, text, boolean } from '@storybook/addon-knobs';
3
-
4
1
  import {{COMPONENT_CLASS_NAME}} from './index.jsx';
2
+ import { withKnobs } from '@storybook/addon-knobs';
3
+ import { configProps } from './mock.stories';
5
4
 
6
5
  export default {
7
6
  title: '{{COMPONENT_CLASS_NAME}}',
@@ -10,30 +9,20 @@ export default {
10
9
  };
11
10
 
12
11
  export const Base{{COMPONENT_CLASS_NAME}} = () => {
13
- const [value, setValue] = useState('test value');
14
-
12
+
15
13
  const props = {
16
- getPConnect: () => {
17
- return {
18
- getActionsApi: () => {
19
- return {
20
- updateFieldValue: (propName, theValue) => {
21
- setValue(theValue);
22
- }
23
- };
24
- },
25
- getStateProps: () => {
26
- return { value: '.name' };
27
- }
28
- };
29
- },
30
- value,
31
- placeholder: text('Placeholder', 'Test placeholder'),
32
- disabled: boolean('Disabled', false),
33
- readOnly: boolean('Disabled', false),
34
- required: boolean('Disabled', false),
35
- label: text('Label', 'Sample Label'),
36
- testId: text('Test id', 'text-12344566')
14
+ value: configProps.value,
15
+ placeholder: configProps.placeholder,
16
+ label: configProps.label,
17
+ testId: configProps.testId,
18
+ hasSuggestions: configProps.hasSuggestions,
19
+ helperText: configProps.helperText,
20
+ disabled: configProps.disabled,
21
+ required: configProps.required,
22
+ readOnly: configProps.readOnly,
23
+ displayMode: configProps.displayMode,
24
+ onchange: () => { return configProps.value; },
25
+ onBlur: () => { return configProps.value; }
37
26
  };
38
27
 
39
28
  return (
@@ -0,0 +1,31 @@
1
+ // eslint-disable-next-line import/prefer-default-export
2
+ export const configProps = {
3
+ value: '',
4
+ label: 'Phone Sample',
5
+ datasource: {
6
+ source: [
7
+ {
8
+ value: '+1'
9
+ },
10
+ {
11
+ value: '+91'
12
+ },
13
+ {
14
+ value: '+48'
15
+ },
16
+ {
17
+ value: '+44'
18
+ }
19
+ ],
20
+ fields: {}
21
+ },
22
+ showCountryCode: true,
23
+ placeholder: 'Phone Placeholder',
24
+ helperText: 'Phone Helper Text',
25
+ testId: 'phone-12345678',
26
+ hasSuggestions: false,
27
+ required: false,
28
+ disabled: false,
29
+ readOnly: false,
30
+ displayMode: ''
31
+ };
@@ -1,7 +1,6 @@
1
- import { useState } from 'react';
2
- import { withKnobs, text, boolean } from '@storybook/addon-knobs';
3
-
1
+ import { withKnobs } from '@storybook/addon-knobs';
4
2
  import {{COMPONENT_CLASS_NAME}} from './index.jsx';
3
+ import { configProps } from './mock.stories';
5
4
 
6
5
  export default {
7
6
  title: '{{COMPONENT_CLASS_NAME}}',
@@ -10,30 +9,20 @@ export default {
10
9
  };
11
10
 
12
11
  export const Base{{COMPONENT_CLASS_NAME}} = () => {
13
- const [value, setValue] = useState('test value');
14
12
 
15
13
  const props = {
16
- getPConnect: () => {
17
- return {
18
- getActionsApi: () => {
19
- return {
20
- updateFieldValue: (propName, theValue) => {
21
- setValue(theValue);
22
- }
23
- };
24
- },
25
- getStateProps: () => {
26
- return { value: '.name' };
27
- }
28
- };
29
- },
30
- value,
31
- placeholder: text('Placeholder', 'Test placeholder'),
32
- disabled: boolean('Disabled', false),
33
- readOnly: boolean('Disabled', false),
34
- required: boolean('Disabled', false),
35
- label: text('Label', 'Sample Label'),
36
- testId: text('Test id', 'text-12344566')
14
+ value: configProps.value,
15
+ placeholder: configProps.placeholder,
16
+ label: configProps.label,
17
+ testId: configProps.testId,
18
+ hasSuggestions: configProps.hasSuggestions,
19
+ helperText: configProps.helperText,
20
+ disabled: configProps.disabled,
21
+ required: configProps.required,
22
+ readOnly: configProps.readOnly,
23
+ displayMode: configProps.displayMode,
24
+ onchange: () => { return configProps.value; },
25
+ onBlur: ( return configProps.value; ) => {}
37
26
  };
38
27
 
39
28
  return (
@@ -0,0 +1,13 @@
1
+ // eslint-disable-next-line import/prefer-default-export
2
+ export const configProps = {
3
+ value: '',
4
+ label: 'URL Sample',
5
+ placeholder: 'URL Placeholder',
6
+ helperText: 'URL Helper Text',
7
+ testId: 'url-12345678',
8
+ hasSuggestions: false,
9
+ required: false,
10
+ disabled: false,
11
+ readOnly: false,
12
+ displayMode: ''
13
+ };
@@ -1,5 +1,7 @@
1
1
  import { useState } from 'react';
2
- import { withKnobs, text, boolean } from '@storybook/addon-knobs';
2
+ import { withKnobs } from '@storybook/addon-knobs';
3
+
4
+ import { configProps, stateProps } from './mock.stories';
3
5
 
4
6
  import {{COMPONENT_CLASS_NAME}} from './index.jsx';
5
7
 
@@ -10,30 +12,32 @@ export default {
10
12
  };
11
13
 
12
14
  export const Base{{COMPONENT_CLASS_NAME}} = () => {
13
- const [value, setValue] = useState('test value');
15
+ const [value, setValue] = useState(configProps.value);
14
16
 
15
17
  const props = {
18
+ value,
19
+ label: configProps.label,
20
+ hideLabel: configProps.hideLabel,
21
+ displayMode: configProps.displayMode,
22
+
16
23
  getPConnect: () => {
17
24
  return {
18
25
  getActionsApi: () => {
19
26
  return {
20
27
  updateFieldValue: (propName, theValue) => {
21
28
  setValue(theValue);
22
- }
29
+ },
30
+ triggerFieldChange: () => {/* nothing */}
23
31
  };
24
32
  },
25
33
  getStateProps: () => {
26
- return { value: '.name' };
34
+ return stateProps;
27
35
  }
28
36
  };
29
37
  },
30
- value,
31
- placeholder: text('Placeholder', 'Test placeholder'),
32
- disabled: boolean('Disabled', false),
33
- readOnly: boolean('Disabled', false),
34
- required: boolean('Disabled', false),
35
- label: text('Label', 'Sample Label'),
36
- testId: text('Test id', 'text-12344566')
38
+ onChange: time => {
39
+ setValue(time.value);
40
+ }
37
41
  };
38
42
 
39
43
  return (
@@ -1,7 +1,7 @@
1
- /* eslint-disable react/no-unused-prop-types */
2
1
  import React from 'react';
3
2
  import TextInput from '@pega/react-sdk-components/lib/components/forms/TextInput';
4
- import { KeyboardTimePicker } from '@material-ui/pickers';
3
+ import { KeyboardDatePicker, MuiPickersUtilsProvider } from '@material-ui/pickers';
4
+ import DayjsUtils from '@date-io/dayjs';
5
5
  import dayjs from 'dayjs';
6
6
  import AccessTimeIcon from '@material-ui/icons/AccessTime';
7
7
  import FieldValueList from '@pega/react-sdk-components/lib/components/designSystemExtensions/FieldValueList';
@@ -58,25 +58,27 @@ export default function {{COMPONENT_CLASS_NAME}}(props: any) {
58
58
 
59
59
  return (
60
60
  <Styled{{COMPONENT_CLASS_NAME}}Wrapper>
61
- <KeyboardTimePicker
62
- variant='inline'
63
- inputVariant='outlined'
64
- placeholder='hh:mm am'
65
- keyboardIcon={<AccessTimeIcon />}
66
- fullWidth
67
- required={required}
68
- disabled={disabled}
69
- error={status === 'error'}
70
- helperText={helperTextToDisplay}
71
- minutesStep={5}
72
- size='small'
73
- label={label}
74
- autoOk
75
- mask='__:__ _m'
76
- format='hh:mm a'
77
- value={timeValue}
78
- onChange={handleChange}
79
- />
61
+ <MuiPickersUtilsProvider utils={DayjsUtils}>
62
+ <KeyboardTimePicker
63
+ variant='inline'
64
+ inputVariant='outlined'
65
+ placeholder='hh:mm am'
66
+ keyboardIcon={<AccessTimeIcon />}
67
+ fullWidth
68
+ required={required}
69
+ disabled={disabled}
70
+ error={status === 'error'}
71
+ helperText={helperTextToDisplay}
72
+ minutesStep={5}
73
+ size='small'
74
+ label={label}
75
+ autoOk
76
+ mask='__:__ _m'
77
+ format='hh:mm a'
78
+ value={timeValue}
79
+ onChange={handleChange}
80
+ />
81
+ </MuiPickersUtilsProvider>
80
82
  </Styled{{COMPONENT_CLASS_NAME}}Wrapper>
81
83
  );
82
84
  }
@@ -0,0 +1,12 @@
1
+ export const configProps = {
2
+ "value": "",
3
+ "label": "Time Sample",
4
+ "helperText": "Time Helper Text",
5
+ "testId": "time-12345678",
6
+ "hasSuggestions": false
7
+ };
8
+
9
+ export const stateProps = {
10
+ "value": ".TimeSample",
11
+ "hasSuggestions": false
12
+ };
@@ -0,0 +1,29 @@
1
+ import { withKnobs } from '@storybook/addon-knobs';
2
+
3
+ import {{COMPONENT_CLASS_NAME}} from './index.tsx';
4
+
5
+ import { configProps } from './mock.stories';
6
+
7
+ export default {
8
+ title: '{{COMPONENT_CLASS_NAME}}',
9
+ decorators: [withKnobs],
10
+ component: {{COMPONENT_CLASS_NAME}}
11
+ };
12
+
13
+ export const Base{{COMPONENT_CLASS_NAME}} = () => {
14
+
15
+ const props = {
16
+ label: configProps.label,
17
+ header: configProps.header,
18
+ description: configProps.description,
19
+ image: configProps.image,
20
+ datasource: configProps.datasource,
21
+ whatsnewlink: configProps.whatsnewlink
22
+ };
23
+
24
+ return (
25
+ <>
26
+ <{{COMPONENT_CLASS_NAME}} {...props} />
27
+ </>
28
+ );
29
+ };
@@ -0,0 +1,23 @@
1
+ // eslint-disable-next-line import/prefer-default-export
2
+ export const configProps = {
3
+ label: 'App announcement',
4
+ header: 'Announcements',
5
+ description: 'Welcome to MediaCo Application for testing SDK frameworks.',
6
+ whatsnewlink: 'https://design.pega.com',
7
+ image:
8
+ 'data:image/svg xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzOSAxMSI PHRpdGxlPlBlZ2EgdGV4dC1vbmx5IGxvZ288L3RpdGxlPjxwYXRoIHN0eWxlPSJmaWxsLW9wYWNpdHk6IC4yNTsiIGZpbGw9IiNmZmYiIGQ9Ik03LjcyIDMuODJjMCAyLjI1LTEuNzggMy40MS00IDMuNDFoLTEuNnYzSDBWLjQyaDMuOTRjMi4zNiAwIDMuNzggMS4zOSAzLjc4IDMuNHptLTQtMS40N2gtMS42djNoMS43QTEuNDcgMS40NyAwIDAgMCA1LjUgMy44MmMwLS45MS0uNjUtMS40Ny0xLjc1LTEuNDd6bTcuNjggNS45MWg1LjN2Mkg5LjI5Vi40Mmg3LjM4djEuOTNoLTUuMjR2Mmg0LjI0djEuOWgtNC4yNHpNMjMuMTggMGE1IDUgMCAwIDEgMy41NyAxLjI4TDI1LjYzIDIuOGEzLjc4IDMuNzggMCAwIDAtMS4wNS0uNjNBNC4zMiA0LjMyIDAgMCAwIDIzLjMxIDIgMy4xNyAzLjE3IDAgMCAwIDIwIDUuMjdhMy4xNiAzLjE2IDAgMCAwIDEgMi4zOSAzLjA3IDMuMDcgMCAwIDAgMi4xNy44NCA0LjYgNC42IDAgMCAwIDIuMDktLjVWNi4xOWgtMi4yVjQuMzhoNC4yNXY0LjU2YTUuNDEgNS40MSAwIDAgMS00LjA4IDEuNTdBNS4zNSA1LjM1IDAgMCAxIDE5LjQzIDlhNS4wNSA1LjA1IDAgMCAxLTEuNTYtMy43NCA1LjIxIDUuMjEgMCAwIDEgMS41Ni0zLjc2QTUuMzEgNS4zMSAwIDAgMSAyMy4xOCAwem0xMS4yOS40Mmw0LjEzIDkuNzloLTIuMjVMMzUuNDggOGgtNC4wNmwtLjkgMi4xOGgtMi4yTDMyLjUxLjQyem0uMjUgNS43MkwzMy40NCAzbC0xLjI5IDMuMTR6bTMtNWEuNzEuNzEgMCAwIDEtLjc0Ljc1LjcxLjcxIDAgMCAxLS43My0uNzUuNzMuNzMgMCAwIDEgLjc1LS43Mi43Mi43MiAwIDAgMSAuNzUuNzF6TTM3IC41M2EuNTkuNTkgMCAwIDAtLjYuNi42MS42MSAwIDEgMCAxLjIxIDAgLjYuNiAwIDAgMC0uNjEtLjZ6bS0uMjQgMVYuNzFIMzdjLjEyIDAgLjE4LjA2LjI1LjA2YS4yMS4yMSAwIDAgMSAuMDcuMTguMTkuMTkgMCAwIDEtLjA3LjE4cy0uMDcuMDgtLjEzLjA4bC4yNi4zNmgtLjJMMzcgMS4yOGgtLjF2LjI5em0uMTMtLjQ0aC4yM2EuMjYuMjYgMCAwIDAgLjA3LS4wOWgtLjA2Yy0uMDUtLjE3LS4wNS0uMTctLjEzLS4xN2gtLjF6Ii8 PC9zdmc ',
9
+ datasource: {
10
+ source: [
11
+ {
12
+ name: 'New React based UI rendering'
13
+ },
14
+ {
15
+ name: 'Support for followers and recents'
16
+ },
17
+ {
18
+ name: 'New authoring experience'
19
+ }
20
+ ],
21
+ fields: {}
22
+ }
23
+ };
@@ -1,6 +1,7 @@
1
1
  import inquirer from 'inquirer';
2
2
  import ora from 'ora';
3
3
  import chalk from 'chalk';
4
+ import { showVersion } from '../../util.js';
4
5
 
5
6
  import {
6
7
  deleteLocalComponents,
@@ -30,6 +31,8 @@ const deleteComponentsFn = async (sourceOfComponents, answers) => {
30
31
  };
31
32
 
32
33
  export default async options => {
34
+ showVersion();
35
+
33
36
  let sourceOfComponentsOption = SOURCE_OF_COMPONENT_TYPES.LOCAL;
34
37
  if (options.params[4] === SOURCE_OF_COMPONENT_TYPES.LOCAL) {
35
38
  sourceOfComponentsOption = options.params[3];
@@ -10,6 +10,8 @@ import {
10
10
  getOptionsCategory
11
11
  } from './helper.js';
12
12
 
13
+ import { showVersion } from '../../util.js';
14
+
13
15
  const deleteComponentsFn = async (sourceOfComponents, answers) => {
14
16
  switch (sourceOfComponents) {
15
17
  case SOURCE_OF_COMPONENT_TYPES.LOCAL: {
@@ -28,6 +30,8 @@ const deleteComponentsFn = async (sourceOfComponents, answers) => {
28
30
  };
29
31
 
30
32
  export default async options => {
33
+ showVersion();
34
+
31
35
  let sourceOfComponentsOption = SOURCE_OF_COMPONENT_TYPES.LOCAL;
32
36
  if (options.params[3] === SOURCE_OF_COMPONENT_TYPES.LOCAL) {
33
37
  sourceOfComponentsOption = options.params[3];
@@ -11,6 +11,8 @@ import {
11
11
  getOptionsCategory
12
12
  } from './helper.js';
13
13
 
14
+ import { showVersion } from '../../util.js';
15
+
14
16
 
15
17
  const getList = async (sourceOfComponents, answers) => {
16
18
  switch (sourceOfComponents) {
@@ -35,6 +37,8 @@ const getList = async (sourceOfComponents, answers) => {
35
37
 
36
38
  export default async options => {
37
39
 
40
+ showVersion();
41
+
38
42
  let sourceOfComponentsOption = SOURCE_OF_COMPONENT_TYPES.LOCAL;
39
43
 
40
44
  if (options.params[4] === SOURCE_OF_COMPONENT_TYPES.LOCAL) {
@@ -10,7 +10,7 @@ import ncp from 'ncp';
10
10
  import chalk from 'chalk';
11
11
  import { updateComponentMap } from '../map/map.js';
12
12
 
13
- import { checkPathAccess, getTokenUrl } from '../../util.js';
13
+ import { checkPathAccess, getTokenUrl, showVersion } from '../../util.js';
14
14
 
15
15
 
16
16
  export const DXCB_CONFIG_JSON_FILENAME = 'dxcb.config.json';
@@ -87,6 +87,7 @@ const validateCompile = async (
87
87
  };
88
88
 
89
89
  export default async options => {
90
+ showVersion();
90
91
 
91
92
  let promptType = null;
92
93
  if (options.params[3]) {
@@ -188,11 +189,6 @@ export default async options => {
188
189
 
189
190
  ];
190
191
 
191
- // get package version, so can display at create
192
- const require = createRequire(import.meta.url);
193
- const pData = require("@pega/dx-component-builder-sdk/package.json");
194
-
195
- console.log(chalk.green("DX Component Builder - SDK vt" + pData.version));
196
192
  await inquirer.prompt(questions).then(async answers => {
197
193
  let {
198
194
  componentName,
@@ -3,7 +3,7 @@ import Listr from 'listr';
3
3
  import chalk from 'chalk';
4
4
 
5
5
  import validate from '../validator/index.js';
6
- import { getComponentDirectoryPath } from '../../util.js';
6
+ import { getComponentDirectoryPath, showVersion } from '../../util.js';
7
7
  import bundleComponent from '../bundle/index.js';
8
8
  import { updateComponentMap } from '../map/map.js';
9
9
  import { lintComponent } from '../linter/index.js';
@@ -11,6 +11,8 @@ import { lintComponent } from '../linter/index.js';
11
11
  import { getPublishComponentQuestions, publishComponentToServer, zipComponent } from './helper.js';
12
12
 
13
13
  export default async options => {
14
+ showVersion();
15
+
14
16
  const questions = await getPublishComponentQuestions();
15
17
  const answers = await inquirer.prompt(questions);
16
18
  const { componentKey, sourceMap, devBuild } = answers;
@@ -9,12 +9,15 @@ import { updateComponentMap } from '../map/map.js';
9
9
 
10
10
  import { getPublishComponentQuestions, publishComponentToServer, zipComponent } from './helper.js';
11
11
  import {
12
- getComponentsObj,
13
- getComponentDirectoryPath
12
+ getComponentsObj,
13
+ getComponentDirectoryPath,
14
+ showVersion
14
15
  } from '../../util.js';
15
16
  import { lintComponent } from '../linter/index.js';
16
17
 
17
18
  export default async options => {
19
+ showVersion();
20
+
18
21
  const components = await getComponentsObj();
19
22
  const questions = await getPublishComponentQuestions();
20
23
  const answers = await inquirer.prompt(questions);
package/src/util.js CHANGED
@@ -3,6 +3,8 @@ import { join } from 'path';
3
3
  import { promisify } from 'util';
4
4
  import https from 'https';
5
5
  import inquirer from 'inquirer';
6
+ import { createRequire } from "module";
7
+ import { URL, fileURLToPath } from 'url';
6
8
 
7
9
  import chalk from 'chalk';
8
10
  import mustache from 'mustache';
@@ -535,6 +537,14 @@ export const validateRulesetVersion = str => {
535
537
  return regex.test(str);
536
538
  };
537
539
 
540
+ export const showVersion = () => {
541
+ // get package version, so can display at start
542
+ const require = createRequire(import.meta.url);
543
+ const pData = require("@pega/dx-component-builder-sdk/package.json");
544
+
545
+ console.log(chalk.green("DX Component Builder - SDK v" + pData.version));
546
+ }
547
+
538
548
  export const getOOTBComponents = async () => {
539
549
  return new Promise((resolve, reject) => {
540
550
  fs.readFile(OOTB_COMPONENTS, 'utf-8', async (err, data) => {