@pega/custom-dx-components 25.1.10-alpha-0.7 → 25.1.10-alpha-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/tasks/build-jest-assets/index.js +4 -4
- package/src/tasks/create/index.js +19 -33
- package/src/tasks/create/templates/Constellation/Field/Boolean/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Field/Date/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Field/DateTime/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Field/Decimal/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Field/Integer/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Field/Picklist/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Field/Text/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Field/Text-Email/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Field/Text-Input/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Field/Text-URL/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Field/TimeofDay/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Template/DETAILS/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Template/FORM/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Template/FORM-region/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Template/PAGE/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Widget/CASE/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Widget/PAGE/config.json.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/config.json.mustache +0 -1
- package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/config.json.mustache +0 -1
- package/src/tasks/create/templates/Launchpad/Widget/CASE/config.json.mustache +0 -1
- package/src/tasks/create/templates/Launchpad/Widget/PAGE/config.json.mustache +0 -1
- package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/config.json.mustache +0 -1
- package/src/tasks/create-all/index.js +22 -35
- package/src/tasks/create-lib/helper.js +2 -0
- package/src/tasks/delete-pub/helper.js +5 -5
- package/src/tasks/delete-pub/index.js +22 -9
- package/src/tasks/export-archive/index.js +36 -23
- package/src/tasks/import-archive/index.js +12 -12
- package/src/tasks/init/template/package.json.mustache +1 -1
- package/src/tasks/init/template/tasks.config.json +3 -1
- package/src/tasks/list-pub/helper.js +6 -3
- package/src/tasks/list-pub/index.js +24 -14
- package/src/tasks/publish/index.js +4 -0
- package/src/tasks/publish-archive/helper.js +2 -2
- package/src/tasks/publish-archive/index.js +16 -7
- package/src/tasks/show-status/index.js +18 -6
- package/src/tasks/validator/index.js +0 -2
- package/src/util.js +78 -20
- package/tests/assets/library/components/create/Pega_DXIL_MyTestText/config.json +0 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyBoolean/config.json +0 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/config.json +0 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyCurrency/config.json +0 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDate/config.json +0 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDateTime/config.json +0 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDecimal/config.json +0 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDetails/config.json +0 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyEmail/config.json +0 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyForm/config.json +0 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/config.json +0 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyInteger/config.json +0 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPage/config.json +0 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/config.json +0 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPageWidget/config.json +0 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyParagraph/config.json +0 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPercentage/config.json +0 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPhone/config.json +0 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPicklist/config.json +0 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyRadiobuttons/config.json +0 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MySearchbox/config.json +0 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyText/config.json +0 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTextInput/config.json +0 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/config.json +0 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/config.json +0 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/config.json +0 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyURL/config.json +0 -1
- package/tests/assets/original/components/create/Pega_DXIL_MyTestText/config.json +0 -1
- package/tests/assets/original/components/create/shared/PConnProps.d.ts +46 -0
- package/tests/assets/original/components/create/shared/create-nonce.ts +5 -0
- package/tests/assets/original/components/create/shared/suggestions-handler.ts +9 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyBoolean/config.json +0 -1
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/config.json +0 -1
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyCurrency/config.json +0 -1
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDate/config.json +0 -1
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDateTime/config.json +0 -1
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDecimal/config.json +0 -1
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDetails/config.json +0 -1
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyEmail/config.json +0 -1
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyForm/config.json +0 -1
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/config.json +0 -1
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyInteger/config.json +0 -1
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPage/config.json +0 -1
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/config.json +0 -1
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPageWidget/config.json +0 -1
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyParagraph/config.json +0 -1
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPercentage/config.json +0 -1
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPhone/config.json +0 -1
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPicklist/config.json +0 -1
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyRadiobuttons/config.json +0 -1
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MySearchbox/config.json +0 -1
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyText/config.json +0 -1
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTextInput/config.json +0 -1
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/config.json +0 -1
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/config.json +0 -1
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/config.json +0 -1
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyURL/config.json +0 -1
- package/tests/assets/original/components/createAll/Constellation/shared/PConnProps.d.ts +46 -0
- package/tests/assets/original/components/createAll/Constellation/shared/create-nonce.ts +5 -0
- package/tests/assets/original/components/createAll/Constellation/shared/suggestions-handler.ts +9 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyBoolean/config.json +0 -1
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyCaseWidget/config.json +0 -1
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyCurrency/config.json +0 -1
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDate/config.json +0 -1
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDateTime/config.json +0 -1
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDecimal/config.json +0 -1
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDetails/config.json +0 -1
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyEmail/config.json +0 -1
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyForm/config.json +0 -1
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyIconButtonURL/config.json +0 -1
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyInteger/config.json +0 -1
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPage/config.json +0 -1
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPageCaseWidget/config.json +0 -1
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPageWidget/config.json +0 -1
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyParagraph/config.json +0 -1
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPercentage/config.json +0 -1
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPhone/config.json +0 -1
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPicklist/config.json +0 -1
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyRadiobuttons/config.json +0 -1
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MySearchbox/config.json +0 -1
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyText/config.json +0 -1
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTextInput/config.json +0 -1
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/config.json +0 -1
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/config.json +0 -1
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/config.json +0 -1
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyURL/config.json +0 -1
- package/tests/assets/original/components/createAll/Launchpad/shared/PConnProps.d.ts +46 -0
- package/tests/assets/original/components/createAll/Launchpad/shared/create-nonce.ts +5 -0
- package/tests/assets/original/components/createAll/Launchpad/shared/suggestions-handler.ts +9 -0
- package/tests/functional/localCreateAllListDeleteAll.test.js +1 -1
- package/tests/functional/localCreateBuildAllDeleteAll.test.js +3 -3
- package/tests/functional/localCreateBuildDelete.test.js +1 -1
- package/tests/functional/localCreateListDelete.test.js +1 -1
- package/tests/functional/localCreatePublishAllDeleteAll.test.js +3 -3
- package/tests/functional/localCreatePublishDelete.test.js +1 -1
- package/tests/functional/localCreateRenameDelete.test.js +1 -1
- package/tests/functional/localLibCreateLibBuildLibDeleteLib.test.js +3 -3
- package/tests/functional/localLibCreateLibBuildLibListPubDeleteLib.test.js +3 -3
- package/tests/functional/localLibCreateLibExportImportLib.test.js +1 -1
- package/tests/functional/localLibCreateLibExportLib.test.js +1 -1
- package/tests/functional/localLibCreateLibListDeleteLib.test.js +1 -1
- package/tests/functional/localLibCreateLibListMoveDeleteLib.test.js +1 -1
- package/tests/functional/localLibCreateLibListSwitchDeleteLib.test.js +1 -1
- package/tests/functional/localLibCreateLibStatusDeleteLib.test.js +1 -1
- package/tests/functional/localLibCreateLibStoreRestoreDeleteLib.test.js +1 -1
- package/tests/functional/localLibCreateLibValidateDeleteLib.test.js +3 -3
- package/tests/functional/localLibCreateLibVersionDeleteLib.test.js +1 -1
package/package.json
CHANGED
|
@@ -102,7 +102,7 @@ const createJestOriginalAssets = async(isLaunchPad = false) => {
|
|
|
102
102
|
await deleteAssets();
|
|
103
103
|
|
|
104
104
|
// const framework = await getFramework();
|
|
105
|
-
let args = [ '','', '', 'My', '0.0.1', 'DXIL', '
|
|
105
|
+
let args = [ '','', '', 'My', '0.0.1', 'DXIL', 'Pega'];
|
|
106
106
|
let myOptions = {};
|
|
107
107
|
myOptions["params"] = args;
|
|
108
108
|
|
|
@@ -125,7 +125,7 @@ const createJestOriginalAssets = async(isLaunchPad = false) => {
|
|
|
125
125
|
await copyAssets(createAllPath);
|
|
126
126
|
await deleteAssets();
|
|
127
127
|
|
|
128
|
-
args = [ '','', '', 'Field', 'Text', 'MyTestText', 'My Test Text', '0.0.1','DXIL', '
|
|
128
|
+
args = [ '','', '', 'Field', 'Text', 'MyTestText', 'My Test Text', '0.0.1','DXIL', 'My Test Text Description', 'Pega'];
|
|
129
129
|
myOptions = {};
|
|
130
130
|
myOptions["params"] = args;
|
|
131
131
|
|
|
@@ -157,7 +157,7 @@ const createJestLibraryAssets = async(isLaunchPad = false) => {
|
|
|
157
157
|
await createLib(myOptions);
|
|
158
158
|
|
|
159
159
|
// const framework = await getFramework();
|
|
160
|
-
args = [ '', '', '', 'My', '0.0.1', 'DXIL', '
|
|
160
|
+
args = [ '', '', '', 'My', '0.0.1', 'DXIL', 'Pega'];
|
|
161
161
|
myOptions = {};
|
|
162
162
|
myOptions["params"] = args;
|
|
163
163
|
|
|
@@ -180,7 +180,7 @@ const createJestLibraryAssets = async(isLaunchPad = false) => {
|
|
|
180
180
|
await copyAssets(createAllPath);
|
|
181
181
|
await deleteAssets();
|
|
182
182
|
|
|
183
|
-
args = [ '','', '', 'Field', 'Text', 'MyTestText', 'My Test Text', '0.0.1','DXIL', '
|
|
183
|
+
args = [ '','', '', 'Field', 'Text', 'MyTestText', 'My Test Text', '0.0.1','DXIL', 'My Test Text Description', 'Pega'];
|
|
184
184
|
myOptions = {};
|
|
185
185
|
myOptions["params"] = args;
|
|
186
186
|
|
|
@@ -24,7 +24,8 @@ import {
|
|
|
24
24
|
checkLibraryAndArchives,
|
|
25
25
|
getConfigDefaults,
|
|
26
26
|
getSubTypeLabel,
|
|
27
|
-
getMaxComponentNameCount
|
|
27
|
+
getMaxComponentNameCount,
|
|
28
|
+
getStandaloneMaxComponentNameCount
|
|
28
29
|
} from '../../util.js';
|
|
29
30
|
import { COMPONENT_SCHEMA, SHARED_FILE_NAMES } from '../../constants.js';
|
|
30
31
|
|
|
@@ -48,9 +49,7 @@ const compileMustacheTemplates = async (
|
|
|
48
49
|
type,
|
|
49
50
|
subtype,
|
|
50
51
|
description,
|
|
51
|
-
organization
|
|
52
|
-
allowedApplications = ''
|
|
53
|
-
}
|
|
52
|
+
organization }
|
|
54
53
|
) => {
|
|
55
54
|
const files = fs.readdirSync(componentDirectory);
|
|
56
55
|
const componentClassName = convertIntoPascalCase(componentKey);
|
|
@@ -91,17 +90,17 @@ const compileMustacheTemplates = async (
|
|
|
91
90
|
|
|
92
91
|
const isPicklist = subtype === 'Picklist';
|
|
93
92
|
|
|
94
|
-
if (allowedApplications.trim() === '') {
|
|
95
|
-
|
|
96
|
-
} else {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
93
|
+
// if (allowedApplications.trim() === '') {
|
|
94
|
+
// allowedApplications = [];
|
|
95
|
+
// } else {
|
|
96
|
+
// if (allowedApplications.indexOf(',') !== -1) {
|
|
97
|
+
// allowedApplications = allowedApplications.split(',');
|
|
98
|
+
// }
|
|
99
|
+
// allowedApplications = [].concat(allowedApplications);
|
|
100
|
+
// }
|
|
102
101
|
|
|
103
102
|
|
|
104
|
-
allowedApplications = allowedApplications.filter(el => !!el.trim()).map(el => el.trim());
|
|
103
|
+
// allowedApplications = allowedApplications.filter(el => !!el.trim()).map(el => el.trim());
|
|
105
104
|
files.forEach(file => {
|
|
106
105
|
const filePath = path.join(componentDirectory, file);
|
|
107
106
|
|
|
@@ -115,7 +114,6 @@ const compileMustacheTemplates = async (
|
|
|
115
114
|
ORGANIZATION: organization,
|
|
116
115
|
VERSION: version,
|
|
117
116
|
LIBRARY: library,
|
|
118
|
-
ALLOWEDAPPS: JSON.stringify(allowedApplications),
|
|
119
117
|
TYPE: type,
|
|
120
118
|
SUB_TYPE: JSON.stringify(mustacheSubType),
|
|
121
119
|
SUB_TYPE_LABEL: subTypeLabel,
|
|
@@ -173,7 +171,6 @@ const validateCompile = async (
|
|
|
173
171
|
type,
|
|
174
172
|
subtype,
|
|
175
173
|
description,
|
|
176
|
-
allowedApplications,
|
|
177
174
|
organization
|
|
178
175
|
},
|
|
179
176
|
options
|
|
@@ -266,8 +263,7 @@ const validateCompile = async (
|
|
|
266
263
|
type,
|
|
267
264
|
subtype,
|
|
268
265
|
description,
|
|
269
|
-
organization
|
|
270
|
-
allowedApplications
|
|
266
|
+
organization
|
|
271
267
|
});
|
|
272
268
|
|
|
273
269
|
console.log(chalk.green(`${componentKey} component is created in ${targetDirectory}`));
|
|
@@ -282,7 +278,7 @@ export default async options => {
|
|
|
282
278
|
|
|
283
279
|
addDebugLog("create", "", "+");
|
|
284
280
|
|
|
285
|
-
if (options.params.length >=
|
|
281
|
+
if (options.params.length >= 11) {
|
|
286
282
|
|
|
287
283
|
const type = options.params[3];
|
|
288
284
|
const subtype = options.params[4];
|
|
@@ -290,9 +286,8 @@ addDebugLog("create", "", "+");
|
|
|
290
286
|
const componentLabel = options.params[6];
|
|
291
287
|
const version = options.params[7];
|
|
292
288
|
const library = options.params[8];
|
|
293
|
-
const
|
|
294
|
-
const
|
|
295
|
-
const organization = options.params[11];
|
|
289
|
+
const description = options.params[9];
|
|
290
|
+
const organization = options.params[10];
|
|
296
291
|
const framework = "Constellation";
|
|
297
292
|
|
|
298
293
|
await validateCompile(
|
|
@@ -305,14 +300,13 @@ addDebugLog("create", "", "+");
|
|
|
305
300
|
type,
|
|
306
301
|
subtype,
|
|
307
302
|
description,
|
|
308
|
-
allowedApplications,
|
|
309
303
|
organization
|
|
310
304
|
},
|
|
311
305
|
options
|
|
312
306
|
);
|
|
313
307
|
} else {
|
|
314
308
|
const componentDefaults = getConfigDefaults();
|
|
315
|
-
const maxChars = getMaxComponentNameCount();
|
|
309
|
+
const maxChars = isLibraryBased ? getMaxComponentNameCount() : getStandaloneMaxComponentNameCount();
|
|
316
310
|
const questions = [
|
|
317
311
|
{
|
|
318
312
|
name: 'type',
|
|
@@ -417,12 +411,6 @@ addDebugLog("create", "", "+");
|
|
|
417
411
|
when: () => !isLibraryBased
|
|
418
412
|
|
|
419
413
|
},
|
|
420
|
-
{
|
|
421
|
-
name: 'allowedApplications',
|
|
422
|
-
message: 'Please enter the application names to be supported (comma-separated). ',
|
|
423
|
-
suffix: 'Keep empty for all applications',
|
|
424
|
-
when: () => !isLibraryBased
|
|
425
|
-
},
|
|
426
414
|
{
|
|
427
415
|
name: 'description',
|
|
428
416
|
message: 'Enter description for the component (default is label)',
|
|
@@ -439,8 +427,7 @@ addDebugLog("create", "", "+");
|
|
|
439
427
|
framework,
|
|
440
428
|
type,
|
|
441
429
|
subtype,
|
|
442
|
-
description
|
|
443
|
-
allowedApplications
|
|
430
|
+
description
|
|
444
431
|
} = answers;
|
|
445
432
|
|
|
446
433
|
await validateCompile(
|
|
@@ -452,8 +439,7 @@ addDebugLog("create", "", "+");
|
|
|
452
439
|
framework,
|
|
453
440
|
type,
|
|
454
441
|
subtype,
|
|
455
|
-
description
|
|
456
|
-
allowedApplications
|
|
442
|
+
description
|
|
457
443
|
},
|
|
458
444
|
options
|
|
459
445
|
);
|
|
@@ -25,7 +25,8 @@ import { checkPathAccess, showVersion ,
|
|
|
25
25
|
checkLibraryAndArchives,
|
|
26
26
|
getConfigDefaults,
|
|
27
27
|
getSubTypeLabel,
|
|
28
|
-
getMaxPrefixCount
|
|
28
|
+
getMaxPrefixCount,
|
|
29
|
+
getStandaloneMaxPrefixCount
|
|
29
30
|
} from '../../util.js';
|
|
30
31
|
|
|
31
32
|
import { COMPONENT_SCHEMA, COMPONENTS_DIRECTORY_PATH, TASKS_CONFIG_JSON_FILENAME, COMPONENTS_PATH, CATEGORY_CONSTELLATION, SHARED_FILE_NAMES } from '../../constants.js';
|
|
@@ -57,7 +58,7 @@ const copyComponentTemplate = async (options) => {
|
|
|
57
58
|
|
|
58
59
|
export const compileMustacheTemplates = async (
|
|
59
60
|
componentDirectory,
|
|
60
|
-
{ componentKey, componentName, componentLabel, library, version, type, subtype, description, organization
|
|
61
|
+
{ componentKey, componentName, componentLabel, library, version, type, subtype, description, organization }
|
|
61
62
|
) => {
|
|
62
63
|
const files = fs.readdirSync(componentDirectory);
|
|
63
64
|
const componentClassName = convertIntoPascalCase(componentKey);
|
|
@@ -101,17 +102,17 @@ export const compileMustacheTemplates = async (
|
|
|
101
102
|
|
|
102
103
|
const isPicklist = subtype === 'Picklist';
|
|
103
104
|
|
|
104
|
-
if (allowedApplications.trim() === '') {
|
|
105
|
-
|
|
106
|
-
} else {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
105
|
+
// if (allowedApplications.trim() === '') {
|
|
106
|
+
// allowedApplications = [];
|
|
107
|
+
// } else {
|
|
108
|
+
// if (allowedApplications.indexOf(',') !== -1) {
|
|
109
|
+
// allowedApplications = allowedApplications.split(',');
|
|
110
|
+
// }
|
|
111
|
+
// allowedApplications = [].concat(allowedApplications);
|
|
112
|
+
// }
|
|
112
113
|
|
|
113
114
|
|
|
114
|
-
allowedApplications = allowedApplications.filter((el) => !!el.trim()).map((el) => el.trim());
|
|
115
|
+
// allowedApplications = allowedApplications.filter((el) => !!el.trim()).map((el) => el.trim());
|
|
115
116
|
files.forEach((file) => {
|
|
116
117
|
const filePath = path.join(componentDirectory, file);
|
|
117
118
|
|
|
@@ -125,7 +126,6 @@ export const compileMustacheTemplates = async (
|
|
|
125
126
|
ORGANIZATION: organization,
|
|
126
127
|
VERSION: version,
|
|
127
128
|
LIBRARY: library,
|
|
128
|
-
ALLOWEDAPPS: JSON.stringify(allowedApplications),
|
|
129
129
|
TYPE: type,
|
|
130
130
|
SUB_TYPE: JSON.stringify(mustacheSubType),
|
|
131
131
|
SUB_TYPE_LABEL: subTypeLabel,
|
|
@@ -173,7 +173,7 @@ export const compileMustacheTemplates = async (
|
|
|
173
173
|
};
|
|
174
174
|
|
|
175
175
|
export const validateCompile = async (
|
|
176
|
-
{ library, organization, componentName, componentLabel, version, framework, type, subtype, description
|
|
176
|
+
{ library, organization, componentName, componentLabel, version, framework, type, subtype, description },
|
|
177
177
|
options
|
|
178
178
|
) => {
|
|
179
179
|
let sSubType = subtype;
|
|
@@ -257,14 +257,13 @@ export const validateCompile = async (
|
|
|
257
257
|
type,
|
|
258
258
|
subtype,
|
|
259
259
|
description,
|
|
260
|
-
organization
|
|
261
|
-
allowedApplications
|
|
260
|
+
organization
|
|
262
261
|
});
|
|
263
262
|
|
|
264
263
|
console.log(chalk.green(`created ${componentKey} component in ${targetDirectory}`));
|
|
265
264
|
};
|
|
266
265
|
|
|
267
|
-
export const validateCompileAll = async ({ prefix, library, version,
|
|
266
|
+
export const validateCompileAll = async ({ prefix, library, version, organization }, options) => {
|
|
268
267
|
const defaultPegaServerConfig = await getPegaServerConfig();
|
|
269
268
|
|
|
270
269
|
// eslint-disable-next-line no-restricted-syntax, guard-for-in
|
|
@@ -287,8 +286,7 @@ export const validateCompileAll = async ({ prefix, library, version, allowedAppl
|
|
|
287
286
|
version,
|
|
288
287
|
type,
|
|
289
288
|
subtype,
|
|
290
|
-
description
|
|
291
|
-
allowedApplications
|
|
289
|
+
description
|
|
292
290
|
},
|
|
293
291
|
options
|
|
294
292
|
);
|
|
@@ -321,8 +319,7 @@ export const validateCompileAll = async ({ prefix, library, version, allowedAppl
|
|
|
321
319
|
version,
|
|
322
320
|
type,
|
|
323
321
|
subtype,
|
|
324
|
-
description
|
|
325
|
-
allowedApplications
|
|
322
|
+
description
|
|
326
323
|
},
|
|
327
324
|
options
|
|
328
325
|
);
|
|
@@ -353,8 +350,7 @@ export const validateCompileAll = async ({ prefix, library, version, allowedAppl
|
|
|
353
350
|
version,
|
|
354
351
|
type,
|
|
355
352
|
subtype,
|
|
356
|
-
description
|
|
357
|
-
allowedApplications
|
|
353
|
+
description
|
|
358
354
|
},
|
|
359
355
|
options
|
|
360
356
|
);
|
|
@@ -390,27 +386,25 @@ addDebugLog("createAll", "", "+");
|
|
|
390
386
|
const componentDefaults = getConfigDefaults();
|
|
391
387
|
componentDefaults.library = library;
|
|
392
388
|
|
|
393
|
-
if (options.params.length >=
|
|
389
|
+
if (options.params.length >= 7) {
|
|
394
390
|
const prefix = options.params[3];
|
|
395
391
|
const version = options.params[4];
|
|
396
392
|
library = options.params[5];
|
|
397
|
-
const allowedApplications = options.params[6];
|
|
398
393
|
|
|
399
394
|
// overwrite
|
|
400
|
-
organization = options.params[
|
|
395
|
+
organization = options.params[6];
|
|
401
396
|
|
|
402
397
|
await validateCompileAll(
|
|
403
398
|
{
|
|
404
399
|
prefix,
|
|
405
400
|
library,
|
|
406
401
|
version,
|
|
407
|
-
allowedApplications,
|
|
408
402
|
organization
|
|
409
403
|
},
|
|
410
404
|
options
|
|
411
405
|
);
|
|
412
406
|
} else {
|
|
413
|
-
const maxPrefixCount = getMaxPrefixCount();
|
|
407
|
+
const maxPrefixCount = isLibraryBased ? getMaxPrefixCount() : getStandaloneMaxPrefixCount();
|
|
414
408
|
const questions = [
|
|
415
409
|
{
|
|
416
410
|
name: 'prefix',
|
|
@@ -458,12 +452,6 @@ addDebugLog("createAll", "", "+");
|
|
|
458
452
|
return 'Only alphanumeric values are allowed, starting with alphabets';
|
|
459
453
|
},
|
|
460
454
|
when: () => !isLibraryBased
|
|
461
|
-
},
|
|
462
|
-
{
|
|
463
|
-
name: 'allowedApplications',
|
|
464
|
-
message: 'Please enter the application names to be supported (comma-separated). ',
|
|
465
|
-
suffix: 'Keep empty for all applications',
|
|
466
|
-
when: () => !isLibraryBased
|
|
467
455
|
}
|
|
468
456
|
];
|
|
469
457
|
|
|
@@ -476,7 +464,7 @@ addDebugLog("createAll", "", "+");
|
|
|
476
464
|
library = orgLib.library;
|
|
477
465
|
}
|
|
478
466
|
|
|
479
|
-
const { version
|
|
467
|
+
const { version } = answers;
|
|
480
468
|
let { prefix } = answers;
|
|
481
469
|
prefix = prefix.replace(/[^a-zA-Z0-9 ]/g, '');
|
|
482
470
|
await validateCompileAll(
|
|
@@ -484,7 +472,6 @@ addDebugLog("createAll", "", "+");
|
|
|
484
472
|
prefix,
|
|
485
473
|
library,
|
|
486
474
|
version,
|
|
487
|
-
allowedApplications,
|
|
488
475
|
organization
|
|
489
476
|
},
|
|
490
477
|
options
|
|
@@ -97,7 +97,9 @@ export const updateAllMigrateToLibChanges = async() => {
|
|
|
97
97
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
+
console.log();
|
|
100
101
|
console.log(`${chalk.green(`>> Code base was upgraded. You may still have some lint errors that need to be fixed manually.`)}`);
|
|
102
|
+
console.log(`${chalk.green(`>> Run ${chalk.bold(`npm run validateAll`)} to check for issues.`)}`);
|
|
101
103
|
|
|
102
104
|
}
|
|
103
105
|
|