@squiz/dxp-cli-next 5.15.0-develop.2 → 5.15.0-develop.4
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.
|
@@ -58,20 +58,19 @@ const createGetPortCommand = () => {
|
|
|
58
58
|
console.log(`Download report: ${reportLink}`);
|
|
59
59
|
console.log(`Download artifacts: ${artifactsLink}`);
|
|
60
60
|
console.log('');
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
const excludedStages = [
|
|
62
|
+
dxp_porter_shared_1.Stage.componentTransform,
|
|
63
|
+
dxp_porter_shared_1.Stage.designDedupe,
|
|
64
|
+
// Hide validation stage from user (PERSONIZE-771)
|
|
65
|
+
dxp_porter_shared_1.Stage.validation,
|
|
66
|
+
];
|
|
67
|
+
const stagesToLog = Object.values(dxp_porter_shared_1.Stage).filter(stage => !excludedStages.includes(stage));
|
|
68
|
+
for (const stage of stagesToLog) {
|
|
66
69
|
const stageString = stage.replace(/-/, ' ');
|
|
67
70
|
console.log(`Stage ${stageString} status: ${stages[stage].status}`);
|
|
68
71
|
}
|
|
69
72
|
console.log('');
|
|
70
|
-
for (const stage of
|
|
71
|
-
if (stage === dxp_porter_shared_1.Stage['component-transform'] ||
|
|
72
|
-
stage === dxp_porter_shared_1.Stage['design-dedupe']) {
|
|
73
|
-
continue;
|
|
74
|
-
}
|
|
73
|
+
for (const stage of stagesToLog) {
|
|
75
74
|
const stageString = stage.replace(/-/, ' ');
|
|
76
75
|
console.log(`Stage ${stageString} settings:`, stageSettings[stage]);
|
|
77
76
|
}
|
|
@@ -154,7 +154,8 @@ describe('getPort', () => {
|
|
|
154
154
|
'component-transform': { run: false },
|
|
155
155
|
'design-dedupe': { run: false },
|
|
156
156
|
'template-dedupe': { run: false },
|
|
157
|
-
validation
|
|
157
|
+
// Hide validation stage from user (PERSONIZE-771)
|
|
158
|
+
// validation: { run: false },
|
|
158
159
|
report: { run: false },
|
|
159
160
|
},
|
|
160
161
|
stages: {
|
|
@@ -163,7 +164,8 @@ describe('getPort', () => {
|
|
|
163
164
|
'component-transform': { status: dxp_porter_shared_1.PortStatus.skipped },
|
|
164
165
|
'design-dedupe': { status: dxp_porter_shared_1.PortStatus.skipped },
|
|
165
166
|
'template-dedupe': { status: dxp_porter_shared_1.PortStatus.skipped },
|
|
166
|
-
validation
|
|
167
|
+
// Hide validation stage from user (PERSONIZE-771)
|
|
168
|
+
// validation: { status: PortStatus.skipped },
|
|
167
169
|
report: { status: dxp_porter_shared_1.PortStatus.skipped },
|
|
168
170
|
},
|
|
169
171
|
status: mockStatus,
|
|
@@ -187,14 +189,23 @@ describe('getPort', () => {
|
|
|
187
189
|
expect(logSpy).toHaveBeenNthCalledWith(7, 'Stage crawl status: complete');
|
|
188
190
|
expect(logSpy).toHaveBeenNthCalledWith(8, 'Stage index status: skipped');
|
|
189
191
|
expect(logSpy).toHaveBeenNthCalledWith(9, 'Stage template dedupe status: skipped');
|
|
190
|
-
|
|
191
|
-
expect(logSpy).toHaveBeenNthCalledWith(
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
expect(logSpy).toHaveBeenNthCalledWith(
|
|
196
|
-
expect(logSpy).toHaveBeenNthCalledWith(
|
|
197
|
-
expect(logSpy).toHaveBeenNthCalledWith(
|
|
192
|
+
// Validation stage is not logged (PERSONIZE-771)
|
|
193
|
+
// expect(logSpy).toHaveBeenNthCalledWith(
|
|
194
|
+
// 10,
|
|
195
|
+
// 'Stage validation status: skipped'
|
|
196
|
+
// );
|
|
197
|
+
expect(logSpy).toHaveBeenNthCalledWith(10, 'Stage report status: skipped');
|
|
198
|
+
expect(logSpy).toHaveBeenNthCalledWith(11, '');
|
|
199
|
+
expect(logSpy).toHaveBeenNthCalledWith(12, 'Stage crawl settings:', mockGetResponse['stage-settings'].crawl);
|
|
200
|
+
expect(logSpy).toHaveBeenNthCalledWith(13, 'Stage index settings:', mockGetResponse['stage-settings'].index);
|
|
201
|
+
expect(logSpy).toHaveBeenNthCalledWith(14, 'Stage template dedupe settings:', mockGetResponse['stage-settings']['template-dedupe']);
|
|
202
|
+
// Validation stage is not logged (PERSONIZE-771)
|
|
203
|
+
// expect(logSpy).toHaveBeenNthCalledWith(
|
|
204
|
+
// 16,
|
|
205
|
+
// 'Stage validation settings:',
|
|
206
|
+
// mockGetResponse['stage-settings'].validation
|
|
207
|
+
// );
|
|
208
|
+
expect(logSpy).toHaveBeenNthCalledWith(15, 'Stage report settings:', mockGetResponse['stage-settings'].report);
|
|
198
209
|
}));
|
|
199
210
|
it('should successfully retrieve the port details and log this to the console with non-null links', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
200
211
|
const mockStatus = dxp_porter_shared_1.PortStatus.complete;
|
|
@@ -210,7 +221,8 @@ describe('getPort', () => {
|
|
|
210
221
|
'component-transform': { run: false },
|
|
211
222
|
'design-dedupe': { run: false },
|
|
212
223
|
'template-dedupe': { run: false },
|
|
213
|
-
validation
|
|
224
|
+
// Hide validation stage from user (PERSONIZE-771)
|
|
225
|
+
// validation: { run: false },
|
|
214
226
|
report: { run: false },
|
|
215
227
|
},
|
|
216
228
|
stages: {
|
|
@@ -219,7 +231,8 @@ describe('getPort', () => {
|
|
|
219
231
|
'component-transform': { status: dxp_porter_shared_1.PortStatus.skipped },
|
|
220
232
|
'design-dedupe': { status: dxp_porter_shared_1.PortStatus.skipped },
|
|
221
233
|
'template-dedupe': { status: dxp_porter_shared_1.PortStatus.skipped },
|
|
222
|
-
validation
|
|
234
|
+
// Hide validation stage from user (PERSONIZE-771)
|
|
235
|
+
// validation: { status: PortStatus.skipped },
|
|
223
236
|
report: { status: dxp_porter_shared_1.PortStatus.skipped },
|
|
224
237
|
},
|
|
225
238
|
status: mockStatus,
|
|
@@ -243,13 +256,22 @@ describe('getPort', () => {
|
|
|
243
256
|
expect(logSpy).toHaveBeenNthCalledWith(7, 'Stage crawl status: complete');
|
|
244
257
|
expect(logSpy).toHaveBeenNthCalledWith(8, 'Stage index status: skipped');
|
|
245
258
|
expect(logSpy).toHaveBeenNthCalledWith(9, 'Stage template dedupe status: skipped');
|
|
246
|
-
|
|
247
|
-
expect(logSpy).toHaveBeenNthCalledWith(
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
expect(logSpy).toHaveBeenNthCalledWith(
|
|
252
|
-
expect(logSpy).toHaveBeenNthCalledWith(
|
|
253
|
-
expect(logSpy).toHaveBeenNthCalledWith(
|
|
259
|
+
// Validation stage is not logged (PERSONIZE-771)
|
|
260
|
+
// expect(logSpy).toHaveBeenNthCalledWith(
|
|
261
|
+
// 10,
|
|
262
|
+
// 'Stage validation status: skipped'
|
|
263
|
+
// );
|
|
264
|
+
expect(logSpy).toHaveBeenNthCalledWith(10, 'Stage report status: skipped');
|
|
265
|
+
expect(logSpy).toHaveBeenNthCalledWith(11, '');
|
|
266
|
+
expect(logSpy).toHaveBeenNthCalledWith(12, 'Stage crawl settings:', mockGetResponse['stage-settings'].crawl);
|
|
267
|
+
expect(logSpy).toHaveBeenNthCalledWith(13, 'Stage index settings:', mockGetResponse['stage-settings'].index);
|
|
268
|
+
expect(logSpy).toHaveBeenNthCalledWith(14, 'Stage template dedupe settings:', mockGetResponse['stage-settings']['template-dedupe']);
|
|
269
|
+
// Validation stage is not logged (PERSONIZE-771)
|
|
270
|
+
// expect(logSpy).toHaveBeenNthCalledWith(
|
|
271
|
+
// 16,
|
|
272
|
+
// 'Stage validation settings:',
|
|
273
|
+
// mockGetResponse['stage-settings'].validation
|
|
274
|
+
// );
|
|
275
|
+
expect(logSpy).toHaveBeenNthCalledWith(15, 'Stage report settings:', mockGetResponse['stage-settings'].report);
|
|
254
276
|
}));
|
|
255
277
|
});
|
|
@@ -23,7 +23,12 @@ const dxp_porter_shared_1 = require("@squiz/dxp-porter-shared");
|
|
|
23
23
|
const constants_1 = require("../../constants");
|
|
24
24
|
const { version: cliVersion } = require('../../../../package.json');
|
|
25
25
|
const allPortStages = Object.values(dxp_porter_shared_1.Stage);
|
|
26
|
-
const
|
|
26
|
+
const stagesToSkip = [
|
|
27
|
+
dxp_porter_shared_1.Stage.componentTransform,
|
|
28
|
+
dxp_porter_shared_1.Stage.designDedupe,
|
|
29
|
+
dxp_porter_shared_1.Stage.validation,
|
|
30
|
+
];
|
|
31
|
+
const stageDirsToCreate = allPortStages.filter(stage => !stagesToSkip.includes(stage));
|
|
27
32
|
const createAddProjectCommand = () => {
|
|
28
33
|
const addCommand = new commander_1.Command('addProject')
|
|
29
34
|
.description('Adds a new project')
|
|
@@ -205,10 +205,12 @@ describe('addProject', () => {
|
|
|
205
205
|
expect(PorterUtils.buildPorterUrl).toHaveBeenCalled();
|
|
206
206
|
expect(PorterUtils.doesPathExist).toHaveBeenCalled();
|
|
207
207
|
expect(promises_1.default.access).toHaveBeenCalled();
|
|
208
|
-
// Create project dir, create "stage-configs" directory, create directories for (crawl, index, template-dedupe,
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
208
|
+
// Create project dir, create "stage-configs" directory, create directories for (crawl, index, template-dedupe, report)
|
|
209
|
+
// But validation stage is not created (PERSONIZE-771)
|
|
210
|
+
expect(promises_1.default.mkdir).toHaveBeenCalledTimes(6);
|
|
211
|
+
// Create project config.json as well as 4 example config.json (for each stage)
|
|
212
|
+
// But validation stage is not created (PERSONIZE-771)
|
|
213
|
+
expect(promises_1.default.writeFile).toHaveBeenCalledTimes(5);
|
|
212
214
|
expect(promises_1.default.writeFile).toHaveBeenNthCalledWith(1, expect.any(String), expect.stringContaining(mockCliVersion));
|
|
213
215
|
expect(mockClient.put).toHaveBeenCalled();
|
|
214
216
|
expect(promises_1.default.rm).toHaveBeenCalled();
|
|
@@ -233,9 +235,11 @@ describe('addProject', () => {
|
|
|
233
235
|
expect(PorterUtils.doesPathExist).toHaveBeenCalled();
|
|
234
236
|
expect(promises_1.default.access).toHaveBeenCalled();
|
|
235
237
|
// Create project dir, create "stage-configs" directory, create directories for (crawl, index, template-dedupe, validation, report)
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
238
|
+
// But validation stage is not created (PERSONIZE-771)
|
|
239
|
+
expect(promises_1.default.mkdir).toHaveBeenCalledTimes(6);
|
|
240
|
+
// Create project config.json as well as 4 example config.json (for each stage)
|
|
241
|
+
// But validation stage is not created (PERSONIZE-771)
|
|
242
|
+
expect(promises_1.default.writeFile).toHaveBeenCalledTimes(5);
|
|
239
243
|
expect(promises_1.default.writeFile).toHaveBeenNthCalledWith(1, expect.any(String), expect.stringContaining(mockCliVersion));
|
|
240
244
|
expect(mockClient.put).toHaveBeenCalled();
|
|
241
245
|
expect(PorterUtils.handleCommandError).not.toHaveBeenCalled();
|
|
@@ -258,9 +262,11 @@ describe('addProject', () => {
|
|
|
258
262
|
expect(PorterUtils.doesPathExist).toHaveBeenCalled();
|
|
259
263
|
expect(promises_1.default.access).toHaveBeenCalled();
|
|
260
264
|
// Create project dir, create "stage-configs" directory, create directories for (crawl, index, template-dedupe, validation, report)
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
265
|
+
// But validation stage is not created (PERSONIZE-771)
|
|
266
|
+
expect(promises_1.default.mkdir).toHaveBeenCalledTimes(6);
|
|
267
|
+
// Create project config.json as well as 4 example config.json (for each stage)
|
|
268
|
+
// But validation stage is not created (PERSONIZE-771)
|
|
269
|
+
expect(promises_1.default.writeFile).toHaveBeenCalledTimes(5);
|
|
264
270
|
expect(promises_1.default.writeFile).toHaveBeenNthCalledWith(1, expect.any(String), expect.stringContaining(mockCliVersion));
|
|
265
271
|
expect(mockClient.put).toHaveBeenCalled();
|
|
266
272
|
expect(promises_1.default.rm).not.toHaveBeenCalled();
|
|
@@ -11,8 +11,8 @@ const createProjectCommand = () => {
|
|
|
11
11
|
const projectCommand = new commander_1.Command('project');
|
|
12
12
|
projectCommand
|
|
13
13
|
.description('Porter project commands')
|
|
14
|
-
.addCommand((0, get_1.default)())
|
|
15
14
|
.addCommand((0, add_1.default)())
|
|
15
|
+
.addCommand((0, get_1.default)())
|
|
16
16
|
.addCommand((0, remove_1.default)());
|
|
17
17
|
return projectCommand;
|
|
18
18
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@squiz/dxp-cli-next",
|
|
3
|
-
"version": "5.15.0-develop.
|
|
3
|
+
"version": "5.15.0-develop.4",
|
|
4
4
|
"repository": {
|
|
5
5
|
"url": "https://gitlab.squiz.net/dxp/dxp-cli-next"
|
|
6
6
|
},
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@apidevtools/swagger-parser": "10.1.0",
|
|
43
43
|
"@squiz/component-cli-lib": "1.65.1",
|
|
44
|
-
"@squiz/dxp-porter-shared": "0.
|
|
44
|
+
"@squiz/dxp-porter-shared": "0.4.0",
|
|
45
45
|
"axios": "1.1.3",
|
|
46
46
|
"cli-color": "2.0.3",
|
|
47
47
|
"commander": "9.4.0",
|