@squiz/dxp-cli-next 5.17.0-develop.2 → 5.17.0-develop.3
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/README.md +3 -1
- package/lib/__tests__/integration/main.spec.js +16 -0
- package/lib/dxp.js +5 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,5 +25,7 @@ Commands:
|
|
|
25
25
|
job-runner Job Runner Service Commands
|
|
26
26
|
datastore Datastore Service Commands
|
|
27
27
|
cdp Customer Data Platform Service Commands
|
|
28
|
-
porter Porter Service Commands
|
|
29
28
|
```
|
|
29
|
+
|
|
30
|
+
<!-- TODO: porter command is hidden behind feature flag -->
|
|
31
|
+
<!-- porter Porter Service Commands -->
|
|
@@ -9,6 +9,22 @@ describe('dxp', () => {
|
|
|
9
9
|
it('should show all available commands', () => {
|
|
10
10
|
var _a;
|
|
11
11
|
const { stdout } = (0, helpers_1.runCLI)(process.cwd(), ['--help']);
|
|
12
|
+
const commandsText = (_a = stdout
|
|
13
|
+
.match(/Commands\:(.*)/is)) === null || _a === void 0 ? void 0 : _a[1].split('\n').map(a => a.trim()).filter(a => !!a);
|
|
14
|
+
expect(commandsText).toEqual([
|
|
15
|
+
'auth Authenticate into the DXP-Next CLI',
|
|
16
|
+
'cmp Component Service Commands',
|
|
17
|
+
'job-runner Job Runner Service Commands',
|
|
18
|
+
'datastore Datastore Service Commands',
|
|
19
|
+
'cdp Customer Data Platform Service Commands',
|
|
20
|
+
// TODO: Porter is hidden behind feature flag.
|
|
21
|
+
// 'porter Porter Service Commands',
|
|
22
|
+
]);
|
|
23
|
+
});
|
|
24
|
+
it('if ENABLE_PORTER set to true, porter command should be visible', () => {
|
|
25
|
+
var _a;
|
|
26
|
+
process.env.ENABLE_PORTER = 'true';
|
|
27
|
+
const { stdout } = (0, helpers_1.runCLI)(process.cwd(), ['--help']);
|
|
12
28
|
const commandsText = (_a = stdout
|
|
13
29
|
.match(/Commands\:(.*)/is)) === null || _a === void 0 ? void 0 : _a[1].split('\n').map(a => a.trim()).filter(a => !!a);
|
|
14
30
|
expect(commandsText).toEqual([
|
package/lib/dxp.js
CHANGED
|
@@ -28,8 +28,11 @@ program
|
|
|
28
28
|
.addCommand(cmp_1.default)
|
|
29
29
|
.addCommand(job_runner_1.default)
|
|
30
30
|
.addCommand(datastore_1.default)
|
|
31
|
-
.addCommand(cdp_1.default)
|
|
32
|
-
|
|
31
|
+
.addCommand(cdp_1.default);
|
|
32
|
+
if (process.env.ENABLE_PORTER === 'true') {
|
|
33
|
+
program.addCommand(porter_1.default);
|
|
34
|
+
}
|
|
35
|
+
program
|
|
33
36
|
.action(() => {
|
|
34
37
|
program.help();
|
|
35
38
|
})
|