@pega/custom-dx-components 0.25.19 → 0.25.20
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 +5 -5
- package/src/tasks/init/template/package.json.mustache +1 -1
- package/src/tasks/show-status/index.js +10 -6
- package/src/util.js +54 -0
- package/tests/assets/library/components/create/Pega_DXIL_MyTestText/config.json +1 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyBoolean/config.json +1 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/config.json +1 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/localizations.json +8 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyCurrency/config.json +1 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDate/config.json +1 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDateTime/config.json +1 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDecimal/config.json +1 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDetails/config.json +1 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyEmail/config.json +1 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyForm/config.json +1 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/config.json +1 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/localizations.json +10 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyInteger/config.json +1 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPage/config.json +1 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/config.json +1 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPageWidget/config.json +1 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPageWidget/localizations.json +10 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyParagraph/config.json +1 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPercentage/config.json +1 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPhone/config.json +1 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPicklist/config.json +1 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyRadiobuttons/config.json +1 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MySearchbox/config.json +1 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MySearchbox/localizations.json +5 -0
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyText/config.json +1 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTextInput/config.json +1 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/config.json +1 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/config.json +1 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/config.json +1 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyURL/config.json +1 -1
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/localizations.json +8 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/localizations.json +10 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPageWidget/localizations.json +10 -0
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MySearchbox/localizations.json +5 -0
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MySearchbox/localizations.json +5 -0
- package/tests/functional/localCreateAllListDeleteAll.test.js +8 -8
- package/tests/functional/localLibCreateLibAlreadyDeleteLib.test.js +14 -14
- package/tests/functional/localLibCreateLibBuildLibDeleteLib.test.js +17 -17
- package/tests/functional/localLibCreateLibBuildLibListPubDeleteLib.test.js +20 -20
- package/tests/functional/localLibCreateLibDeleteLib.test.js +17 -17
- package/tests/functional/localLibCreateLibExportImportLib.test.js +27 -27
- package/tests/functional/localLibCreateLibExportLib.test.js +19 -19
- package/tests/functional/localLibCreateLibImportCompDeleteLib.test.js +14 -14
- package/tests/functional/localLibCreateLibListDeleteLib.test.js +22 -22
- package/tests/functional/localLibCreateLibListMoveDeleteLib.test.js +31 -31
- package/tests/functional/localLibCreateLibListSwitchDeleteLib.test.js +20 -20
- package/tests/functional/localLibCreateLibStatusDeleteLib.test.js +13 -29
- package/tests/functional/localLibCreateLibValidateDeleteLib.test.js +15 -15
- package/tests/functional/localLibCreateLibVersionDeleteLib.test.js +27 -27
- package/tests/functional/localLibCreateLibPermDeleteLib.test.js +0 -144
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@ import inquirer from 'inquirer';
|
|
|
5
5
|
import { Listr } from 'listr2';
|
|
6
6
|
import chalk from 'chalk';
|
|
7
7
|
|
|
8
|
-
import { showVersion, getServerType, setServerType, getSubComponents, deleteLocalComponent, checkPathAccess, getComponents,
|
|
8
|
+
import { showVersion, getServerType, setServerType, getSubComponents, deleteLocalComponent, checkPathAccess, getComponents, getLibraryBasedCL, setLibraryBasedCL, forceDefaultsUpdate } from '../../util.js';
|
|
9
9
|
import createAll from '../create-all/index.js';
|
|
10
10
|
import create from '../create/index.js';
|
|
11
11
|
import createLib from '../create-lib/index.js';
|
|
@@ -220,9 +220,9 @@ export default async options => {
|
|
|
220
220
|
if (buildAssets) {
|
|
221
221
|
// get current server type
|
|
222
222
|
const savedServerType = await getServerType();
|
|
223
|
-
const
|
|
223
|
+
const savedLibraryBasedCL = getLibraryBasedCL();
|
|
224
224
|
|
|
225
|
-
await
|
|
225
|
+
await setLibraryBasedCL(false);
|
|
226
226
|
|
|
227
227
|
// Constellation
|
|
228
228
|
await setServerType("infinity");
|
|
@@ -233,7 +233,7 @@ export default async options => {
|
|
|
233
233
|
await createJestOriginalAssets(true);
|
|
234
234
|
|
|
235
235
|
// Constellation Library
|
|
236
|
-
await
|
|
236
|
+
await setLibraryBasedCL(true);
|
|
237
237
|
await setServerType("infinity");
|
|
238
238
|
|
|
239
239
|
await createJestLibraryAssets(false);
|
|
@@ -246,7 +246,7 @@ export default async options => {
|
|
|
246
246
|
|
|
247
247
|
// restore serverType
|
|
248
248
|
await setServerType(savedServerType);
|
|
249
|
-
await
|
|
249
|
+
await setLibraryBasedCL(savedLibraryBasedCL);
|
|
250
250
|
|
|
251
251
|
}
|
|
252
252
|
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
"@babel/preset-react": "^7.26.3",
|
|
108
108
|
"@babel/preset-typescript": "^7.26.0",
|
|
109
109
|
"@pega/configs": "^0.16.2",
|
|
110
|
-
"@pega/custom-dx-components": "~0.25.
|
|
110
|
+
"@pega/custom-dx-components": "~0.25.20",
|
|
111
111
|
"@pega/pcore-pconnect-typedefs": "^4.1.0-alpha.1",
|
|
112
112
|
"@storybook/addon-actions": "^7.6.19",
|
|
113
113
|
"@storybook/addon-essentials": "^7.6.19",
|
|
@@ -3,12 +3,13 @@ import path from 'path';
|
|
|
3
3
|
|
|
4
4
|
import chalk from 'chalk';
|
|
5
5
|
|
|
6
|
-
import { showVersion, getLibraryBased, addDebugLog, getConfigDefaults, getComponents, checkLibraryAndArchives } from '../../util.js';
|
|
6
|
+
import { showVersion, getLibraryBased, addDebugLog, getConfigDefaults, getComponents, checkLibraryAndArchives, getLibraryBasedCL } from '../../util.js';
|
|
7
7
|
|
|
8
8
|
export const showCurrentStatus = async () => {
|
|
9
9
|
|
|
10
10
|
const configDefaults = getConfigDefaults();
|
|
11
11
|
const componentList = await getComponents();
|
|
12
|
+
const isLibraryBasedCL = getLibraryBasedCL();
|
|
12
13
|
|
|
13
14
|
console.log("");
|
|
14
15
|
console.log("\tCurrent status");
|
|
@@ -16,12 +17,15 @@ export const showCurrentStatus = async () => {
|
|
|
16
17
|
console.log(`\tOrganization:\t ${chalk.bold.green(`${configDefaults.organization}`)}`);
|
|
17
18
|
console.log(`\tLibrary:\t ${chalk.bold.green(`${configDefaults.library}`)}`);
|
|
18
19
|
console.log(`\tVersion:\t ${chalk.bold.green(`${configDefaults.buildVersion}`)}`);
|
|
19
|
-
if (!
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
if (!isLibraryBasedCL) {
|
|
21
|
+
if (!configDefaults.devBuild) {
|
|
22
|
+
console.log(`\tPermanent:\t ${chalk.bold.magentaBright(`${!configDefaults.devBuild}`)}`);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
console.log(`\tPermanent:\t ${chalk.bold.green(`${!configDefaults.devBuild}`)}`);
|
|
26
|
+
}
|
|
24
27
|
}
|
|
28
|
+
|
|
25
29
|
console.log(`\tComponent count: ${chalk.bold.green(`${componentList.length}`)}`);
|
|
26
30
|
|
|
27
31
|
console.log("");
|
package/src/util.js
CHANGED
|
@@ -155,6 +155,11 @@ export const setUpDefaults = async () => {
|
|
|
155
155
|
|
|
156
156
|
if (data[LIBRARY_BASED_CL]) {
|
|
157
157
|
retrievedConfigData.isLibraryBasedCL = data[LIBRARY_BASED_CL];
|
|
158
|
+
|
|
159
|
+
// if this is true, then force librarybased to true, so it doesn't have to be set
|
|
160
|
+
if (retrievedConfigData.isLibraryBasedCL) {
|
|
161
|
+
retrievedConfigData.isLibraryBased = retrievedConfigData.isLibraryBasedCL;
|
|
162
|
+
}
|
|
158
163
|
}
|
|
159
164
|
|
|
160
165
|
|
|
@@ -470,6 +475,55 @@ if (showDebug) addDebugLog("setLibraryBased", "", "");
|
|
|
470
475
|
|
|
471
476
|
}
|
|
472
477
|
|
|
478
|
+
export const setLibraryBasedCL = async (isLibraryBasedCL) => {
|
|
479
|
+
if (showDebug) addDebugLog("setLibraryBased", "", "");
|
|
480
|
+
const currentDirectory = process.cwd();
|
|
481
|
+
const pegaConfigJsonPath = join(currentDirectory, TASKS_CONFIG_JSON_FILENAME);
|
|
482
|
+
|
|
483
|
+
try {
|
|
484
|
+
// force to throw error and not console log
|
|
485
|
+
await checkPathAccess(pegaConfigJsonPath, {}, true);
|
|
486
|
+
}
|
|
487
|
+
catch (ex) {
|
|
488
|
+
// when can't find it, always be false, assume no library based.
|
|
489
|
+
// This is IMPORTANT for init (npx install)
|
|
490
|
+
return false;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
let data = fs.readFileSync(pegaConfigJsonPath, { encoding: 'utf8' });
|
|
494
|
+
data = JSON.parse(data);
|
|
495
|
+
|
|
496
|
+
if (data[LIBRARY_BASED_CL] != undefined) {
|
|
497
|
+
data[LIBRARY_BASED_CL] = isLibraryBasedCL;
|
|
498
|
+
|
|
499
|
+
// if not undefined, force this as well
|
|
500
|
+
if (data[LIBRARY_BASED] != undefined) {
|
|
501
|
+
data[LIBRARY_BASED] = isLibraryBasedCL;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
// update file
|
|
505
|
+
// stringify "4", makes the json string look like JSON in the file, formated instead of a single line
|
|
506
|
+
try {
|
|
507
|
+
fs.writeFileSync(pegaConfigJsonPath, JSON.stringify(data, null, 4), { encoding: 'utf8',flag:'w' });
|
|
508
|
+
}
|
|
509
|
+
catch (err) {
|
|
510
|
+
console.error(err);
|
|
511
|
+
}
|
|
512
|
+
//await forceDefaultsUpdate();
|
|
513
|
+
defaultConfigs.isLibraryBasedCL = isLibraryBasedCL;
|
|
514
|
+
|
|
515
|
+
// force libraryBased if isLibraryBasedCL is true
|
|
516
|
+
defaultConfigs.isLibraryBased = isLibraryBasedCL;
|
|
517
|
+
|
|
518
|
+
|
|
519
|
+
// reset
|
|
520
|
+
pegaData = null;
|
|
521
|
+
pegaConfig = null;
|
|
522
|
+
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
}
|
|
526
|
+
|
|
473
527
|
export const getShowDebug = () => {
|
|
474
528
|
// const currentDirectory = process.cwd();
|
|
475
529
|
// const pegaConfigJsonPath = join(currentDirectory, TASKS_CONFIG_JSON_FILENAME);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"fields": {
|
|
3
|
+
"State name" : "State name",
|
|
4
|
+
"State code" : "State code",
|
|
5
|
+
"State list for": "State list for",
|
|
6
|
+
"Click to show/hide state list": "Click to show/hide state list",
|
|
7
|
+
"State list": "State list",
|
|
8
|
+
"Loading state list": "Loading state list"
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"fields": {
|
|
3
|
+
"State name" : "State name",
|
|
4
|
+
"State code" : "State code",
|
|
5
|
+
"State list for": "State list for",
|
|
6
|
+
"Click to show/hide state list": "Click to show/hide state list",
|
|
7
|
+
"State list": "State list",
|
|
8
|
+
"Loading state list": "Loading state list"
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -12,13 +12,13 @@ const packageJSONDir = path.resolve('../../..', 'package.json');
|
|
|
12
12
|
const packageJSONData = fs.readFileSync(packageJSONDir, { encoding: 'utf8'});
|
|
13
13
|
let packageJSON = JSON.parse(packageJSONData);
|
|
14
14
|
|
|
15
|
-
let
|
|
16
|
-
const savedLibraryBased =
|
|
15
|
+
let isLibraryBasedCL = tasksConfigJSON['libraryModeCL'];
|
|
16
|
+
const savedLibraryBased = isLibraryBasedCL;
|
|
17
17
|
const savedOrganization = packageJSON.organization;
|
|
18
18
|
|
|
19
19
|
const serverType = tasksConfigJSON['server-config'].serverType;
|
|
20
20
|
const serverDir = serverType === 'launchpad' ? 'Launchpad' : 'Constellation';
|
|
21
|
-
let compType =
|
|
21
|
+
let compType = isLibraryBasedCL ? "library" : "original";
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
describe(`createAll list deleteAll local: ${serverDir} - ${compType}` , () => {
|
|
@@ -26,9 +26,9 @@ describe(`createAll list deleteAll local: ${serverDir} - ${compType}` , () => {
|
|
|
26
26
|
beforeAll( async() => {
|
|
27
27
|
|
|
28
28
|
// make non libraryBased
|
|
29
|
-
|
|
30
|
-
tasksConfigJSON['
|
|
31
|
-
compType =
|
|
29
|
+
isLibraryBasedCL = false;
|
|
30
|
+
tasksConfigJSON['libraryModeCL'] = isLibraryBasedCL;
|
|
31
|
+
compType = isLibraryBasedCL ? "library" : "original";
|
|
32
32
|
fs.writeFileSync(tasksConfigDir, JSON.stringify(tasksConfigJSON, null, 4), { encoding: 'utf8' });
|
|
33
33
|
|
|
34
34
|
// make organzation Pega
|
|
@@ -49,8 +49,8 @@ describe(`createAll list deleteAll local: ${serverDir} - ${compType}` , () => {
|
|
|
49
49
|
afterAll( async() => {
|
|
50
50
|
|
|
51
51
|
//restore
|
|
52
|
-
|
|
53
|
-
tasksConfigJSON['
|
|
52
|
+
isLibraryBasedCL = savedLibraryBased
|
|
53
|
+
tasksConfigJSON['libraryModeCL'] = isLibraryBasedCL;
|
|
54
54
|
|
|
55
55
|
fs.writeFileSync(tasksConfigDir, JSON.stringify(tasksConfigJSON, null, 4), { encoding: 'utf8' });
|
|
56
56
|
|