@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.
Files changed (56) hide show
  1. package/package.json +1 -1
  2. package/src/tasks/build-jest-assets/index.js +5 -5
  3. package/src/tasks/init/template/package.json.mustache +1 -1
  4. package/src/tasks/show-status/index.js +10 -6
  5. package/src/util.js +54 -0
  6. package/tests/assets/library/components/create/Pega_DXIL_MyTestText/config.json +1 -1
  7. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyBoolean/config.json +1 -1
  8. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/config.json +1 -1
  9. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/localizations.json +8 -0
  10. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyCurrency/config.json +1 -1
  11. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDate/config.json +1 -1
  12. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDateTime/config.json +1 -1
  13. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDecimal/config.json +1 -1
  14. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDetails/config.json +1 -1
  15. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyEmail/config.json +1 -1
  16. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyForm/config.json +1 -1
  17. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/config.json +1 -1
  18. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/localizations.json +10 -0
  19. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyInteger/config.json +1 -1
  20. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPage/config.json +1 -1
  21. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/config.json +1 -1
  22. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPageWidget/config.json +1 -1
  23. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPageWidget/localizations.json +10 -0
  24. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyParagraph/config.json +1 -1
  25. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPercentage/config.json +1 -1
  26. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPhone/config.json +1 -1
  27. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPicklist/config.json +1 -1
  28. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyRadiobuttons/config.json +1 -1
  29. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MySearchbox/config.json +1 -1
  30. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MySearchbox/localizations.json +5 -0
  31. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyText/config.json +1 -1
  32. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTextInput/config.json +1 -1
  33. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/config.json +1 -1
  34. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/config.json +1 -1
  35. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/config.json +1 -1
  36. package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyURL/config.json +1 -1
  37. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/localizations.json +8 -0
  38. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/localizations.json +10 -0
  39. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPageWidget/localizations.json +10 -0
  40. package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MySearchbox/localizations.json +5 -0
  41. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MySearchbox/localizations.json +5 -0
  42. package/tests/functional/localCreateAllListDeleteAll.test.js +8 -8
  43. package/tests/functional/localLibCreateLibAlreadyDeleteLib.test.js +14 -14
  44. package/tests/functional/localLibCreateLibBuildLibDeleteLib.test.js +17 -17
  45. package/tests/functional/localLibCreateLibBuildLibListPubDeleteLib.test.js +20 -20
  46. package/tests/functional/localLibCreateLibDeleteLib.test.js +17 -17
  47. package/tests/functional/localLibCreateLibExportImportLib.test.js +27 -27
  48. package/tests/functional/localLibCreateLibExportLib.test.js +19 -19
  49. package/tests/functional/localLibCreateLibImportCompDeleteLib.test.js +14 -14
  50. package/tests/functional/localLibCreateLibListDeleteLib.test.js +22 -22
  51. package/tests/functional/localLibCreateLibListMoveDeleteLib.test.js +31 -31
  52. package/tests/functional/localLibCreateLibListSwitchDeleteLib.test.js +20 -20
  53. package/tests/functional/localLibCreateLibStatusDeleteLib.test.js +13 -29
  54. package/tests/functional/localLibCreateLibValidateDeleteLib.test.js +15 -15
  55. package/tests/functional/localLibCreateLibVersionDeleteLib.test.js +27 -27
  56. package/tests/functional/localLibCreateLibPermDeleteLib.test.js +0 -144
@@ -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 isLibraryBased = tasksConfigJSON['libraryMode'];
16
- const savedLibraryBased = isLibraryBased;
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 = isLibraryBased ? "library" : "original";
21
+ let compType = isLibraryBasedCL ? "library" : "original";
22
22
 
23
23
 
24
24
  describe(`createLib createAll list createLibVersion(with copy) switchLibe list deleteLibVersion(all) : ${serverDir} - ${compType}` , () => {
@@ -26,9 +26,9 @@ describe(`createLib createAll list createLibVersion(with copy) switchLibe list d
26
26
  beforeAll( async() => {
27
27
 
28
28
  // make libraryBased
29
- isLibraryBased = true;
30
- tasksConfigJSON['libraryMode'] = isLibraryBased;
31
- compType = isLibraryBased ? "library" : "original";
29
+ isLibraryBasedCL = true;
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
  const storeDir = path.join(path.resolve('../../..'), 'store');
@@ -55,8 +55,8 @@ describe(`createLib createAll list createLibVersion(with copy) switchLibe list d
55
55
  afterAll( async() => {
56
56
 
57
57
  //restore
58
- isLibraryBased = savedLibraryBased
59
- tasksConfigJSON['libraryMode'] = isLibraryBased;
58
+ isLibraryBasedCL = savedLibraryBased
59
+ tasksConfigJSON['libraryModeCL'] = isLibraryBasedCL;
60
60
 
61
61
  fs.writeFileSync(tasksConfigDir, JSON.stringify(tasksConfigJSON, null, 4), { encoding: 'utf8' });
62
62
 
@@ -80,13 +80,13 @@ describe(`createLib createAll list createLibVersion(with copy) switchLibe list d
80
80
  });
81
81
 
82
82
 
83
- it(`npm run createLib - ${isLibraryBased}`, async() => {
83
+ it(`npm run createLib - ${isLibraryBasedCL}`, async() => {
84
84
 
85
85
  const script = `npm run createLib DXIL 0.0.1 N Original --prefix ../../..`;
86
- const compConf = path.join("store", "Pega_DXIL","0.0.1-dev", "componentsconfig.json");
86
+ const compConf = path.join("store", "Pega_DXIL","0.0.1", "componentsconfig.json");
87
87
 
88
88
  const { stdout, stderr } = await exec(script);
89
- expect(stdout).toContain('Library Pega_DXIL/0.0.1-dev has been created!');
89
+ expect(stdout).toContain('Library Pega_DXIL/0.0.1 has been created!');
90
90
 
91
91
  const doesExist = fs.existsSync(path.resolve('../../..', compConf));
92
92
 
@@ -210,10 +210,10 @@ describe(`createLib createAll list createLibVersion(with copy) switchLibe list d
210
210
  let assetFileData = fs.readFileSync(assetFilePath, { encoding: 'utf8' });
211
211
 
212
212
  // so that we don't have to generate all new assets, change "version"
213
- // from 0.0.1-dev to 0.0.1 for now
213
+ // from 0.0.1 to 0.0.1 for now
214
214
  if (file === "config.json") {
215
- expect(componentFileData).toContain("0.0.1-dev");
216
- // componentFileData = componentFileData.replace("0.0.1-dev", "0.0.1");
215
+ expect(componentFileData).toContain("0.0.1");
216
+ // componentFileData = componentFileData.replace("0.0.1", "0.0.1");
217
217
 
218
218
  // normalize
219
219
  componentFileData = JSON.stringify(JSON.parse(componentFileData));
@@ -225,13 +225,13 @@ describe(`createLib createAll list createLibVersion(with copy) switchLibe list d
225
225
  });
226
226
  }, 10000);
227
227
 
228
- it(`npm run createLibVersion and copy - ${isLibraryBased}`, async() => {
228
+ it(`npm run createLibVersion and copy - ${isLibraryBasedCL}`, async() => {
229
229
 
230
230
  const script = `npm run createLibVersion 0.0.2 N Y NoAbout --prefix ../../..`;
231
231
  const { stdout, stderr } = await exec(script);
232
232
 
233
- expect(stdout).toContain('Library Pega_DXIL/0.0.1-dev has been stored.');
234
- expect(stdout).toContain('Library Pega_DXIL/0.0.2-dev has been created!');
233
+ expect(stdout).toContain('Library Pega_DXIL/0.0.1 has been stored.');
234
+ expect(stdout).toContain('Library Pega_DXIL/0.0.2 has been created!');
235
235
 
236
236
  }, 30000);
237
237
 
@@ -318,10 +318,10 @@ describe(`createLib createAll list createLibVersion(with copy) switchLibe list d
318
318
  let assetFileData = fs.readFileSync(assetFilePath, { encoding: 'utf8' });
319
319
 
320
320
  // so that we don't have to generate all new assets, change "version"
321
- // from 0.0.2-dev to 0.0.1 for now
321
+ // from 0.0.2 to 0.0.1 for now
322
322
  if (file === "config.json") {
323
- expect(componentFileData).toContain("0.0.2-dev");
324
- componentFileData = componentFileData.replace("0.0.2-dev", "0.0.1-dev");
323
+ expect(componentFileData).toContain("0.0.2");
324
+ componentFileData = componentFileData.replace("0.0.2", "0.0.1");
325
325
 
326
326
  // normalize
327
327
  componentFileData = JSON.stringify(JSON.parse(componentFileData));
@@ -333,12 +333,12 @@ describe(`createLib createAll list createLibVersion(with copy) switchLibe list d
333
333
  });
334
334
  }, 10000);
335
335
 
336
- it(`npm run switchLibVersion - ${isLibraryBased}`, async() => {
336
+ it(`npm run switchLibVersion - ${isLibraryBasedCL}`, async() => {
337
337
  // we are at version 0.0.2, switch to 0.0.1
338
- const script = `npm run switchLibVersion Y 0.0.1-dev NoAbout --prefix ../../..`;
338
+ const script = `npm run switchLibVersion Y 0.0.1 NoAbout --prefix ../../..`;
339
339
  const { stdout, stderr } = await exec(script);
340
340
 
341
- expect(stdout).toContain('Switched to Pega_DXIL/0.0.1-dev!');
341
+ expect(stdout).toContain('Switched to Pega_DXIL/0.0.1!');
342
342
 
343
343
 
344
344
  }, 30000);
@@ -426,10 +426,10 @@ describe(`createLib createAll list createLibVersion(with copy) switchLibe list d
426
426
  let assetFileData = fs.readFileSync(assetFilePath, { encoding: 'utf8' });
427
427
 
428
428
  // so that we don't have to generate all new assets, change "version"
429
- // from 0.0.1-dev to 0.0.1 for now
429
+ // from 0.0.1 to 0.0.1 for now
430
430
  if (file === "config.json") {
431
- expect(componentFileData).toContain("0.0.1-dev");
432
- // componentFileData = componentFileData.replace("0.0.1-dev", "0.0.1");
431
+ expect(componentFileData).toContain("0.0.1");
432
+ // componentFileData = componentFileData.replace("0.0.1", "0.0.1");
433
433
  // normalize
434
434
  componentFileData = JSON.stringify(JSON.parse(componentFileData));
435
435
  assetFileData = JSON.stringify(JSON.parse(assetFileData));
@@ -440,7 +440,7 @@ describe(`createLib createAll list createLibVersion(with copy) switchLibe list d
440
440
  });
441
441
  }, 10000);
442
442
 
443
- it(`npm run deleteLibVersion ALL - ${isLibraryBased}`, async() => {
443
+ it(`npm run deleteLibVersion ALL - ${isLibraryBasedCL}`, async() => {
444
444
 
445
445
  const script = `npm run deleteLibVersion Pega_DXIL ALL Y --prefix ../../..`;
446
446
  const { stdout, stderr } = await exec(script);
@@ -1,144 +0,0 @@
1
- // import { exec } from 'child_process';
2
- const path = require('path');
3
- const fs = require('fs');
4
- const util = require('node:util');
5
- const exec = util.promisify(require('node:child_process').exec);
6
-
7
- const tasksConfigDir = path.resolve('../../..', 'tasks.config.json');
8
- const tasksConfigData = fs.readFileSync(tasksConfigDir, { encoding: 'utf8' });
9
- let tasksConfigJSON = JSON.parse(tasksConfigData);
10
-
11
- const packageJSONDir = path.resolve('../../..', 'package.json');
12
- const packageJSONData = fs.readFileSync(packageJSONDir, { encoding: 'utf8'});
13
- let packageJSON = JSON.parse(packageJSONData);
14
-
15
- let isLibraryBased = tasksConfigJSON['libraryMode'];
16
- const savedLibraryBased = isLibraryBased;
17
- const savedOrganization = packageJSON.organization;
18
-
19
- const serverType = tasksConfigJSON['server-config'].serverType;
20
- const serverDir = serverType === 'launchpad' ? 'Launchpad' : 'Constellation';
21
- let compType = isLibraryBased ? "library" : "original";
22
-
23
-
24
- describe(`createLib setPerm setNotPerm deleteLib: ${serverDir} - ${compType}` , () => {
25
-
26
- beforeAll( async() => {
27
-
28
- // make libraryBased
29
- isLibraryBased = true;
30
- tasksConfigJSON['libraryMode'] = isLibraryBased;
31
- compType = isLibraryBased ? "library" : "original";
32
- fs.writeFileSync(tasksConfigDir, JSON.stringify(tasksConfigJSON, null, 4), { encoding: 'utf8' });
33
-
34
- const storeDir = path.join(path.resolve('../../..'), 'store');
35
- if (fs.existsSync(storeDir)) {
36
- fs.rmSync(storeDir, { recursive: true, force: true, maxRetries: 2 });
37
- }
38
-
39
- // make organzation Pega
40
- packageJSON.organization = "Pega";
41
- fs.writeFileSync(packageJSONDir, JSON.stringify(packageJSON, null, 4), { encoding: 'utf8' });
42
-
43
-
44
- const componentsDir = path.join(path.resolve('../../..'), 'src/components');
45
- if (fs.existsSync(componentsDir)) {
46
- fs.rmSync(componentsDir, { recursive: true, force: true, maxRetries: 2 });
47
- fs.mkdirSync(componentsDir, { recursive: true });
48
- }
49
-
50
- await new Promise((r) => setTimeout(r, 2000));
51
-
52
- });
53
-
54
- afterAll( async() => {
55
-
56
- //restore
57
- isLibraryBased = savedLibraryBased
58
- tasksConfigJSON['libraryMode'] = isLibraryBased;
59
-
60
- fs.writeFileSync(tasksConfigDir, JSON.stringify(tasksConfigJSON, null, 4), { encoding: 'utf8' });
61
-
62
- // return organzation
63
- packageJSON.organization = savedOrganization;
64
- fs.writeFileSync(packageJSONDir, JSON.stringify(packageJSON, null, 4), { encoding: 'utf8' });
65
-
66
- const componentsDir = path.join(path.resolve('../../..'), 'src/components');
67
- if (fs.existsSync(componentsDir)) {
68
- fs.rmSync(componentsDir, { recursive: true, force: true, maxRetries: 2 });
69
- fs.mkdirSync(componentsDir, { recursive: true });
70
- }
71
-
72
- const storeDir = path.join(path.resolve('../../..'), 'store');
73
- if (fs.existsSync(storeDir)) {
74
- fs.rmSync(storeDir, { recursive: true, force: true, maxRetries: 2 });
75
- }
76
-
77
- await new Promise((r) => setTimeout(r, 2000));
78
-
79
- });
80
-
81
-
82
- it(`npm run createLib - ${isLibraryBased}`, async() => {
83
-
84
- const script = `npm run createLib DXIL 0.0.1 N Original --prefix ../../..`;
85
- const compConf = path.join("store", "Pega_DXIL","0.0.1-dev", "componentsconfig.json");
86
-
87
- const { stdout, stderr } = await exec(script);
88
- expect(stdout).toContain('Library Pega_DXIL/0.0.1-dev has been created!');
89
-
90
- const doesExist = fs.existsSync(path.resolve('../../..', compConf));
91
-
92
- expect(doesExist).toBeTruthy();
93
-
94
- }, 30000);
95
-
96
- it(`npm run setPerm (Y) - ${isLibraryBased}`, async() => {
97
-
98
- const script = `npm run setPermanent Y --prefix ../../..`;
99
- const { stdout, stderr } = await exec(script);
100
-
101
- expect(stdout).toContain('Organization:');
102
- expect(stdout).toContain('Pega');
103
- expect(stdout).toContain('Library:');
104
- expect(stdout).toContain('DXIL');
105
- expect(stdout).toContain('Version:');
106
- expect(stdout).toContain('0.0.1');
107
- expect(stdout).toContain('Permanent:');
108
- expect(stdout).toContain('true');
109
- expect(stdout).toContain('Component count:');
110
- expect(stdout).toContain('0');
111
-
112
- }, 30000);
113
-
114
- it(`npm run setPerm (N) - ${isLibraryBased}`, async() => {
115
-
116
- const script = `npm run setPermanent N --prefix ../../..`;
117
- const { stdout, stderr } = await exec(script);
118
-
119
- expect(stdout).toContain('Organization:');
120
- expect(stdout).toContain('Pega');
121
- expect(stdout).toContain('Library:');
122
- expect(stdout).toContain('DXIL');
123
- expect(stdout).toContain('Version:');
124
- expect(stdout).toContain('0.0.1-dev');
125
- expect(stdout).toContain('Permanent:');
126
- expect(stdout).toContain('false');
127
- expect(stdout).toContain('Component count:');
128
- expect(stdout).toContain('0');
129
-
130
- }, 30000);
131
-
132
-
133
- it(`npm run deleteLib- ${isLibraryBased}`, async() => {
134
-
135
- const script = `npm run deleteLib Pega_DXIL 0.0.1-dev Y --prefix ../../..`;
136
- const { stdout, stderr } = await exec(script);
137
-
138
- expect(stdout).toContain('Pega_DXIL is deleted from Local.');
139
-
140
-
141
- }, 30000);
142
-
143
-
144
- });