@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
|
@@ -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(`createLib deleteLib: ${serverDir} - ${compType}` , () => {
|
|
@@ -26,9 +26,9 @@ describe(`createLib deleteLib: ${serverDir} - ${compType}` , () => {
|
|
|
26
26
|
beforeAll( async() => {
|
|
27
27
|
|
|
28
28
|
// make libraryBased
|
|
29
|
-
|
|
30
|
-
tasksConfigJSON['
|
|
31
|
-
compType =
|
|
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 deleteLib: ${serverDir} - ${compType}` , () => {
|
|
|
55
55
|
afterAll( async() => {
|
|
56
56
|
|
|
57
57
|
//restore
|
|
58
|
-
|
|
59
|
-
tasksConfigJSON['
|
|
58
|
+
isLibraryBasedCL = savedLibraryBased
|
|
59
|
+
tasksConfigJSON['libraryModeCL'] = isLibraryBasedCL;
|
|
60
60
|
|
|
61
61
|
fs.writeFileSync(tasksConfigDir, JSON.stringify(tasksConfigJSON, null, 4), { encoding: 'utf8' });
|
|
62
62
|
|
|
@@ -93,13 +93,13 @@ describe(`createLib deleteLib: ${serverDir} - ${compType}` , () => {
|
|
|
93
93
|
}, 10000);
|
|
94
94
|
|
|
95
95
|
|
|
96
|
-
it(`npm run createLib - ${
|
|
96
|
+
it(`npm run createLib - ${isLibraryBasedCL}`, async() => {
|
|
97
97
|
|
|
98
98
|
const script = `npm run createLib DXIL 0.0.1 N Original --prefix ../../..`;
|
|
99
|
-
const compConf = path.join("store", "Pega_DXIL","0.0.1
|
|
99
|
+
const compConf = path.join("store", "Pega_DXIL","0.0.1", "componentsconfig.json");
|
|
100
100
|
|
|
101
101
|
const { stdout, stderr } = await exec(script);
|
|
102
|
-
expect(stdout).toContain('Library Pega_DXIL/0.0.1
|
|
102
|
+
expect(stdout).toContain('Library Pega_DXIL/0.0.1 has been created!');
|
|
103
103
|
|
|
104
104
|
const doesExist = fs.existsSync(path.resolve('../../..', compConf));
|
|
105
105
|
|
|
@@ -121,35 +121,35 @@ describe(`createLib deleteLib: ${serverDir} - ${compType}` , () => {
|
|
|
121
121
|
}, 10000);
|
|
122
122
|
|
|
123
123
|
it('npm run listLib (nothing current)', async () => {
|
|
124
|
-
const script = 'npm run listLib Pega_DXIL 0.0.1
|
|
124
|
+
const script = 'npm run listLib Pega_DXIL 0.0.1 Current --prefix ../../..';
|
|
125
125
|
const { stdout, stderr } = await exec(script);
|
|
126
126
|
|
|
127
127
|
expect(stderr).not.toBeNull();
|
|
128
128
|
|
|
129
129
|
// console.log(stdout);
|
|
130
130
|
expect(stdout).not.toBeNull();
|
|
131
|
-
expect(stdout).toContain('No custom components in Pega_DXIL/0.0.1
|
|
131
|
+
expect(stdout).toContain('No custom components in Pega_DXIL/0.0.1');
|
|
132
132
|
|
|
133
133
|
// done();
|
|
134
134
|
}, 10000);
|
|
135
135
|
|
|
136
136
|
it('npm run listLib (nothing store)', async () => {
|
|
137
|
-
const script = 'npm run listLib Pega_DXIL 0.0.1
|
|
137
|
+
const script = 'npm run listLib Pega_DXIL 0.0.1 Store --prefix ../../..';
|
|
138
138
|
const { stdout, stderr } = await exec(script);
|
|
139
139
|
|
|
140
140
|
expect(stderr).not.toBeNull();
|
|
141
141
|
|
|
142
142
|
// console.log(stdout);
|
|
143
143
|
expect(stdout).not.toBeNull();
|
|
144
|
-
expect(stdout).toContain('No custom components in Pega_DXIL/0.0.1
|
|
144
|
+
expect(stdout).toContain('No custom components in Pega_DXIL/0.0.1');
|
|
145
145
|
|
|
146
146
|
// done();
|
|
147
147
|
}, 10000);
|
|
148
148
|
|
|
149
149
|
|
|
150
|
-
it(`npm run deleteLib - ${
|
|
150
|
+
it(`npm run deleteLib - ${isLibraryBasedCL}`, async() => {
|
|
151
151
|
|
|
152
|
-
const script = `npm run deleteLib Pega_DXIL 0.0.1
|
|
152
|
+
const script = `npm run deleteLib Pega_DXIL 0.0.1 Y --prefix ../../..`;
|
|
153
153
|
const { stdout, stderr } = await exec(script);
|
|
154
154
|
|
|
155
155
|
expect(stdout).toContain('Pega_DXIL is deleted from Local.');
|
|
@@ -13,13 +13,13 @@ const packageJSONDir = path.resolve('../../..', 'package.json');
|
|
|
13
13
|
const packageJSONData = fs.readFileSync(packageJSONDir, { encoding: 'utf8'});
|
|
14
14
|
let packageJSON = JSON.parse(packageJSONData);
|
|
15
15
|
|
|
16
|
-
let
|
|
17
|
-
const savedLibraryBased =
|
|
16
|
+
let isLibraryBasedCL = tasksConfigJSON['libraryModeCL'];
|
|
17
|
+
const savedLibraryBased = isLibraryBasedCL;
|
|
18
18
|
const savedOrganization = packageJSON.organization;
|
|
19
19
|
|
|
20
20
|
const serverType = tasksConfigJSON['server-config'].serverType;
|
|
21
21
|
const serverDir = serverType === 'launchpad' ? 'Launchpad' : 'Constellation';
|
|
22
|
-
let compType =
|
|
22
|
+
let compType = isLibraryBasedCL ? "library" : "original";
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
describe(`createLib createAll exportStore importStore deleteLib: ${serverDir} - ${compType}` , () => {
|
|
@@ -27,9 +27,9 @@ describe(`createLib createAll exportStore importStore deleteLib: ${serverDir} -
|
|
|
27
27
|
beforeAll( async() => {
|
|
28
28
|
|
|
29
29
|
// make libraryBased
|
|
30
|
-
|
|
31
|
-
tasksConfigJSON['
|
|
32
|
-
compType =
|
|
30
|
+
isLibraryBasedCL = true;
|
|
31
|
+
tasksConfigJSON['libraryModeCL'] = isLibraryBasedCL;
|
|
32
|
+
compType = isLibraryBasedCL ? "library" : "original";
|
|
33
33
|
fs.writeFileSync(tasksConfigDir, JSON.stringify(tasksConfigJSON, null, 4), { encoding: 'utf8' });
|
|
34
34
|
|
|
35
35
|
const storeDir = path.join(path.resolve('../../..'), 'store');
|
|
@@ -55,8 +55,8 @@ describe(`createLib createAll exportStore importStore deleteLib: ${serverDir} -
|
|
|
55
55
|
afterAll( async() => {
|
|
56
56
|
|
|
57
57
|
//restore
|
|
58
|
-
|
|
59
|
-
tasksConfigJSON['
|
|
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 exportStore importStore deleteLib: ${serverDir} -
|
|
|
80
80
|
});
|
|
81
81
|
|
|
82
82
|
|
|
83
|
-
it(`npm run createLib - ${
|
|
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
|
|
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
|
|
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
|
|
|
@@ -125,7 +125,7 @@ describe(`createLib createAll exportStore importStore deleteLib: ${serverDir} -
|
|
|
125
125
|
// // remove it
|
|
126
126
|
// fs.rmdirSync(fileDir, { recursive: true });
|
|
127
127
|
// }
|
|
128
|
-
},
|
|
128
|
+
}, 90000);
|
|
129
129
|
|
|
130
130
|
it('npm run list', async () => {
|
|
131
131
|
const script = 'npm run list --prefix ../../..';
|
|
@@ -164,7 +164,7 @@ describe(`createLib createAll exportStore importStore deleteLib: ${serverDir} -
|
|
|
164
164
|
}, 10000);
|
|
165
165
|
|
|
166
166
|
|
|
167
|
-
it(`npm run export lib - ${
|
|
167
|
+
it(`npm run export lib - ${isLibraryBasedCL}`, async() => {
|
|
168
168
|
|
|
169
169
|
const currentDirectory = process.cwd();
|
|
170
170
|
const arPathParts = currentDirectory.split(path.sep);
|
|
@@ -173,17 +173,17 @@ describe(`createLib createAll exportStore importStore deleteLib: ${serverDir} -
|
|
|
173
173
|
defaultPath = "/".concat(defaultPath);
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
-
const script = `npm run exportLibVersion Full Pega_DXIL 0.0.1
|
|
176
|
+
const script = `npm run exportLibVersion Full Pega_DXIL 0.0.1 ${defaultPath} Current --prefix ../../..`;
|
|
177
177
|
const { stdout, stderr } = await exec(script);
|
|
178
178
|
|
|
179
|
-
expect(stdout).toContain('Pega_DXIL_0.0.1
|
|
180
|
-
const zipFile = path.join(defaultPath, "Pega_DXIL_0.0.1
|
|
179
|
+
expect(stdout).toContain('Pega_DXIL_0.0.1.arch.zip has been exported');
|
|
180
|
+
const zipFile = path.join(defaultPath, "Pega_DXIL_0.0.1.arch.zip");
|
|
181
181
|
expect(fs.existsSync(zipFile)).toBeTruthy();
|
|
182
182
|
|
|
183
183
|
|
|
184
|
-
},
|
|
184
|
+
}, 100000);
|
|
185
185
|
|
|
186
|
-
it(`npm run import lib (delete zip) - ${
|
|
186
|
+
it(`npm run import lib (delete zip) - ${isLibraryBasedCL}`, async() => {
|
|
187
187
|
|
|
188
188
|
const currentDirectory = process.cwd();
|
|
189
189
|
const arPathParts = currentDirectory.split(path.sep);
|
|
@@ -192,23 +192,23 @@ describe(`createLib createAll exportStore importStore deleteLib: ${serverDir} -
|
|
|
192
192
|
defaultPath = "/".concat(defaultPath);
|
|
193
193
|
}
|
|
194
194
|
|
|
195
|
-
const script = `npm run importLibVersion ${defaultPath} Pega_DXIL_0.0.1
|
|
195
|
+
const script = `npm run importLibVersion Local ${defaultPath} Pega_DXIL_0.0.1.arch.zip --prefix ../../..`;
|
|
196
196
|
const { stdout, stderr } = await exec(script);
|
|
197
197
|
|
|
198
|
-
expect(stdout).toContain('Pega_DXIL_0.0.1
|
|
199
|
-
expect(stdout).toContain('You can switch to Pega_DXIL/0.0.1
|
|
198
|
+
expect(stdout).toContain('Pega_DXIL_0.0.1.arch.zip has been imported!');
|
|
199
|
+
expect(stdout).toContain('You can switch to Pega_DXIL/0.0.1 via npm run switchLib.');
|
|
200
200
|
|
|
201
|
-
const zipFile = path.join(defaultPath, "Pega_DXIL_0.0.1
|
|
201
|
+
const zipFile = path.join(defaultPath, "Pega_DXIL_0.0.1.arch.zip");
|
|
202
202
|
expect(fs.existsSync(zipFile)).toBeTruthy();
|
|
203
203
|
|
|
204
204
|
// delete zip file
|
|
205
205
|
// fs.rmSync(zipFile, {recursive: true});
|
|
206
206
|
|
|
207
207
|
|
|
208
|
-
},
|
|
208
|
+
}, 70000);
|
|
209
209
|
|
|
210
210
|
|
|
211
|
-
it(`npm run delete import - ${
|
|
211
|
+
it(`npm run delete import - ${isLibraryBasedCL}`, async() => {
|
|
212
212
|
|
|
213
213
|
const currentDirectory = process.cwd();
|
|
214
214
|
const arPathParts = currentDirectory.split(path.sep);
|
|
@@ -217,7 +217,7 @@ describe(`createLib createAll exportStore importStore deleteLib: ${serverDir} -
|
|
|
217
217
|
defaultPath = "/".concat(defaultPath);
|
|
218
218
|
}
|
|
219
219
|
|
|
220
|
-
const zipFile = path.join(defaultPath, "Pega_DXIL_0.0.1
|
|
220
|
+
const zipFile = path.join(defaultPath, "Pega_DXIL_0.0.1.arch.zip");
|
|
221
221
|
expect(fs.existsSync(zipFile)).toBeTruthy();
|
|
222
222
|
|
|
223
223
|
// delete zip file
|
|
@@ -228,9 +228,9 @@ describe(`createLib createAll exportStore importStore deleteLib: ${serverDir} -
|
|
|
228
228
|
|
|
229
229
|
|
|
230
230
|
|
|
231
|
-
it(`npm run deleteLib - ${
|
|
231
|
+
it(`npm run deleteLib - ${isLibraryBasedCL}`, async() => {
|
|
232
232
|
|
|
233
|
-
const script = `npm run deleteLib Pega_DXIL 0.0.1
|
|
233
|
+
const script = `npm run deleteLib Pega_DXIL 0.0.1 Y --prefix ../../..`;
|
|
234
234
|
const { stdout, stderr } = await exec(script);
|
|
235
235
|
|
|
236
236
|
expect(stdout).toContain('Pega_DXIL is deleted from Local.');
|
|
@@ -13,13 +13,13 @@ const packageJSONDir = path.resolve('../../..', 'package.json');
|
|
|
13
13
|
const packageJSONData = fs.readFileSync(packageJSONDir, { encoding: 'utf8'});
|
|
14
14
|
let packageJSON = JSON.parse(packageJSONData);
|
|
15
15
|
|
|
16
|
-
let
|
|
17
|
-
const savedLibraryBased =
|
|
16
|
+
let isLibraryBasedCL = tasksConfigJSON['libraryModeCL'];
|
|
17
|
+
const savedLibraryBased = isLibraryBasedCL;
|
|
18
18
|
const savedOrganization = packageJSON.organization;
|
|
19
19
|
|
|
20
20
|
const serverType = tasksConfigJSON['server-config'].serverType;
|
|
21
21
|
const serverDir = serverType === 'launchpad' ? 'Launchpad' : 'Constellation';
|
|
22
|
-
let compType =
|
|
22
|
+
let compType = isLibraryBasedCL ? "library" : "original";
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
describe(`createLib createAll exportStore deleteLib: ${serverDir} - ${compType}` , () => {
|
|
@@ -27,9 +27,9 @@ describe(`createLib createAll exportStore deleteLib: ${serverDir} - ${compType}`
|
|
|
27
27
|
beforeAll( async() => {
|
|
28
28
|
|
|
29
29
|
// make libraryBased
|
|
30
|
-
|
|
31
|
-
tasksConfigJSON['
|
|
32
|
-
compType =
|
|
30
|
+
isLibraryBasedCL = true;
|
|
31
|
+
tasksConfigJSON['libraryModeCL'] = isLibraryBasedCL;
|
|
32
|
+
compType = isLibraryBasedCL ? "library" : "original";
|
|
33
33
|
fs.writeFileSync(tasksConfigDir, JSON.stringify(tasksConfigJSON, null, 4), { encoding: 'utf8' });
|
|
34
34
|
|
|
35
35
|
const storeDir = path.join(path.resolve('../../..'), 'store');
|
|
@@ -55,8 +55,8 @@ describe(`createLib createAll exportStore deleteLib: ${serverDir} - ${compType}`
|
|
|
55
55
|
afterAll( async() => {
|
|
56
56
|
|
|
57
57
|
//restore
|
|
58
|
-
|
|
59
|
-
tasksConfigJSON['
|
|
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 exportStore deleteLib: ${serverDir} - ${compType}`
|
|
|
80
80
|
});
|
|
81
81
|
|
|
82
82
|
|
|
83
|
-
it(`npm run createLib - ${
|
|
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
|
|
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
|
|
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
|
|
|
@@ -164,7 +164,7 @@ describe(`createLib createAll exportStore deleteLib: ${serverDir} - ${compType}`
|
|
|
164
164
|
}, 10000);
|
|
165
165
|
|
|
166
166
|
|
|
167
|
-
it(`npm run export lib (delete zip) - ${
|
|
167
|
+
it(`npm run export lib (delete zip) - ${isLibraryBasedCL}`, async() => {
|
|
168
168
|
|
|
169
169
|
const currentDirectory = process.cwd();
|
|
170
170
|
const arPathParts = currentDirectory.split(path.sep);
|
|
@@ -173,11 +173,11 @@ describe(`createLib createAll exportStore deleteLib: ${serverDir} - ${compType}`
|
|
|
173
173
|
defaultPath = "/".concat(defaultPath);
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
-
const script = `npm run exportLibVersion Full Pega_DXIL 0.0.1
|
|
176
|
+
const script = `npm run exportLibVersion Full Pega_DXIL 0.0.1 ${defaultPath} Current --prefix ../../..`;
|
|
177
177
|
const { stdout, stderr } = await exec(script);
|
|
178
178
|
|
|
179
|
-
expect(stdout).toContain('Pega_DXIL_0.0.1
|
|
180
|
-
const zipFile = path.join(defaultPath, "Pega_DXIL_0.0.1
|
|
179
|
+
expect(stdout).toContain('Pega_DXIL_0.0.1.arch.zip has been exported');
|
|
180
|
+
const zipFile = path.join(defaultPath, "Pega_DXIL_0.0.1.arch.zip");
|
|
181
181
|
expect(fs.existsSync(zipFile)).toBeTruthy();
|
|
182
182
|
|
|
183
183
|
// delete zip file
|
|
@@ -186,7 +186,7 @@ describe(`createLib createAll exportStore deleteLib: ${serverDir} - ${compType}`
|
|
|
186
186
|
|
|
187
187
|
}, 30000);
|
|
188
188
|
|
|
189
|
-
it(`npm run delete import - ${
|
|
189
|
+
it(`npm run delete import - ${isLibraryBasedCL}`, async() => {
|
|
190
190
|
|
|
191
191
|
const currentDirectory = process.cwd();
|
|
192
192
|
const arPathParts = currentDirectory.split(path.sep);
|
|
@@ -195,7 +195,7 @@ describe(`createLib createAll exportStore deleteLib: ${serverDir} - ${compType}`
|
|
|
195
195
|
defaultPath = "/".concat(defaultPath);
|
|
196
196
|
}
|
|
197
197
|
|
|
198
|
-
const zipFile = path.join(defaultPath, "Pega_DXIL_0.0.1
|
|
198
|
+
const zipFile = path.join(defaultPath, "Pega_DXIL_0.0.1.arch.zip");
|
|
199
199
|
expect(fs.existsSync(zipFile)).toBeTruthy();
|
|
200
200
|
|
|
201
201
|
// delete zip file
|
|
@@ -205,9 +205,9 @@ describe(`createLib createAll exportStore deleteLib: ${serverDir} - ${compType}`
|
|
|
205
205
|
}, 30000);
|
|
206
206
|
|
|
207
207
|
|
|
208
|
-
it(`npm run deleteLib - ${
|
|
208
|
+
it(`npm run deleteLib - ${isLibraryBasedCL}`, async() => {
|
|
209
209
|
|
|
210
|
-
const script = `npm run deleteLib Pega_DXIL 0.0.1
|
|
210
|
+
const script = `npm run deleteLib Pega_DXIL 0.0.1 Y --prefix ../../..`;
|
|
211
211
|
const { stdout, stderr } = await exec(script);
|
|
212
212
|
|
|
213
213
|
expect(stdout).toContain('Pega_DXIL is deleted from Local.');
|
|
@@ -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(`createLib importComp deleteLib: ${serverDir} - ${compType}` , () => {
|
|
@@ -26,9 +26,9 @@ describe(`createLib importComp deleteLib: ${serverDir} - ${compType}` , () => {
|
|
|
26
26
|
beforeAll( async() => {
|
|
27
27
|
|
|
28
28
|
// make libraryBased
|
|
29
|
-
|
|
30
|
-
tasksConfigJSON['
|
|
31
|
-
compType =
|
|
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');
|
|
@@ -54,8 +54,8 @@ describe(`createLib importComp deleteLib: ${serverDir} - ${compType}` , () => {
|
|
|
54
54
|
afterAll( async() => {
|
|
55
55
|
|
|
56
56
|
//restore
|
|
57
|
-
|
|
58
|
-
tasksConfigJSON['
|
|
57
|
+
isLibraryBasedCL = savedLibraryBased
|
|
58
|
+
tasksConfigJSON['libraryModeCL'] = isLibraryBasedCL;
|
|
59
59
|
|
|
60
60
|
fs.writeFileSync(tasksConfigDir, JSON.stringify(tasksConfigJSON, null, 4), { encoding: 'utf8' });
|
|
61
61
|
|
|
@@ -79,13 +79,13 @@ describe(`createLib importComp deleteLib: ${serverDir} - ${compType}` , () => {
|
|
|
79
79
|
});
|
|
80
80
|
|
|
81
81
|
|
|
82
|
-
it(`npm run createLib - ${
|
|
82
|
+
it(`npm run createLib - ${isLibraryBasedCL}`, async() => {
|
|
83
83
|
|
|
84
84
|
const script = `npm run createLib Other 0.0.1 N Original --prefix ../../..`;
|
|
85
|
-
const compConf = path.join("store", "Pega_Other","0.0.1
|
|
85
|
+
const compConf = path.join("store", "Pega_Other","0.0.1", "componentsconfig.json");
|
|
86
86
|
|
|
87
87
|
const { stdout, stderr } = await exec(script);
|
|
88
|
-
expect(stdout).toContain('Library Pega_Other/0.0.1
|
|
88
|
+
expect(stdout).toContain('Library Pega_Other/0.0.1 has been created!');
|
|
89
89
|
|
|
90
90
|
const doesExist = fs.existsSync(path.resolve('../../..', compConf));
|
|
91
91
|
|
|
@@ -94,7 +94,7 @@ describe(`createLib importComp deleteLib: ${serverDir} - ${compType}` , () => {
|
|
|
94
94
|
}, 30000);
|
|
95
95
|
|
|
96
96
|
|
|
97
|
-
it(`npm run importComponent - ${
|
|
97
|
+
it(`npm run importComponent - ${isLibraryBasedCL}`, async() => {
|
|
98
98
|
const assetDir = path.resolve(`tests/assets/${compType}/components/createAll/${serverDir}`);
|
|
99
99
|
|
|
100
100
|
// pulling in DXIL MyBoolean but should be renamed to Other MyBoolean
|
|
@@ -117,9 +117,9 @@ describe(`createLib importComp deleteLib: ${serverDir} - ${compType}` , () => {
|
|
|
117
117
|
// done();
|
|
118
118
|
}, 10000);
|
|
119
119
|
|
|
120
|
-
it(`npm run deleteLib - ${
|
|
120
|
+
it(`npm run deleteLib - ${isLibraryBasedCL}`, async() => {
|
|
121
121
|
|
|
122
|
-
const script = `npm run deleteLib Pega_Other 0.0.1
|
|
122
|
+
const script = `npm run deleteLib Pega_Other 0.0.1 Y --prefix ../../..`;
|
|
123
123
|
const { stdout, stderr } = await exec(script);
|
|
124
124
|
|
|
125
125
|
expect(stdout).toContain('Pega_Other is deleted from Local.');
|
|
@@ -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(`createLib createAll list deleteVersion deleteLib: ${serverDir} - ${compType}` , () => {
|
|
@@ -26,9 +26,9 @@ describe(`createLib createAll list deleteVersion deleteLib: ${serverDir} - ${com
|
|
|
26
26
|
beforeAll( async() => {
|
|
27
27
|
|
|
28
28
|
// make libraryBased
|
|
29
|
-
|
|
30
|
-
tasksConfigJSON['
|
|
31
|
-
compType =
|
|
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');
|
|
@@ -54,8 +54,8 @@ describe(`createLib createAll list deleteVersion deleteLib: ${serverDir} - ${com
|
|
|
54
54
|
afterAll( async() => {
|
|
55
55
|
|
|
56
56
|
//restore
|
|
57
|
-
|
|
58
|
-
tasksConfigJSON['
|
|
57
|
+
isLibraryBasedCL = savedLibraryBased
|
|
58
|
+
tasksConfigJSON['libraryModeCL'] = isLibraryBasedCL;
|
|
59
59
|
|
|
60
60
|
fs.writeFileSync(tasksConfigDir, JSON.stringify(tasksConfigJSON, null, 4), { encoding: 'utf8' });
|
|
61
61
|
|
|
@@ -79,13 +79,13 @@ describe(`createLib createAll list deleteVersion deleteLib: ${serverDir} - ${com
|
|
|
79
79
|
});
|
|
80
80
|
|
|
81
81
|
|
|
82
|
-
it(`npm run createLib (other) - ${
|
|
82
|
+
it(`npm run createLib (other) - ${isLibraryBasedCL}`, async() => {
|
|
83
83
|
|
|
84
84
|
const script = `npm run createLib Other 0.0.1 N Original --prefix ../../..`;
|
|
85
|
-
const compConf = path.join("store", "Pega_Other","0.0.1
|
|
85
|
+
const compConf = path.join("store", "Pega_Other","0.0.1", "componentsconfig.json");
|
|
86
86
|
|
|
87
87
|
const { stdout, stderr } = await exec(script);
|
|
88
|
-
expect(stdout).toContain('Library Pega_Other/0.0.1
|
|
88
|
+
expect(stdout).toContain('Library Pega_Other/0.0.1 has been created!');
|
|
89
89
|
|
|
90
90
|
const doesExist = fs.existsSync(path.resolve('../../..', compConf));
|
|
91
91
|
|
|
@@ -93,13 +93,13 @@ describe(`createLib createAll list deleteVersion deleteLib: ${serverDir} - ${com
|
|
|
93
93
|
|
|
94
94
|
}, 30000);
|
|
95
95
|
|
|
96
|
-
it(`npm run createLib (DXIL) - ${
|
|
96
|
+
it(`npm run createLib (DXIL) - ${isLibraryBasedCL}`, async() => {
|
|
97
97
|
|
|
98
98
|
const script = `npm run createLib DXIL 0.0.1 N Original --prefix ../../..`;
|
|
99
|
-
const compConf = path.join("store", "Pega_DXIL","0.0.1
|
|
99
|
+
const compConf = path.join("store", "Pega_DXIL","0.0.1", "componentsconfig.json");
|
|
100
100
|
|
|
101
101
|
const { stdout, stderr } = await exec(script);
|
|
102
|
-
expect(stdout).toContain('Library Pega_DXIL/0.0.1
|
|
102
|
+
expect(stdout).toContain('Library Pega_DXIL/0.0.1 has been created!');
|
|
103
103
|
|
|
104
104
|
const doesExist = fs.existsSync(path.resolve('../../..', compConf));
|
|
105
105
|
|
|
@@ -223,10 +223,10 @@ describe(`createLib createAll list deleteVersion deleteLib: ${serverDir} - ${com
|
|
|
223
223
|
const assetFileData = fs.readFileSync(assetFilePath, { encoding: 'utf8' });
|
|
224
224
|
|
|
225
225
|
// so that we don't have to generate all new assets, change "version"
|
|
226
|
-
// from 0.0.1
|
|
226
|
+
// from 0.0.1 to 0.0.1 for now
|
|
227
227
|
if (file === "config.json") {
|
|
228
|
-
expect(componentFileData).toContain("0.0.1
|
|
229
|
-
// componentFileData = componentFileData.replace("0.0.1
|
|
228
|
+
expect(componentFileData).toContain("0.0.1");
|
|
229
|
+
// componentFileData = componentFileData.replace("0.0.1", "0.0.1");
|
|
230
230
|
}
|
|
231
231
|
|
|
232
232
|
expect(componentFileData).toEqual(assetFileData);
|
|
@@ -234,22 +234,22 @@ describe(`createLib createAll list deleteVersion deleteLib: ${serverDir} - ${com
|
|
|
234
234
|
});
|
|
235
235
|
}, 10000);
|
|
236
236
|
|
|
237
|
-
it(`npm run deleteLibVersion - ${
|
|
237
|
+
it(`npm run deleteLibVersion - ${isLibraryBasedCL}`, async() => {
|
|
238
238
|
|
|
239
239
|
// since only version, will delete the lib as well
|
|
240
240
|
|
|
241
|
-
const script = `npm run deleteLibVersion Pega_DXIL 0.0.1
|
|
241
|
+
const script = `npm run deleteLibVersion Pega_DXIL 0.0.1 Y --prefix ../../..`;
|
|
242
242
|
const { stdout, stderr } = await exec(script);
|
|
243
243
|
|
|
244
244
|
expect(stdout).toContain('Pega_DXIL is deleted from Local.');
|
|
245
|
-
expect(stdout).toContain('Switched to Pega_Other/0.0.1
|
|
245
|
+
expect(stdout).toContain('Switched to Pega_Other/0.0.1');
|
|
246
246
|
|
|
247
247
|
|
|
248
248
|
}, 50000);
|
|
249
249
|
|
|
250
|
-
it(`npm run deleteLib - ${
|
|
250
|
+
it(`npm run deleteLib - ${isLibraryBasedCL}`, async() => {
|
|
251
251
|
|
|
252
|
-
const script = `npm run deleteLib Pega_Other 0.0.1
|
|
252
|
+
const script = `npm run deleteLib Pega_Other 0.0.1 Y --prefix ../../..`;
|
|
253
253
|
const { stdout, stderr } = await exec(script);
|
|
254
254
|
|
|
255
255
|
expect(stdout).toContain('Pega_Other is deleted from Local.');
|