@pega/custom-dx-components 0.242.19 → 0.242.21
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 +2 -2
- package/src/tasks/build-lib/index.js +82 -32
- package/src/tasks/create/index.js +2 -6
- package/src/tasks/create-all/index.js +2 -5
- package/src/tasks/delete/helper.js +19 -3
- package/src/tasks/init/template/package.json.mustache +8 -6
- package/src/tasks/list-lib/index.js +21 -7
- package/src/tasks/publish-lib/index.js +2 -1
- package/src/tasks/rename-lib/index.js +75 -91
- package/src/util.js +16 -0
- package/tests/assets/library/components/create/Pega_DXIL_MyTestText/config.json +2 -2
- package/tests/assets/library/components/create/Pega_DXIL_MyTestText/index.tsx +1 -0
- package/tests/assets/library/components/create/shared/create-nonce.ts +6 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyBoolean/config.json +2 -2
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyBoolean/index.tsx +1 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/config.json +3 -3
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/demo.stories.tsx +23 -24
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/index.tsx +1 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyCurrency/config.json +2 -2
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyCurrency/index.tsx +1 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDate/config.json +2 -2
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDate/index.tsx +1 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDateTime/config.json +2 -2
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDateTime/index.tsx +1 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDecimal/config.json +2 -2
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDecimal/index.tsx +1 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDetails/config.json +2 -2
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDetails/demo.stories.tsx +3 -5
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDetails/index.tsx +2 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyEmail/config.json +2 -2
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyEmail/index.tsx +1 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyForm/config.json +2 -2
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyForm/index.tsx +1 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/config.json +2 -2
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/demo.stories.tsx +15 -15
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/index.tsx +1 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyInteger/config.json +2 -2
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyInteger/index.tsx +1 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPage/config.json +2 -2
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPage/index.tsx +1 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/config.json +2 -2
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPageWidget/config.json +2 -2
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPageWidget/demo.stories.tsx +15 -17
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPageWidget/index.tsx +1 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyParagraph/config.json +2 -2
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyParagraph/index.tsx +1 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPercentage/config.json +2 -2
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPercentage/index.tsx +1 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPhone/config.json +2 -2
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPhone/index.tsx +1 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPicklist/config.json +2 -2
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPicklist/index.tsx +1 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyRadiobuttons/config.json +2 -2
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyRadiobuttons/index.tsx +1 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MySearchbox/config.json +2 -2
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MySearchbox/index.tsx +1 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyText/config.json +2 -2
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyText/index.tsx +1 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTextInput/config.json +2 -2
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTextInput/index.tsx +1 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/config.json +2 -2
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/index.tsx +1 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/config.json +2 -2
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/index.tsx +1 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/config.json +2 -2
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/index.tsx +1 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyURL/config.json +2 -2
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyURL/index.tsx +1 -0
- package/tests/assets/library/components/createAll/Constellation/shared/create-nonce.ts +6 -0
- package/tests/assets/original/components/create/Pega_DXIL_MyTestText/create-nonce.ts +6 -0
- package/tests/assets/original/components/create/Pega_DXIL_MyTestText/index.tsx +1 -0
- package/tests/assets/original/components/create/shared/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyBoolean/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyBoolean/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/demo.stories.tsx +23 -24
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyCurrency/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyCurrency/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDate/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDate/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDateTime/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDateTime/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDecimal/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDecimal/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDetails/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDetails/demo.stories.tsx +3 -5
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDetails/index.tsx +2 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyEmail/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyEmail/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyForm/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyForm/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/demo.stories.tsx +15 -15
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyInteger/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyInteger/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPage/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPage/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPageWidget/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPageWidget/demo.stories.tsx +15 -17
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPageWidget/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyParagraph/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyParagraph/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPercentage/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPercentage/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPhone/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPhone/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPicklist/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPicklist/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyRadiobuttons/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyRadiobuttons/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MySearchbox/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MySearchbox/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyText/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyText/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTextInput/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTextInput/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyURL/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyURL/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Constellation/shared/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyBoolean/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyBoolean/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyCaseWidget/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyCaseWidget/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyCurrency/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyCurrency/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDate/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDate/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDateTime/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDateTime/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDecimal/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDecimal/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDetails/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDetails/demo.stories.tsx +3 -5
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDetails/index.tsx +2 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyEmail/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyEmail/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyForm/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyForm/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyIconButtonURL/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyIconButtonURL/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyInteger/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyInteger/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPage/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPage/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPageCaseWidget/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPageCaseWidget/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPageWidget/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPageWidget/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyParagraph/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyParagraph/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPercentage/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPercentage/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPhone/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPhone/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPicklist/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPicklist/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyRadiobuttons/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyRadiobuttons/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MySearchbox/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MySearchbox/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyText/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyText/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTextInput/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTextInput/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyURL/create-nonce.ts +6 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyURL/index.tsx +1 -0
- package/tests/assets/original/components/createAll/Launchpad/shared/create-nonce.ts +6 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pega/custom-dx-components",
|
|
3
|
-
"version": "0.242.
|
|
3
|
+
"version": "0.242.21",
|
|
4
4
|
"description": "Utility for building custom UI components",
|
|
5
5
|
"bin": "./bin/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"@babel/plugin-transform-class-properties": "^7.23.3",
|
|
20
20
|
"@babel/preset-react": "^7.23.3",
|
|
21
21
|
"@pega/auth": "^0.1.6",
|
|
22
|
-
"@pega/constellation-dx-components-build-utils": "^1.0.1-dev-0.
|
|
22
|
+
"@pega/constellation-dx-components-build-utils": "^1.0.1-dev-0.16",
|
|
23
23
|
"ajv": "^8.12.0",
|
|
24
24
|
"ajv-keywords": "^5.1.0",
|
|
25
25
|
"archiver": "^7.0.1",
|
|
@@ -4,6 +4,7 @@ import fs from 'fs';
|
|
|
4
4
|
import inquirer from 'inquirer';
|
|
5
5
|
import { Listr } from 'listr2';
|
|
6
6
|
import chalk from 'chalk';
|
|
7
|
+
|
|
7
8
|
import { buildLib } from '@pega/constellation-dx-components-build-utils/index.js';
|
|
8
9
|
|
|
9
10
|
import validate from '../validator/index.js';
|
|
@@ -14,7 +15,8 @@ import {
|
|
|
14
15
|
getComponents,
|
|
15
16
|
getLibraryBased,
|
|
16
17
|
getC11NB2STokenAndStaticServer,
|
|
17
|
-
updateComponentDefaultVersion
|
|
18
|
+
updateComponentDefaultVersion,
|
|
19
|
+
getAboutData
|
|
18
20
|
} from '../../util.js';
|
|
19
21
|
import bundleComponent from '../bundle/index.js';
|
|
20
22
|
|
|
@@ -22,7 +24,7 @@ import { getBuildComponentQuestions, getOrgLib } from './helper.js';
|
|
|
22
24
|
|
|
23
25
|
const isLibraryBased = await getLibraryBased();
|
|
24
26
|
|
|
25
|
-
export const updateConfigVersion = async (componentKey, buildVersion) => {
|
|
27
|
+
export const updateConfigVersion = async (componentKey, buildVersion, currentOrgLib, token) => {
|
|
26
28
|
const componentDirectory = await getComponentDirectoryPath(componentKey);
|
|
27
29
|
const configFileName = 'config.json';
|
|
28
30
|
|
|
@@ -35,27 +37,68 @@ export const updateConfigVersion = async (componentKey, buildVersion) => {
|
|
|
35
37
|
console.log(`${chalk.bold.yellow(`Config file not available for: ${componentKey}`)}`);
|
|
36
38
|
return;
|
|
37
39
|
}
|
|
40
|
+
const currentDate = new Date(Date.now());
|
|
41
|
+
const dateStamp = currentDate.toDateString();
|
|
42
|
+
const aboutData = await getAboutData(currentOrgLib, buildVersion, dateStamp);
|
|
38
43
|
|
|
39
44
|
let data;
|
|
40
45
|
try {
|
|
41
46
|
data = JSON.parse(configData);
|
|
47
|
+
|
|
48
|
+
//find "About" and create or update
|
|
49
|
+
const properties = data.properties;
|
|
50
|
+
if (properties) {
|
|
51
|
+
let foundProp = null;
|
|
52
|
+
|
|
53
|
+
// check to see if PegaAboutData exists. If customer decides to put
|
|
54
|
+
// data under PegaAboutData, we won't change the order
|
|
55
|
+
// otherise, will put at bottom
|
|
56
|
+
for (let i in properties) {
|
|
57
|
+
if (properties[i].name && properties[i].name === "PegaAboutData") {
|
|
58
|
+
foundProp = properties[i];
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (foundProp) {
|
|
64
|
+
foundProp.label = aboutData;
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
// don't have "About"
|
|
68
|
+
const aboutLabelJSON = {
|
|
69
|
+
"format": "LABEL",
|
|
70
|
+
"label": "About",
|
|
71
|
+
"name": "PegaAboutLabel",
|
|
72
|
+
"variant": "h3"
|
|
73
|
+
};
|
|
74
|
+
const aboutDataJSON = {
|
|
75
|
+
"format": "LABEL",
|
|
76
|
+
"label": aboutData,
|
|
77
|
+
"name": "PegaAboutData",
|
|
78
|
+
"variant": "primary"
|
|
79
|
+
}
|
|
80
|
+
properties.push(aboutLabelJSON);
|
|
81
|
+
properties.push(aboutDataJSON);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
42
84
|
} catch (er) {
|
|
43
85
|
throw new Error(`Invalid schema json in config.json: ${er}`);
|
|
44
86
|
}
|
|
45
87
|
|
|
46
88
|
data.version = buildVersion;
|
|
89
|
+
data.buildDate = dateStamp;
|
|
47
90
|
|
|
48
91
|
// write back file
|
|
49
92
|
fs.writeFileSync(configFile, JSON.stringify(data, null, 4), { encoding: 'utf8' });
|
|
50
93
|
};
|
|
51
94
|
|
|
52
|
-
export function getCustomTasks(componentKey, devBuild, buildVersion) {
|
|
95
|
+
export function getCustomTasks(componentKey, devBuild, buildVersion, currentOrgLib, token) {
|
|
53
96
|
return new Listr(
|
|
54
97
|
[
|
|
55
98
|
{
|
|
56
99
|
title: 'Validate config schema',
|
|
57
100
|
task: async () => {
|
|
58
|
-
await updateConfigVersion(componentKey, buildVersion);
|
|
101
|
+
await updateConfigVersion(componentKey, buildVersion, currentOrgLib, token);
|
|
59
102
|
await validate(componentKey);
|
|
60
103
|
},
|
|
61
104
|
skip: () => componentKey === 'shared'
|
|
@@ -73,36 +116,11 @@ export function getCustomTasks(componentKey, devBuild, buildVersion) {
|
|
|
73
116
|
);
|
|
74
117
|
}
|
|
75
118
|
|
|
76
|
-
export
|
|
77
|
-
if (!isLibraryBased) {
|
|
78
|
-
console.log(`Command only supported for ${chalk.bold.green('library based')} components.`);
|
|
79
|
-
process.exit();
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
showVersion();
|
|
119
|
+
export const localBuildLibrary = async(organization, library, version, devBuild) => {
|
|
83
120
|
|
|
84
121
|
const components = await getComponents();
|
|
85
|
-
|
|
86
|
-
const compDef = await getOrgLib();
|
|
87
|
-
const organization = compDef.organization;
|
|
88
|
-
const library = compDef.library;
|
|
89
|
-
const currentOrgLib = organization.concat('_').concat(library);
|
|
90
|
-
|
|
91
|
-
let version;
|
|
92
|
-
let devBuild;
|
|
93
|
-
|
|
94
|
-
if (options.params.length >= 5) {
|
|
95
|
-
version = options.params[3];
|
|
96
|
-
const dBuild = options.params[4];
|
|
97
|
-
devBuild = !!(dBuild === 'Y' || dBuild === 'y' || dBuild === true || dBuild === 'true');
|
|
98
|
-
} else {
|
|
99
|
-
console.log(`\nLibrary ${chalk.bold.green(currentOrgLib)} `);
|
|
100
|
-
const questions = await getBuildComponentQuestions(compDef.version);
|
|
101
|
-
const answers = await inquirer.prompt(questions);
|
|
102
|
-
({ version, devBuild } = answers);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
122
|
const tokenAndStaticServer = await getC11NB2STokenAndStaticServer();
|
|
123
|
+
const currentOrgLib = organization.concat('_').concat(library);
|
|
106
124
|
|
|
107
125
|
if (tokenAndStaticServer.C11NB2S === undefined) {
|
|
108
126
|
console.log(
|
|
@@ -123,7 +141,7 @@ export default async options => {
|
|
|
123
141
|
console.log(chalk.bold.green(`Building ${componentKey}`));
|
|
124
142
|
|
|
125
143
|
// eslint-disable-next-line sonarjs/no-extra-arguments
|
|
126
|
-
const myCustomTasks = getCustomTasks(componentKey, devBuild, buildVersion,
|
|
144
|
+
const myCustomTasks = getCustomTasks(componentKey, devBuild, buildVersion, currentOrgLib, tokenAndStaticServer.C11NB2S);
|
|
127
145
|
|
|
128
146
|
try {
|
|
129
147
|
await myCustomTasks.run();
|
|
@@ -154,5 +172,37 @@ export default async options => {
|
|
|
154
172
|
tokenAndStaticServer.appStaticContentServer
|
|
155
173
|
);
|
|
156
174
|
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export default async options => {
|
|
178
|
+
if (!isLibraryBased) {
|
|
179
|
+
console.log(`Command only supported for ${chalk.bold.green('library based')} components.`);
|
|
180
|
+
process.exit();
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
showVersion();
|
|
184
|
+
|
|
185
|
+
const compDef = await getOrgLib();
|
|
186
|
+
const organization = compDef.organization;
|
|
187
|
+
const library = compDef.library;
|
|
188
|
+
const currentOrgLib = organization.concat('_').concat(library);
|
|
189
|
+
|
|
190
|
+
let version;
|
|
191
|
+
let devBuild;
|
|
192
|
+
|
|
193
|
+
if (options.params.length >= 5) {
|
|
194
|
+
version = options.params[3];
|
|
195
|
+
const dBuild = options.params[4];
|
|
196
|
+
devBuild = !!(dBuild === 'Y' || dBuild === 'y' || dBuild === true || dBuild === 'true');
|
|
197
|
+
} else {
|
|
198
|
+
console.log(`\nLibrary ${chalk.bold.green(currentOrgLib)} `);
|
|
199
|
+
const questions = await getBuildComponentQuestions(compDef.version);
|
|
200
|
+
const answers = await inquirer.prompt(questions);
|
|
201
|
+
({ version, devBuild } = answers);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
await localBuildLibrary(organization, library, version, devBuild);
|
|
205
|
+
|
|
206
|
+
|
|
157
207
|
return true;
|
|
158
208
|
};
|
|
@@ -96,10 +96,6 @@ const compileMustacheTemplates = async (
|
|
|
96
96
|
allowedApplications = [].concat(allowedApplications);
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
const orgLib = organization.concat("_").concat(library);
|
|
100
|
-
const componentLabelOrgLib = componentLabel.concat(` (${orgLib})`);
|
|
101
|
-
const desciptionOrgLib = description == null || description === "" ? componentLabelOrgLib : description.concat(` (${orgLib})`);
|
|
102
|
-
|
|
103
99
|
|
|
104
100
|
allowedApplications = allowedApplications.filter(el => !!el.trim()).map(el => el.trim());
|
|
105
101
|
files.forEach(file => {
|
|
@@ -108,7 +104,7 @@ const compileMustacheTemplates = async (
|
|
|
108
104
|
const output = compileMustacheTemplate(filePath, {
|
|
109
105
|
COMPONENT_KEY: componentKey,
|
|
110
106
|
COMPONENT_NAME: componentName,
|
|
111
|
-
COMPONENT_LABEL:
|
|
107
|
+
COMPONENT_LABEL: componentLabel,
|
|
112
108
|
COMPONENT_CLASS_NAME: componentClassName,
|
|
113
109
|
ORGANIZATION: organization,
|
|
114
110
|
VERSION: version,
|
|
@@ -116,7 +112,7 @@ const compileMustacheTemplates = async (
|
|
|
116
112
|
ALLOWEDAPPS: JSON.stringify(allowedApplications),
|
|
117
113
|
TYPE: type,
|
|
118
114
|
SUB_TYPE: JSON.stringify(mustacheSubType),
|
|
119
|
-
DESCRIPTION:
|
|
115
|
+
DESCRIPTION: description,
|
|
120
116
|
IS_TEMPLATE: isTemplate,
|
|
121
117
|
IS_PICKLIST: isPicklist,
|
|
122
118
|
IS_BOOLEAN: isBool,
|
|
@@ -105,9 +105,6 @@ export const compileMustacheTemplates = async (
|
|
|
105
105
|
allowedApplications = [].concat(allowedApplications);
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
const orgLib = organization.concat("_").concat(library);
|
|
109
|
-
const componentLabelOrgLib = componentLabel.concat(` (${orgLib})`);
|
|
110
|
-
const desciptionOrgLib = description == null || description === "" ? componentLabelOrgLib : description.concat(` (${orgLib})`);
|
|
111
108
|
|
|
112
109
|
allowedApplications = allowedApplications.filter((el) => !!el.trim()).map((el) => el.trim());
|
|
113
110
|
files.forEach((file) => {
|
|
@@ -116,7 +113,7 @@ export const compileMustacheTemplates = async (
|
|
|
116
113
|
const output = compileMustacheTemplate(filePath, {
|
|
117
114
|
COMPONENT_KEY: componentKey,
|
|
118
115
|
COMPONENT_NAME: componentName,
|
|
119
|
-
COMPONENT_LABEL:
|
|
116
|
+
COMPONENT_LABEL: componentLabel,
|
|
120
117
|
COMPONENT_CLASS_NAME: componentClassName,
|
|
121
118
|
ORGANIZATION: organization,
|
|
122
119
|
VERSION: version,
|
|
@@ -124,7 +121,7 @@ export const compileMustacheTemplates = async (
|
|
|
124
121
|
ALLOWEDAPPS: JSON.stringify(allowedApplications),
|
|
125
122
|
TYPE: type,
|
|
126
123
|
SUB_TYPE: JSON.stringify(mustacheSubType),
|
|
127
|
-
DESCRIPTION:
|
|
124
|
+
DESCRIPTION: description,
|
|
128
125
|
IS_TEMPLATE: isTemplate,
|
|
129
126
|
IS_PICKLIST: isPicklist,
|
|
130
127
|
IS_BOOLEAN: isBool,
|
|
@@ -140,9 +140,25 @@ export const deleteServerComponents = async (sourceOfComponents, answers) => {
|
|
|
140
140
|
({library, organization} = lpAnswers);
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
143
|
+
let spinner;
|
|
144
|
+
let data;
|
|
145
|
+
try {
|
|
146
|
+
spinner = ora('Fetching components from server').start();
|
|
147
|
+
data = await getComponentsFromServer(library, organization);
|
|
148
|
+
spinner.stop();
|
|
149
|
+
}
|
|
150
|
+
catch (error) {
|
|
151
|
+
spinner.stop();
|
|
152
|
+
if (error.indexOf("ECONNREFUSED") >= 0) {
|
|
153
|
+
console.log(`\n${chalk.bold.red('Error occurred in authentication. Please regenerate using authenticate')}`);
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
console.log(`${chalk.bold.red(error)}`);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// spinner.stop();
|
|
160
|
+
process.exit(1);
|
|
161
|
+
}
|
|
146
162
|
|
|
147
163
|
|
|
148
164
|
let serverComponents;
|
|
@@ -10,23 +10,24 @@
|
|
|
10
10
|
"authenticate": "custom-dx-components authenticate",
|
|
11
11
|
"buildComponent": "custom-dx-components buildComponent",
|
|
12
12
|
"buildAllComponents": "custom-dx-components buildAllComponents",
|
|
13
|
-
"buildLibrary": "custom-dx-components buildLibrary",
|
|
14
13
|
"create": "custom-dx-components create",
|
|
15
14
|
"createAll": "custom-dx-components createAll",
|
|
16
15
|
"publish": "custom-dx-components publish",
|
|
17
16
|
"publishAll": "custom-dx-components publishAll",
|
|
18
|
-
"publishLibrary": "custom-dx-components publishLibrary",
|
|
19
17
|
"rename": "custom-dx-components rename",
|
|
20
|
-
"renameLibrary": "custom-dx-components renameLibrary",
|
|
21
18
|
"list": "custom-dx-components list",
|
|
22
|
-
"listLibrary": "custom-dx-components listLibrary",
|
|
23
19
|
"validate-schema": "custom-dx-components validateSchema",
|
|
24
20
|
"update": "custom-dx-components update",
|
|
25
21
|
"delete": "custom-dx-components delete",
|
|
26
22
|
"deleteAll": "custom-dx-components deleteAll",
|
|
27
|
-
"deleteLibrary": "custom-dx-components deleteLibrary",
|
|
28
23
|
"promoteWebPack": "custom-dx-components promoteWebPack",
|
|
29
24
|
"revertWebPack": "custom-dx-components revertWebPack",
|
|
25
|
+
"_library_comments": "library based commands",
|
|
26
|
+
"buildLibrary": "custom-dx-components buildLibrary",
|
|
27
|
+
"publishLibrary": "custom-dx-components publishLibrary",
|
|
28
|
+
"renameLibrary": "custom-dx-components renameLibrary",
|
|
29
|
+
"listLibrary": "custom-dx-components listLibrary",
|
|
30
|
+
"deleteLibrary": "custom-dx-components deleteLibrary",
|
|
30
31
|
"_internal-test-coverage": "node --input-type=module --experimental-vm-modules node_modules/jest/bin/jest.js --runInBand node_modules/@pega/custom-dx-component --ci --testResultsProcessor='jest-junit' --coverage",
|
|
31
32
|
"_internal-test": "echo 'Running functional and unit tests will DELETE existing local components, proceed (y/n)?' && read proceed && if test \"$proceed\" = \"y\"; then npm run _internal-test-full; fi ",
|
|
32
33
|
"_internal-test-full": "npm run _internal-test-functional && npm run _internal-test-unit",
|
|
@@ -80,7 +81,7 @@
|
|
|
80
81
|
},
|
|
81
82
|
"devDependencies": {
|
|
82
83
|
"@pega/configs": "^0.6.0",
|
|
83
|
-
"@pega/custom-dx-components": "0.242.
|
|
84
|
+
"@pega/custom-dx-components": "0.242.21",
|
|
84
85
|
"@pega/pcore-pconnect-typedefs": "~3.0.0",
|
|
85
86
|
"@storybook/addon-actions": "^7.6.7",
|
|
86
87
|
"@storybook/addon-essentials": "^7.6.19",
|
|
@@ -110,6 +111,7 @@
|
|
|
110
111
|
"jest": "^29.7.0",
|
|
111
112
|
"jest-environment-jsdom": "^29.7.0",
|
|
112
113
|
"jest-junit": "^16.0.0",
|
|
114
|
+
"jwt-decode": "^4.0.0",
|
|
113
115
|
"npm-run-all": "^4.1.5",
|
|
114
116
|
"prettier": "3.1.1",
|
|
115
117
|
"storybook": "^7.6.19",
|
|
@@ -95,14 +95,21 @@ export default async (options) => {
|
|
|
95
95
|
let data = await getLocalLibraryVersionData(libraryName, selectedVersion);
|
|
96
96
|
data = JSON.parse(data);
|
|
97
97
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
98
|
+
// get built on from first component if exists
|
|
99
|
+
let builtOn = "(date unavailable)";
|
|
100
|
+
if (data[0] && data[0].buildDate) {
|
|
101
|
+
builtOn = data[0].buildDate;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
let libData = data.map((component) => ( {'Component': component.name, 'Label': component.label, 'Version': component.version, 'Type': component.type, 'Sub Type' : component.subtype}));
|
|
105
|
+
console.log(chalk.bold.blueBright(`\nList of ${libraryName}:${selectedVersion} components built on ${builtOn}.`));
|
|
106
|
+
console.table(libData, ['Component', 'Label', 'Version', 'Type', 'Sub Type']);
|
|
101
107
|
|
|
102
108
|
}
|
|
103
109
|
else {
|
|
104
110
|
// No library with that name
|
|
105
111
|
console.log(chalk.redBright(`No local library named: ${libraryName} exists.`));
|
|
112
|
+
console.log(chalk.redBright(`You need to build library: ${libraryName} first.`));
|
|
106
113
|
process.exit(1);
|
|
107
114
|
|
|
108
115
|
}
|
|
@@ -128,14 +135,21 @@ export default async (options) => {
|
|
|
128
135
|
const versionData = libVersions[selectedVersion];
|
|
129
136
|
const data = JSON.parse(versionData);
|
|
130
137
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
138
|
+
// get built on from first component if exists
|
|
139
|
+
let builtOn = "(date unavailable)";
|
|
140
|
+
if (data[0] && data[0].buildDate) {
|
|
141
|
+
builtOn = data[0].buildDate;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
let libData = data.map((component) => ( {'Component': component.name, 'Label': component.label, 'Version': component.version, 'Type': component.type, 'Sub Type' : component.subtype}));
|
|
145
|
+
console.log(chalk.bold.blueBright(`\nList of ${libraryName}:${selectedVersion} components built on ${builtOn}.`));
|
|
146
|
+
console.table(libData, ['Component', 'Label', 'Version', 'Type', 'Sub Type']);
|
|
134
147
|
|
|
135
148
|
}
|
|
136
149
|
else {
|
|
137
150
|
// No library with that name
|
|
138
|
-
console.log(chalk.redBright(`No
|
|
151
|
+
console.log(chalk.redBright(`No server library named: ${libraryName} exists.`));
|
|
152
|
+
console.log(chalk.redBright(`You need to build library: ${libraryName} and publish this library.`));
|
|
139
153
|
process.exit(1);
|
|
140
154
|
|
|
141
155
|
}
|
|
@@ -221,7 +221,8 @@ export default async (options) => {
|
|
|
221
221
|
|
|
222
222
|
}
|
|
223
223
|
else {
|
|
224
|
-
console.log(chalk.bold.redBright(`No library versions
|
|
224
|
+
console.log(chalk.bold.redBright(`No library versions named ${libraryName}.`));
|
|
225
|
+
console.log(chalk.bold.redBright(`You need to build library ${libraryName} first.`));
|
|
225
226
|
}
|
|
226
227
|
|
|
227
228
|
|