@pega/custom-dx-components 0.25.44 → 0.25.46
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/README.md +1 -1
- package/package.json +2 -2
- 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/Template/PAGE/demo.stories.tsx.mustache +1 -0
- 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/delete-pub/helper.js +5 -5
- package/src/tasks/delete-pub/index.js +21 -9
- package/src/tasks/export-archive/index.js +0 -11
- package/src/tasks/import-archive/helper.js +38 -39
- package/src/tasks/import-archive/index.js +2 -9
- package/src/tasks/import-comp/index.js +0 -9
- package/src/tasks/init/template/README.md +1 -1
- package/src/tasks/init/template/package.json.mustache +1 -1
- package/src/tasks/list-pub/helper.js +5 -5
- package/src/tasks/list-pub/index.js +5 -4
- package/src/tasks/publish/index.js +5 -1
- package/src/tasks/publish-lib/index.js +0 -7
- package/src/tasks/restore/index.js +0 -3
- package/src/tasks/show-status/index.js +3 -2
- package/src/tasks/validator/index.js +0 -2
- package/src/util.js +30 -11
- 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_MyPage/demo.stories.tsx +1 -0
- 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_MyPage/demo.stories.tsx +1 -0
- 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_MyPage/demo.stories.tsx +1 -0
- 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
|
@@ -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
|
|
@@ -122,7 +122,8 @@ addDebugLog("fetchComponenLibrariessFromInfinity", `apiUrl: ${apiUrl}`, "");
|
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
|
|
125
|
+
// const getInfinityLibraries = async(rulesetName, rulesetVersion) => {
|
|
126
|
+
export const getInfinityLibraries = async() => {
|
|
126
127
|
addDebugLog("getInfinityLibraries", '', "");
|
|
127
128
|
|
|
128
129
|
const { app_name, app_version } = await getApplicationAndVersionFromToken();
|
|
@@ -140,10 +141,9 @@ addDebugLog("getInfinityLibraries", '', "");
|
|
|
140
141
|
|
|
141
142
|
// inquire
|
|
142
143
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
//urlParams =
|
|
146
|
-
|
|
144
|
+
// want to get a list of all for application, so make ruleset/version blank
|
|
145
|
+
let urlParams = `/app-name/${ApplicationName}/app-version/${ApplicationVersion}/rulesetname/""/rulesetversion/""`;
|
|
146
|
+
// let urlParams = `/app-name/${ApplicationName}/app-version/${ApplicationVersion}/rulesetname/${rulesetName}/rulesetversion/${rulesetVersion}`;
|
|
147
147
|
|
|
148
148
|
url = url.concat(urlParams);
|
|
149
149
|
|
|
@@ -3,7 +3,7 @@ import ora from 'ora';
|
|
|
3
3
|
|
|
4
4
|
import chalk from 'chalk';
|
|
5
5
|
|
|
6
|
-
import { showVersion, getC11NB2STokenAndStaticServer, getLocalLibraryVersions, getLibraryBased, deleteLocalLibrary, deleteLocalLibraryVersion, addDebugLog, getConfigDefaults, getLibraryBasedCL, getPegaServerConfig, deleteInfinityServerComponentLibrary, checkAccessTokenExpiration } from '../../util.js';
|
|
6
|
+
import { showVersion, getC11NB2STokenAndStaticServer, getLocalLibraryVersions, getLibraryBased, deleteLocalLibrary, deleteLocalLibraryVersion, addDebugLog, getConfigDefaults, getLibraryBasedCL, getPegaServerConfig, deleteInfinityServerComponentLibrary, checkAccessTokenExpiration, getApplicationAndVersionFromToken } from '../../util.js';
|
|
7
7
|
import { deleteLib } from '@pega/constellation-dx-components-build-utils/index.js';
|
|
8
8
|
|
|
9
9
|
import { getDeleteLibraryQuestions, getLibraryVersionQuestion, getRulesetAndVersionQuestion, SOURCE_OF_COMPONENT_TYPES, getInfinityLibraries } from './helper.js';
|
|
@@ -94,19 +94,27 @@ addDebugLog("deletePublished", "END", "-");
|
|
|
94
94
|
if (isLibraryBasedCL) {
|
|
95
95
|
|
|
96
96
|
const serverConfg = await getPegaServerConfig();
|
|
97
|
+
const { app_name, app_version } = await getApplicationAndVersionFromToken();
|
|
97
98
|
|
|
98
99
|
console.log();
|
|
99
100
|
console.log(`Current server: ${chalk.green.bold(`${serverConfg.server}`)}`);
|
|
101
|
+
console.log(`List of libraries for Application: ${chalk.green.bold(`${app_name} - ${app_version}`)}`);
|
|
102
|
+
console.log(chalk.bold.yellow(`>> Caution...`));
|
|
103
|
+
console.log(chalk.bold.yellow(`>> This list may contain built on libraries if your application is built on an application.`));
|
|
104
|
+
console.log(chalk.bold.yellow(`>> Deleting built on libraries may cause issues with built on application.`));
|
|
100
105
|
|
|
101
|
-
const questions = await getRulesetAndVersionQuestion(serverConfg);
|
|
102
|
-
const answers = await inquirer.prompt(questions);
|
|
103
|
-
const { rulesetName, rulesetVersion } = answers;
|
|
104
106
|
|
|
105
|
-
|
|
107
|
+
// want to get all in application, so ignore ruleset/version questions
|
|
108
|
+
// const questions = await getRulesetAndVersionQuestion(serverConfg);
|
|
109
|
+
// const answers = await inquirer.prompt(questions);
|
|
110
|
+
// const { rulesetName, rulesetVersion } = answers;
|
|
111
|
+
|
|
112
|
+
// const arLibs = await getInfinityLibraries(rulesetName, rulesetVersion);
|
|
113
|
+
const arLibs = await getInfinityLibraries();
|
|
106
114
|
|
|
107
115
|
if (arLibs && arLibs.pxResults && arLibs.pxResults.length > 0) {
|
|
108
116
|
|
|
109
|
-
const libs = arLibs.pxResults.map((oLib, index) => ({ name: oLib.pyLabel, value:
|
|
117
|
+
const libs = arLibs.pxResults.map((oLib, index) => ({ name: oLib.pyLabel + " (" + oLib.pyRuleSet + ":" + oLib.pyRuleSetVersion + ")", value: index}));
|
|
110
118
|
|
|
111
119
|
const libAnswers = await inquirer.prompt([
|
|
112
120
|
{
|
|
@@ -117,7 +125,9 @@ addDebugLog("deletePublished", "END", "-");
|
|
|
117
125
|
}
|
|
118
126
|
]);
|
|
119
127
|
|
|
120
|
-
const libraryName = libAnswers.library;
|
|
128
|
+
const libraryName = arLibs.pxResults[libAnswers.library].pyRuleName;
|
|
129
|
+
const rulesetName = arLibs.pxResults[libAnswers.library].pyRuleSet;
|
|
130
|
+
const rulesetVersion = arLibs.pxResults[libAnswers.library].pyRuleSetVersion;
|
|
121
131
|
// let spinner;
|
|
122
132
|
|
|
123
133
|
|
|
@@ -138,8 +148,10 @@ addDebugLog("deletePublished", "END", "-");
|
|
|
138
148
|
else {
|
|
139
149
|
// No library with that name
|
|
140
150
|
const serverConfig = await getPegaServerConfig();
|
|
141
|
-
console.log(chalk.redBright(`No server component libraries exist in given ruleset ${chalk.bold(`${rulesetName}:${rulesetVersion}`)}`));
|
|
142
|
-
|
|
151
|
+
// console.log(chalk.redBright(`No server component libraries exist in given ruleset ${chalk.bold(`${rulesetName}:${rulesetVersion}`)}`));
|
|
152
|
+
console.log(chalk.redBright(`No server component libraries exist in given application`));
|
|
153
|
+
|
|
154
|
+
addDebugLog("listPublished", "END", "-");
|
|
143
155
|
process.exit(1);
|
|
144
156
|
|
|
145
157
|
}
|
|
@@ -159,7 +159,6 @@ addDebugLog("exportCLArch", `exportPath: ${exportPath}, orgLibName: ${orgLibName
|
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
|
|
162
|
-
|
|
163
162
|
}
|
|
164
163
|
|
|
165
164
|
|
|
@@ -370,9 +369,6 @@ export default async options => {
|
|
|
370
369
|
exportTo = "Directory";
|
|
371
370
|
}
|
|
372
371
|
|
|
373
|
-
//exportTo = "Directory"; // remove this line when above is uncommented out
|
|
374
|
-
|
|
375
|
-
|
|
376
372
|
if (exportTo === "Directory") {
|
|
377
373
|
inquirer.registerPrompt('fuzzypath', inquirerFuzzyPath);
|
|
378
374
|
|
|
@@ -382,12 +378,6 @@ export default async options => {
|
|
|
382
378
|
|
|
383
379
|
await updateSavedExportFilePath(filePath);
|
|
384
380
|
|
|
385
|
-
// if (path.sep === "/") {
|
|
386
|
-
// if (filePath.lastIndexOf(path.sep) != filePath.length - 1) {
|
|
387
|
-
// filePath = filePath.concat(path.sep);
|
|
388
|
-
// }
|
|
389
|
-
// }
|
|
390
|
-
|
|
391
381
|
await exportArch( filePath, orgLibName, selectedVersion, fullArchive);
|
|
392
382
|
|
|
393
383
|
}
|
|
@@ -397,7 +387,6 @@ export default async options => {
|
|
|
397
387
|
// archive it
|
|
398
388
|
await zipVersionAndArchive(orgLibName, selectedVersion);
|
|
399
389
|
|
|
400
|
-
|
|
401
390
|
// publish to server
|
|
402
391
|
await publishArchive(orgLibName, selectedVersion);
|
|
403
392
|
|
|
@@ -141,57 +141,56 @@ export const renameComponent = async (
|
|
|
141
141
|
addDebugLog("renameComponent", `library: ${library}, componentKey: ${componentKey}`, "");
|
|
142
142
|
|
|
143
143
|
|
|
144
|
-
const componentName = componentKey.split("_")[2];
|
|
144
|
+
const componentName = componentKey.split("_")[2];
|
|
145
145
|
|
|
146
|
-
const configDef = getConfigDefaults();
|
|
147
|
-
const orgLibName = `${configDef.organization}_${library}`;
|
|
148
|
-
const organization = configDef.organization;
|
|
149
|
-
|
|
150
|
-
const newComponentKey = `${orgLibName}_${componentName}`;
|
|
151
|
-
|
|
152
|
-
const oldComponentKey = componentKey;
|
|
153
|
-
const newComponentKeyPC = convertIntoPascalCase(newComponentKey);
|
|
154
|
-
const oldComponentKeyPC = convertIntoPascalCase(oldComponentKey);
|
|
146
|
+
const configDef = getConfigDefaults();
|
|
147
|
+
const orgLibName = `${configDef.organization}_${library}`;
|
|
148
|
+
const organization = configDef.organization;
|
|
155
149
|
|
|
156
|
-
const
|
|
157
|
-
const targetDirectory = await getComponentDirectoryPath(newComponentKey, currDir);
|
|
150
|
+
const newComponentKey = `${orgLibName}_${componentName}`;
|
|
158
151
|
|
|
159
|
-
const
|
|
152
|
+
const oldComponentKey = componentKey;
|
|
153
|
+
const newComponentKeyPC = convertIntoPascalCase(newComponentKey);
|
|
154
|
+
const oldComponentKeyPC = convertIntoPascalCase(oldComponentKey);
|
|
160
155
|
|
|
161
|
-
|
|
162
|
-
const
|
|
156
|
+
const currentDirectory = await getComponentDirectoryPath(componentKey, currDir);
|
|
157
|
+
const targetDirectory = await getComponentDirectoryPath(newComponentKey, currDir);
|
|
163
158
|
|
|
164
|
-
|
|
165
|
-
await updateConfig(
|
|
166
|
-
{
|
|
167
|
-
oldComponentKey,
|
|
168
|
-
newComponentKey,
|
|
169
|
-
componentName,
|
|
170
|
-
organization,
|
|
171
|
-
library,
|
|
172
|
-
version,
|
|
173
|
-
currentDirectory,
|
|
174
|
-
}
|
|
175
|
-
);
|
|
176
|
-
}
|
|
177
|
-
else {
|
|
178
|
-
await updateFile(
|
|
179
|
-
fileName,
|
|
180
|
-
oldComponentKeyPC,
|
|
181
|
-
newComponentKeyPC,
|
|
182
|
-
currentDirectory );
|
|
159
|
+
const targetFileList = await getDirectoryFiles(currentDirectory);
|
|
183
160
|
|
|
184
|
-
|
|
161
|
+
for (const fileIndex in targetFileList) {
|
|
162
|
+
const fileName = targetFileList[fileIndex];
|
|
163
|
+
|
|
164
|
+
if (fileName === "config.json") {
|
|
165
|
+
await updateConfig(
|
|
166
|
+
{
|
|
167
|
+
oldComponentKey,
|
|
168
|
+
newComponentKey,
|
|
169
|
+
componentName,
|
|
170
|
+
organization,
|
|
171
|
+
library,
|
|
172
|
+
version,
|
|
173
|
+
currentDirectory,
|
|
174
|
+
}
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
await updateFile(
|
|
179
|
+
fileName,
|
|
180
|
+
oldComponentKeyPC,
|
|
181
|
+
newComponentKeyPC,
|
|
182
|
+
currentDirectory );
|
|
185
183
|
|
|
186
|
-
}
|
|
184
|
+
}
|
|
187
185
|
|
|
186
|
+
} // for
|
|
188
187
|
|
|
189
188
|
|
|
190
|
-
// rename the directory
|
|
191
|
-
await reanmeDirectory(currentDirectory, targetDirectory);
|
|
189
|
+
// rename the directory
|
|
190
|
+
await reanmeDirectory(currentDirectory, targetDirectory);
|
|
192
191
|
|
|
193
192
|
|
|
194
|
-
return newComponentKey;
|
|
193
|
+
return newComponentKey;
|
|
195
194
|
|
|
196
195
|
};
|
|
197
196
|
|
|
@@ -648,11 +648,9 @@ addDebugLog("importArch", `filePath: ${filePath}, fileName: ${fileName}`, "");
|
|
|
648
648
|
|
|
649
649
|
}
|
|
650
650
|
|
|
651
|
-
|
|
652
651
|
}
|
|
653
652
|
|
|
654
653
|
|
|
655
|
-
|
|
656
654
|
export const getZipFileList = async(filePath) => {
|
|
657
655
|
|
|
658
656
|
if (fs.existsSync(filePath)) {
|
|
@@ -782,6 +780,7 @@ export default async options => {
|
|
|
782
780
|
}
|
|
783
781
|
catch (ex) {
|
|
784
782
|
console.log(chalk.redBright(ex));
|
|
783
|
+
process.exit(1);
|
|
785
784
|
}
|
|
786
785
|
|
|
787
786
|
|
|
@@ -844,7 +843,7 @@ export default async options => {
|
|
|
844
843
|
else {
|
|
845
844
|
// No library with that name
|
|
846
845
|
console.log(chalk.redBright(`No library archives exist on server.`));
|
|
847
|
-
process.exit(
|
|
846
|
+
process.exit();
|
|
848
847
|
|
|
849
848
|
}
|
|
850
849
|
|
|
@@ -913,12 +912,6 @@ export default async options => {
|
|
|
913
912
|
}
|
|
914
913
|
|
|
915
914
|
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
915
|
}
|
|
923
916
|
|
|
924
917
|
addDebugLog("importArchive", "END", "-");
|
|
@@ -273,14 +273,8 @@ addDebugLog("importComp", `filePath: ${filePath}, fileName: ${fileName}`, "");
|
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
275
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
276
|
}
|
|
280
277
|
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
278
|
}
|
|
285
279
|
|
|
286
280
|
|
|
@@ -379,9 +373,6 @@ addDebugLog("importComponent", "", "+");
|
|
|
379
373
|
await importComp( filePath, fileName, true);
|
|
380
374
|
}
|
|
381
375
|
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
376
|
}
|
|
386
377
|
|
|
387
378
|
addDebugLog("importComponent", "END", "-");
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"@babel/preset-react": "^7.27.1",
|
|
109
109
|
"@babel/preset-typescript": "^7.27.1",
|
|
110
110
|
"@pega/configs": "^0.16.3",
|
|
111
|
-
"@pega/custom-dx-components": "~0.25.
|
|
111
|
+
"@pega/custom-dx-components": "~0.25.46",
|
|
112
112
|
"@pega/pcore-pconnect-typedefs": "^4.1.0-alpha.1",
|
|
113
113
|
"@storybook/addon-actions": "^8.6.14",
|
|
114
114
|
"@storybook/addon-essentials": "^8.6.14",
|
|
@@ -136,12 +136,12 @@ addDebugLog("getInfinityLibraries", '', "");
|
|
|
136
136
|
|
|
137
137
|
const ApplicationName = app_name;
|
|
138
138
|
const ApplicationVersion = app_version;
|
|
139
|
-
const rulesetName = defaultPegaServerConfig.rulesetName;
|
|
140
|
-
const rulesetVersion = defaultPegaServerConfig.rulesetVersion;
|
|
139
|
+
// const rulesetName = defaultPegaServerConfig.rulesetName;
|
|
140
|
+
// const rulesetVersion = defaultPegaServerConfig.rulesetVersion;
|
|
141
|
+
// let urlParams = `/app-name/${ApplicationName}/app-version/${ApplicationVersion}/rulesetname/${rulesetName}/rulesetversion/${rulesetVersion}`;
|
|
141
142
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
//urlParams = encodeURIComponent(urlParams);
|
|
143
|
+
// currently want to get all published libraries for an application, so make ruleset/version blank
|
|
144
|
+
let urlParams = `/app-name/${ApplicationName}/app-version/${ApplicationVersion}/rulesetname/""/rulesetversion/""`;
|
|
145
145
|
|
|
146
146
|
|
|
147
147
|
url = url.concat(urlParams);
|
|
@@ -158,21 +158,22 @@ addDebugLog("listPublished", "END", "-");
|
|
|
158
158
|
|
|
159
159
|
if (arLibs && arLibs.pxResults && arLibs.pxResults.length > 0) {
|
|
160
160
|
|
|
161
|
-
const libs = arLibs.pxResults.map((oLib, index) => ({ name: oLib.pyLabel, value: index}));
|
|
161
|
+
// const libs = arLibs.pxResults.map((oLib, index) => ({ name: oLib.pyLabel, value: index}));
|
|
162
|
+
const libs = arLibs.pxResults.map((oLib, index) => ({ name: oLib.pyLabel + " (" + oLib.pyRuleSet + ":" + oLib.pyRuleSetVersion + ")", value: index}));
|
|
162
163
|
|
|
163
164
|
|
|
164
165
|
const {app_name, app_version } = await getApplicationAndVersionFromToken();
|
|
165
166
|
const serverConfig = await getPegaServerConfig();
|
|
166
167
|
console.log(`\nServer ${chalk.green.bold(`${serverConfig.server}`)}.`);
|
|
167
|
-
console.log(
|
|
168
|
-
console.log(`in ruleset: ${chalk.green.bold(`${serverConfig.rulesetName}:${serverConfig.rulesetVersion}`)}`);
|
|
168
|
+
console.log(`List of libraries (including built on) for Application: ${chalk.bold.green(`${app_name} - ${app_version}`)}`);
|
|
169
|
+
// console.log(`in ruleset: ${chalk.green.bold(`${serverConfig.rulesetName}:${serverConfig.rulesetVersion}`)}`);
|
|
169
170
|
|
|
170
171
|
|
|
171
172
|
const libAnswers = await inquirer.prompt([
|
|
172
173
|
{
|
|
173
174
|
name: 'library',
|
|
174
175
|
type: 'rawlist',
|
|
175
|
-
message: 'Pick library',
|
|
176
|
+
message: 'Pick component library',
|
|
176
177
|
choices: libs
|
|
177
178
|
}
|
|
178
179
|
]);
|
|
@@ -22,7 +22,8 @@ import {
|
|
|
22
22
|
getConfigDefaults,
|
|
23
23
|
getInputConfigForCommand,
|
|
24
24
|
convertYNToBoolean,
|
|
25
|
-
checkForBranch
|
|
25
|
+
checkForBranch,
|
|
26
|
+
applyPegaData } from '../../util.js';
|
|
26
27
|
|
|
27
28
|
import { getPublishComponentQuestions, publishComponentToServer, zipComponent } from './helper.js';
|
|
28
29
|
import { default as buildLibrary } from '../build-lib/index.js';
|
|
@@ -61,9 +62,12 @@ addDebugLog("publish", "", "+");
|
|
|
61
62
|
// const currentVersion = devBuild ? `${orgLib.version}-dev`: orgLib.version;
|
|
62
63
|
const currentVersion = orgLib.buildVersion;
|
|
63
64
|
const serverConfg = await getPegaServerConfig();
|
|
65
|
+
let configJson = {};
|
|
66
|
+
await applyPegaData(configJson);
|
|
64
67
|
|
|
65
68
|
console.log();
|
|
66
69
|
console.log(`Publishing to server: ${chalk.green.bold(`${serverConfg.server}`)}`);
|
|
70
|
+
console.log(`Cosmos version: ${chalk.green.bold(`${configJson.packageCosmosVersion}`)}`);
|
|
67
71
|
|
|
68
72
|
if (useInputConfig) {
|
|
69
73
|
const inputConfig = await getInputConfigForCommand("publish");
|
|
@@ -110,13 +110,6 @@ addDebugLog("zipLibraryComponent", `libraryName: ${libraryName}, libraryVersion:
|
|
|
110
110
|
localizationsContent = Buffer.from(fs.readFileSync(localizationsJson)).toString();
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
-
// if (fs.existsSync(libraryDirectory)) {
|
|
114
|
-
// fs.rm(libraryDirectory, { recursive: true }, err => {
|
|
115
|
-
// if (err) {
|
|
116
|
-
// throw err;
|
|
117
|
-
// }
|
|
118
|
-
// });
|
|
119
|
-
// }
|
|
120
113
|
|
|
121
114
|
return { zipContent, configContent, localizationsContent};
|
|
122
115
|
};
|
|
@@ -7,7 +7,8 @@ import {
|
|
|
7
7
|
getComponents,
|
|
8
8
|
checkLibraryAndArchives,
|
|
9
9
|
getPegaServerConfig,
|
|
10
|
-
getLibraryBasedCL
|
|
10
|
+
getLibraryBasedCL,
|
|
11
|
+
applyPegaData } from '../../util.js';
|
|
11
12
|
|
|
12
13
|
export const showCurrentStatus = async () => {
|
|
13
14
|
|
|
@@ -15,7 +16,7 @@ export const showCurrentStatus = async () => {
|
|
|
15
16
|
const componentList = await getComponents();
|
|
16
17
|
const isLibraryBased = getLibraryBased();
|
|
17
18
|
const isLibraryBasedCL = getLibraryBasedCL();
|
|
18
|
-
const pegaServer = await getPegaServerConfig();
|
|
19
|
+
const pegaServer = await getPegaServerConfig(true);
|
|
19
20
|
|
|
20
21
|
console.log("");
|
|
21
22
|
console.log("\tCurrent status");
|
|
@@ -47,7 +47,6 @@ const schema = {
|
|
|
47
47
|
organization: { type: 'string' },
|
|
48
48
|
version: { type: 'string' },
|
|
49
49
|
library: { type: 'string' },
|
|
50
|
-
allowedApplications: { type: 'array' },
|
|
51
50
|
type: { type: 'string', enum: COMPONENT_SCHEMA.type.map(({ value }) => value) },
|
|
52
51
|
subtype: {
|
|
53
52
|
anyOf: [{ type: 'string' }, { type: 'array' }],
|
|
@@ -184,7 +183,6 @@ const overrideSchema = {
|
|
|
184
183
|
organization: { type: 'string' },
|
|
185
184
|
version: { type: 'string' },
|
|
186
185
|
library: { type: 'string' },
|
|
187
|
-
allowedApplications: { type: 'array' },
|
|
188
186
|
type: { type: 'string', enum: COMPONENT_SCHEMA.type.map(({ value }) => value) },
|
|
189
187
|
subtype: {
|
|
190
188
|
anyOf: [{ type: 'string' }, { type: 'array' }],
|