@pega/custom-dx-components 2.0.8 → 2.0.9
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/constants.js +29 -7
- package/src/tasks/create/index.js +46 -6
- package/src/tasks/create/templates/Constellation/Field/Boolean/Boolean.js.mustache +38 -0
- package/src/tasks/create/templates/Constellation/Field/Boolean/boolean-format.js.mustache +26 -0
- package/src/tasks/create/templates/Constellation/Field/Boolean/config.json.mustache +145 -0
- package/src/tasks/create/templates/Constellation/Field/Boolean/demo.stories.jsx.mustache +44 -0
- package/src/tasks/create/templates/Constellation/Field/Boolean/event-utils.js.mustache +18 -0
- package/src/tasks/create/templates/Constellation/Field/Boolean/index.jsx.mustache +171 -0
- package/src/tasks/create/templates/Constellation/Field/Boolean/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Field/Date/config.json.mustache +195 -0
- package/src/tasks/create/templates/Constellation/Field/Date/date.js.mustache +327 -0
- package/src/tasks/create/templates/Constellation/Field/Date/demo.stories.jsx.mustache +44 -0
- package/src/tasks/create/templates/Constellation/Field/Date/index.jsx.mustache +254 -0
- package/src/tasks/create/templates/Constellation/Field/Date/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Field/Date/suggestions-handler.js +10 -0
- package/src/tasks/create/templates/Constellation/Field/DateTime/config.json.mustache +256 -0
- package/src/tasks/create/templates/Constellation/Field/DateTime/date-time.js.mustache +93 -0
- package/src/tasks/create/templates/Constellation/Field/DateTime/date-utils.js +286 -0
- package/src/tasks/create/templates/Constellation/Field/DateTime/date.js.mustache +327 -0
- package/src/tasks/create/templates/Constellation/Field/DateTime/demo.stories.jsx.mustache +44 -0
- package/src/tasks/create/templates/Constellation/Field/DateTime/index.jsx.mustache +252 -0
- package/src/tasks/create/templates/Constellation/Field/DateTime/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Field/DateTime/suggestions-handler.js +10 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal/config.json.mustache +278 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal/demo.stories.jsx.mustache +44 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal/event-utils.js.mustache +18 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal/index.jsx.mustache +272 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal/suggestions-handler.js +10 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/config.json.mustache +291 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/demo.stories.jsx.mustache +44 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/event-utils.js.mustache +18 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/index.jsx.mustache +300 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/suggestions-handler.js +10 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/config.json.mustache +93 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/demo.stories.jsx.mustache +44 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/event-utils.js.mustache +18 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/index.jsx.mustache +275 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/suggestions-handler.js +10 -0
- package/src/tasks/create/templates/Constellation/Field/Integer/config.json.mustache +347 -0
- package/src/tasks/create/templates/Constellation/Field/Integer/demo.stories.jsx.mustache +44 -0
- package/src/tasks/create/templates/Constellation/Field/Integer/event-utils.js.mustache +18 -0
- package/src/tasks/create/templates/Constellation/Field/Integer/index.jsx.mustache +335 -0
- package/src/tasks/create/templates/Constellation/Field/Integer/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Field/Integer/suggestions-handler.js +10 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist/config.json.mustache +114 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist/demo.stories.jsx.mustache +44 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist/event-utils.js.mustache +18 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist/index.jsx.mustache +308 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist/picklist.js.mustache +43 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist/suggestions-handler.js +10 -0
- package/src/tasks/create/templates/Constellation/Field/Text/config.json.mustache +62 -0
- package/src/tasks/create/templates/Constellation/Field/Text/demo.stories.jsx.mustache +44 -0
- package/src/tasks/create/templates/Constellation/Field/Text/index.jsx.mustache +60 -0
- package/src/tasks/create/templates/Constellation/Field/Text/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Email/config.json.mustache +111 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Email/demo.stories.jsx.mustache +44 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Email/event-utils.js.mustache +18 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Email/index.jsx.mustache +189 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Email/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Email/suggestions-handler.js +10 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Email/text-email.js.mustache +43 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Input/StatusWork.js +27 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Input/config.json.mustache +111 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Input/demo.stories.jsx.mustache +44 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Input/event-utils.js.mustache +18 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Input/index.jsx.mustache +196 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Input/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Input/suggestions-handler.js +10 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Input/text-input.js.mustache +43 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/config.json.mustache +111 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/demo.stories.jsx.mustache +44 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/event-utils.js.mustache +18 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/index.jsx.mustache +189 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/suggestions-handler.js +10 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/text-paragraph.js.mustache +43 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/config.json.mustache +123 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/demo.stories.jsx.mustache +44 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/event-utils.js.mustache +18 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/index.jsx.mustache +223 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/suggestions-handler.js +10 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/text-phone.js.mustache +43 -0
- package/src/tasks/create/templates/Constellation/Field/Text-URL/config.json.mustache +237 -0
- package/src/tasks/create/templates/Constellation/Field/Text-URL/demo.stories.jsx.mustache +44 -0
- package/src/tasks/create/templates/Constellation/Field/Text-URL/event-utils.js.mustache +18 -0
- package/src/tasks/create/templates/Constellation/Field/Text-URL/index.jsx.mustache +232 -0
- package/src/tasks/create/templates/Constellation/Field/Text-URL/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Field/Text-URL/suggestions-handler.js +10 -0
- package/src/tasks/create/templates/Constellation/Field/Text-URL/text-url.js.mustache +172 -0
- package/src/tasks/create/templates/Constellation/Field/TimeofDay/config.json.mustache +185 -0
- package/src/tasks/create/templates/Constellation/Field/TimeofDay/demo.stories.jsx.mustache +44 -0
- package/src/tasks/create/templates/Constellation/Field/TimeofDay/index.jsx.mustache +213 -0
- package/src/tasks/create/templates/Constellation/Field/TimeofDay/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Field/TimeofDay/suggestions-handler.js +10 -0
- package/src/tasks/create/templates/Constellation/Field/TimeofDay/time-of-day.js.mustache +286 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS/OneColumnDetails.svg +22 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS/config.json.mustache +35 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS/index.jsx.mustache +99 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/TwoColumnDetails.svg +28 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/config.json.mustache +42 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/index.jsx.mustache +99 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Template/FORM/DefaultForm.svg +29 -0
- package/src/tasks/create/templates/Constellation/Template/FORM/config.json.mustache +45 -0
- package/src/tasks/create/templates/Constellation/Template/FORM/index.jsx.mustache +49 -0
- package/src/tasks/create/templates/Constellation/Template/FORM/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Template/FORM-region/TwoColumn.svg +38 -0
- package/src/tasks/create/templates/Constellation/Template/FORM-region/config.json.mustache +27 -0
- package/src/tasks/create/templates/Constellation/Template/FORM-region/index.jsx.mustache +43 -0
- package/src/tasks/create/templates/Constellation/Template/FORM-region/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Template/PAGE/GetNextWork.js.mustache +29 -0
- package/src/tasks/create/templates/Constellation/Template/PAGE/OneColumnPage.svg +36 -0
- package/src/tasks/create/templates/Constellation/Template/PAGE/config.json.mustache +32 -0
- package/src/tasks/create/templates/Constellation/Template/PAGE/index.jsx.mustache +68 -0
- package/src/tasks/create/templates/Constellation/Template/PAGE/localizations.json.mustache +4 -0
- package/src/tasks/create/templates/Constellation/Template/PAGE/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Template/PAGE/utils.js.mustache +226 -0
- package/src/tasks/create/templates/Constellation/Widget/CASE/OneColumnPage.svg +36 -0
- package/src/tasks/create/templates/Constellation/Widget/CASE/config.json.mustache +23 -0
- package/src/tasks/create/templates/Constellation/Widget/CASE/index.jsx.mustache +75 -0
- package/src/tasks/create/templates/Constellation/Widget/CASE/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE/OneColumnPage.svg +36 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE/config.json.mustache +59 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE/index.jsx.mustache +48 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/Avatar.js.mustache +73 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/OneColumnPage.svg +36 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/Operator.js.mustache +239 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/config.json.mustache +66 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/index.jsx.mustache +110 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/styles.js.mustache +7 -0
- package/src/tasks/init/template/package.json.mustache +6 -1
- package/src/tasks/publish/bundle/builder/index.js +49 -5
- package/src/tasks/publish/bundle/builder/webpack.config.js +7 -3
- package/src/tasks/validator/index.js +107 -8
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { Fragment, memo } from 'react';
|
|
2
|
+
import { DateTimeDisplay, Card, CardHeader, CardContent, Flex } from '@pega/cosmos-react-core';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
|
|
5
|
+
// includes in bundle
|
|
6
|
+
import Operator from './Operator';
|
|
7
|
+
|
|
8
|
+
import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
// Duplicated runtime code from Constellation Design System Component
|
|
12
|
+
|
|
13
|
+
// props passed in combination of props from property panel (config.json) and run time props from Constellation
|
|
14
|
+
// any default values in config.pros should be set in defaultProps at bottom of this file
|
|
15
|
+
export default function {{COMPONENT_CLASS_NAME}}(props) {
|
|
16
|
+
|
|
17
|
+
const {
|
|
18
|
+
getPConnect,
|
|
19
|
+
title,
|
|
20
|
+
label,
|
|
21
|
+
createLabel,
|
|
22
|
+
updateLabel,
|
|
23
|
+
createOperator,
|
|
24
|
+
updateOperator,
|
|
25
|
+
createDateTime,
|
|
26
|
+
updateDateTime,
|
|
27
|
+
resolveLabel,
|
|
28
|
+
resolveOperator,
|
|
29
|
+
resolveDateTime,
|
|
30
|
+
hideLabel,
|
|
31
|
+
defVal
|
|
32
|
+
} = props;
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
const [_label, user, dateTimeValue] =
|
|
36
|
+
label === 'Create operator'
|
|
37
|
+
? [createLabel, createOperator, createDateTime]
|
|
38
|
+
: label === 'Update operator'
|
|
39
|
+
? [updateLabel, updateOperator, updateDateTime]
|
|
40
|
+
: [resolveLabel, resolveOperator, resolveDateTime];
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
return user.userId && user.userName ? (
|
|
45
|
+
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
46
|
+
<Card>
|
|
47
|
+
<CardHeader>{title}</CardHeader>
|
|
48
|
+
<CardContent>
|
|
49
|
+
{{! pick new delimiteres for mustache }} {{=<% %>=}}
|
|
50
|
+
<Flex container={{ direction: 'row'}}>
|
|
51
|
+
<Operator label={hideLabel ? null : _label} name={user.userName} id={user.userId} getPConnect={getPConnect} />
|
|
52
|
+
|
|
53
|
+
<%={{ }}=%> {{! revert delimiteres for mustache }}
|
|
54
|
+
{dateTimeValue && (
|
|
55
|
+
<Fragment>
|
|
56
|
+
{' '}
|
|
57
|
+
<DateTimeDisplay value={dateTimeValue} variant='relative' />
|
|
58
|
+
</Fragment>
|
|
59
|
+
)}
|
|
60
|
+
</Flex>
|
|
61
|
+
</CardContent>
|
|
62
|
+
</Card>
|
|
63
|
+
|
|
64
|
+
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
65
|
+
) : (
|
|
66
|
+
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
67
|
+
defVal
|
|
68
|
+
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
{{COMPONENT_CLASS_NAME}}.defaultProps = {
|
|
76
|
+
"label": "Create operator",
|
|
77
|
+
"title": "Create operator",
|
|
78
|
+
createLabel: null,
|
|
79
|
+
updateLabel: null,
|
|
80
|
+
createOperator: null,
|
|
81
|
+
updateOperator: null,
|
|
82
|
+
createDateTime: null,
|
|
83
|
+
updateDateTime: null,
|
|
84
|
+
resolveLabel: null,
|
|
85
|
+
resolveOperator: null,
|
|
86
|
+
resolveDateTime: null,
|
|
87
|
+
hideLabel: false,
|
|
88
|
+
defVal: '––'
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
{{COMPONENT_CLASS_NAME}}.propTypes = {
|
|
92
|
+
getPConnect: PropTypes.func.isRequired,
|
|
93
|
+
label: PropTypes.string,
|
|
94
|
+
createLabel: PropTypes.string,
|
|
95
|
+
updateLabel: PropTypes.string,
|
|
96
|
+
resolveLabel: PropTypes.string,
|
|
97
|
+
createOperator: PropTypes.objectOf(PropTypes.any),
|
|
98
|
+
updateOperator: PropTypes.objectOf(PropTypes.any),
|
|
99
|
+
resolveOperator: PropTypes.objectOf(PropTypes.any),
|
|
100
|
+
createDateTime: PropTypes.string,
|
|
101
|
+
updateDateTime: PropTypes.string,
|
|
102
|
+
resolveDateTime: PropTypes.string,
|
|
103
|
+
hideLabel: PropTypes.bool
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
// as objects are there in props, shallow comparision fails & re-rendering of comp happens even with
|
|
107
|
+
// same key value pairs in obj. hence using custom comparison function on when to re-render
|
|
108
|
+
//const comparisonFn = (prevProps, nextProps) => {
|
|
109
|
+
// return prevProps.updateDateTime === nextProps.updateDateTime;
|
|
110
|
+
//};
|
|
@@ -36,18 +36,23 @@
|
|
|
36
36
|
"sideEffects": false,
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@pega/cosmos-react-core": "^3.0.0-rc.4",
|
|
39
|
+
"@pega/cosmos-react-work": "3.0.0-rc.4",
|
|
39
40
|
"@storybook/addon-knobs": "^6.3.1",
|
|
41
|
+
"dayjs": "^1.11.5",
|
|
42
|
+
"jest": "^29.3.1",
|
|
40
43
|
"polished": "^4.2.2",
|
|
41
44
|
"prop-types": "^15.8.1",
|
|
42
45
|
"react": "^17.0.2",
|
|
43
46
|
"react-autosuggest": "^10.1.0",
|
|
44
47
|
"react-dom": "^17.0.2",
|
|
48
|
+
"react-is": "^18.2.0",
|
|
45
49
|
"react-player": "^2.10.1",
|
|
50
|
+
"react-redux": "^7.2.6",
|
|
46
51
|
"styled-components": "^5.3.5"
|
|
47
52
|
},
|
|
48
53
|
"devDependencies": {
|
|
49
54
|
"@pega/configs": "^0.3.4",
|
|
50
|
-
"@pega/custom-dx-components": "^2.0.
|
|
55
|
+
"@pega/custom-dx-components": "^2.0.9",
|
|
51
56
|
"@storybook/addon-actions": "^6.5.12",
|
|
52
57
|
"@storybook/addon-essentials": "^6.5.12",
|
|
53
58
|
"@storybook/addon-links": "^6.5.12",
|
|
@@ -36,13 +36,40 @@ const printFileSizesAfterBuild = FileSizeReporter.printFileSizesAfterBuild;
|
|
|
36
36
|
const WARN_AFTER_BUNDLE_GZIP_SIZE = 512 * 1024;
|
|
37
37
|
const WARN_AFTER_CHUNK_GZIP_SIZE = 1024 * 1024;
|
|
38
38
|
|
|
39
|
+
let compilationErrors = null;
|
|
40
|
+
|
|
39
41
|
// Create the build and print the deployment instructions.
|
|
40
42
|
function build(config, previousFileSizes) {
|
|
41
43
|
console.log(`Creating a ${Env} build...`);
|
|
42
44
|
|
|
45
|
+
|
|
46
|
+
|
|
43
47
|
const compiler = webpack(config);
|
|
44
48
|
return new Promise((resolve, reject) => {
|
|
45
49
|
compiler.run((err, stats) => {
|
|
50
|
+
|
|
51
|
+
if (err != null && typeof (err) == "object") {
|
|
52
|
+
if (err.error != undefined) {
|
|
53
|
+
//store and print elsewhere
|
|
54
|
+
compilationErrors = err.error;
|
|
55
|
+
//console.log("err:" + err);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (stats != null & typeof(stats) == "object") {
|
|
59
|
+
if (stats.errors != undefined) {
|
|
60
|
+
console.log("stats:" + stats);
|
|
61
|
+
}
|
|
62
|
+
else if (stats.compilation != undefined && stats.compilation.errors != undefined) {
|
|
63
|
+
|
|
64
|
+
//store and print elsewhere
|
|
65
|
+
compilationErrors = stats.compilation.errors;
|
|
66
|
+
|
|
67
|
+
console.log("stats:" + stats);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
|
|
46
73
|
let messages;
|
|
47
74
|
if (err) {
|
|
48
75
|
if (!err.message) {
|
|
@@ -131,7 +158,11 @@ export default ({
|
|
|
131
158
|
.then(
|
|
132
159
|
({ stats, previousFileSizes, warnings }) => {
|
|
133
160
|
if (warnings.length) {
|
|
134
|
-
console.log(chalk.yellow('Compiled with warnings.\n'), warnings[0].message);
|
|
161
|
+
//console.log(chalk.yellow('Compiled with warnings.\n'), warnings[0].message);
|
|
162
|
+
console.log(chalk.yellow('Compiled with warnings.\n'));
|
|
163
|
+
for (let warning in warnings) {
|
|
164
|
+
console.log(chalk.yellow("Warning.."), warnings[warning].message);
|
|
165
|
+
}
|
|
135
166
|
} else {
|
|
136
167
|
console.log(chalk.green('Compiled successfully.\n'));
|
|
137
168
|
}
|
|
@@ -146,7 +177,7 @@ export default ({
|
|
|
146
177
|
);
|
|
147
178
|
resolve('done emitting');
|
|
148
179
|
},
|
|
149
|
-
err
|
|
180
|
+
err => {
|
|
150
181
|
reject();
|
|
151
182
|
const tscCompileOnError = process.env.TSC_COMPILE_ON_ERROR === 'true';
|
|
152
183
|
if (tscCompileOnError) {
|
|
@@ -156,11 +187,24 @@ export default ({
|
|
|
156
187
|
)
|
|
157
188
|
);
|
|
158
189
|
printBuildError(err);
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
|
|
190
|
+
}
|
|
191
|
+
else if (compilationErrors != null) {
|
|
192
|
+
if (compilationErrors.length == undefined) {
|
|
193
|
+
console.log(chalk.red("Error..."), compilationErrors.message);
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
for (let error in compilationErrors) {
|
|
197
|
+
console.log(chalk.red("Error..."), compilationErrors[error].message);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
162
201
|
process.exit(1);
|
|
163
202
|
}
|
|
203
|
+
else {
|
|
204
|
+
console.log(chalk.red('Failed to compile.\n'));
|
|
205
|
+
printBuildError(JSON.stringify(err));
|
|
206
|
+
|
|
207
|
+
}
|
|
164
208
|
}
|
|
165
209
|
)
|
|
166
210
|
.catch(err => {
|
|
@@ -103,13 +103,13 @@ export default (
|
|
|
103
103
|
return loaders;
|
|
104
104
|
};
|
|
105
105
|
return {
|
|
106
|
-
mode:
|
|
106
|
+
mode: devBuild ? 'development' : 'production',
|
|
107
107
|
// Stop compilation early in production
|
|
108
108
|
bail: isEnvProduction,
|
|
109
109
|
// These are the "entry points" to our application.
|
|
110
110
|
// This means they will be the "root" imports that are included in JS bundle.
|
|
111
111
|
entry: inputFile,
|
|
112
|
-
devtool:
|
|
112
|
+
devtool: devBuild ? 'eval-cheap-module-source-map' : false,
|
|
113
113
|
output: {
|
|
114
114
|
// The build folder.
|
|
115
115
|
path: paths.appBuild,
|
|
@@ -306,22 +306,26 @@ export default (
|
|
|
306
306
|
contextRegExp: /moment$/
|
|
307
307
|
}),
|
|
308
308
|
/* Ignore cosmos icons */
|
|
309
|
+
/*
|
|
309
310
|
new webpack.IgnorePlugin({
|
|
310
311
|
resourceRegExp: /^\.\/icons$/,
|
|
311
312
|
contextRegExp: /@pega\/cosmos-react-core\/lib\/components\/Icon$/
|
|
312
313
|
}),
|
|
314
|
+
*/
|
|
313
315
|
/* Ignore cosmos icons - windows */
|
|
316
|
+
/*
|
|
314
317
|
new webpack.IgnorePlugin({
|
|
315
318
|
resourceRegExp: /^\.\/icons$/,
|
|
316
319
|
contextRegExp: /@pega\\cosmos-react-core\\lib\\components\\Icon$/
|
|
317
320
|
}),
|
|
321
|
+
*/
|
|
318
322
|
new webpack.optimize.LimitChunkCountPlugin({
|
|
319
323
|
maxChunks: 5
|
|
320
324
|
}),
|
|
321
325
|
new webpack.optimize.MinChunkSizePlugin({
|
|
322
326
|
minChunkSize: 100000 // Minimum number of characters
|
|
323
327
|
}),
|
|
324
|
-
|
|
328
|
+
!devBuild && new CompressionPlugin(compressionBRConfObj)
|
|
325
329
|
|
|
326
330
|
/* Dont generate gzip file */
|
|
327
331
|
/* isEnvProduction && new CompressionPlugin(compressionGZConfObj) */
|
|
@@ -43,19 +43,118 @@ const schema = {
|
|
|
43
43
|
type: 'array',
|
|
44
44
|
uniqueItems: true,
|
|
45
45
|
items: {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
46
|
+
anyOf: [
|
|
47
|
+
{
|
|
48
|
+
type: 'object',
|
|
49
|
+
properties: {
|
|
50
|
+
name: { type: 'string' },
|
|
51
|
+
label: { type: 'string' },
|
|
52
|
+
format: { type: 'string' }
|
|
53
|
+
},
|
|
54
|
+
required: ['name', 'label', 'format']
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
type: 'object',
|
|
58
|
+
properties: {
|
|
59
|
+
format: { type: 'string' },
|
|
60
|
+
source: {
|
|
61
|
+
type: 'object',
|
|
62
|
+
properties: {
|
|
63
|
+
name: { type: 'string' },
|
|
64
|
+
label: { type: 'string' },
|
|
65
|
+
format: { type: 'string' }
|
|
66
|
+
},
|
|
67
|
+
required: ['name', 'label', 'format']
|
|
68
|
+
},
|
|
69
|
+
cascadeElements: {
|
|
70
|
+
type: 'array',
|
|
71
|
+
uniqueItems: true,
|
|
72
|
+
items: {
|
|
73
|
+
anyOf: [
|
|
74
|
+
{
|
|
75
|
+
type: 'object',
|
|
76
|
+
properties: {
|
|
77
|
+
key: { type: 'string'},
|
|
78
|
+
name: { type: 'string' },
|
|
79
|
+
label: { type: 'string' },
|
|
80
|
+
format: { type: 'string' }
|
|
81
|
+
},
|
|
82
|
+
required: ['key','name', 'label', 'format']
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
required: ['format']
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
type: 'object',
|
|
92
|
+
properties: {
|
|
93
|
+
label: { type: 'string' },
|
|
94
|
+
format: { type: 'string' },
|
|
95
|
+
properties: {
|
|
96
|
+
type: 'array',
|
|
97
|
+
uniqueItems: true,
|
|
98
|
+
items: {
|
|
99
|
+
anyOf: [
|
|
100
|
+
{
|
|
101
|
+
type: 'object',
|
|
102
|
+
properties: {
|
|
103
|
+
name: { type: 'string' },
|
|
104
|
+
label: { type: 'string' },
|
|
105
|
+
format: { type: 'string' }
|
|
106
|
+
},
|
|
107
|
+
required: ['name', 'label', 'format']
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
type: 'object',
|
|
111
|
+
properties: {
|
|
112
|
+
variant: { type: 'string' },
|
|
113
|
+
label: { type: 'string' },
|
|
114
|
+
format: { type: 'string' }
|
|
115
|
+
},
|
|
116
|
+
required: ['variant', 'label', 'format']
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
type: 'object',
|
|
120
|
+
properties: {
|
|
121
|
+
format: { type: 'string' },
|
|
122
|
+
elements: {
|
|
123
|
+
type: 'array',
|
|
124
|
+
uniqueItems: true,
|
|
125
|
+
items: {
|
|
126
|
+
anyOf: [
|
|
127
|
+
{
|
|
128
|
+
type: 'object',
|
|
129
|
+
properties: {
|
|
130
|
+
key: { type: 'string' },
|
|
131
|
+
name: { type: 'string' },
|
|
132
|
+
label: { type: 'string' },
|
|
133
|
+
format: { type: 'string' },
|
|
134
|
+
variant: { type: 'string' }
|
|
135
|
+
},
|
|
136
|
+
required: ['key', 'format', 'label']
|
|
137
|
+
}
|
|
138
|
+
]
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
required: ['format', 'elements']
|
|
143
|
+
},
|
|
144
|
+
]
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
},
|
|
149
|
+
required: ['label', 'format'],
|
|
150
|
+
}
|
|
151
|
+
]
|
|
53
152
|
}
|
|
54
153
|
},
|
|
55
154
|
defaultConfig: { type: 'object' }
|
|
56
155
|
},
|
|
57
156
|
required: ['componentKey', 'name', 'description', 'type', 'subtype', 'properties'],
|
|
58
|
-
additionalProperties:
|
|
157
|
+
additionalProperties: true
|
|
59
158
|
};
|
|
60
159
|
|
|
61
160
|
const validateSchema = ajv.compile(schema);
|