@pega/custom-dx-components 0.25.18 → 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/cli.js +6 -0
- package/src/constants.js +3 -1
- package/src/tasks/build-jest-assets/index.js +5 -5
- package/src/tasks/create-version/helper.js +30 -0
- package/src/tasks/create-version/index.js +12 -4
- package/src/tasks/delete-pub/helper.js +1 -1
- package/src/tasks/delete-pub/index.js +6 -1
- package/src/tasks/export-archive/helper.js +12 -12
- package/src/tasks/export-archive/index.js +6 -0
- package/src/tasks/import-archive/helper.js +205 -3
- package/src/tasks/import-archive/index.js +146 -31
- package/src/tasks/index.js +1 -0
- package/src/tasks/init/template/package.json.mustache +2 -1
- package/src/tasks/list-pub/helper.js +3 -3
- package/src/tasks/publish-archive/index.js +5 -2
- package/src/tasks/restore/index.js +72 -0
- package/src/tasks/show-help/index.js +25 -7
- package/src/tasks/show-status/index.js +10 -6
- package/src/util.js +58 -1
- 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
|
@@ -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
|
-
});
|