@sap-ux/create 0.7.26 → 0.7.28
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 +7 -0
- package/dist/cli/change/change-inbound.d.ts +8 -0
- package/dist/cli/change/change-inbound.js +56 -0
- package/dist/cli/change/index.js +2 -0
- package/dist/validation/index.d.ts +1 -1
- package/dist/validation/index.js +3 -1
- package/dist/validation/validation.d.ts +6 -0
- package/dist/validation/validation.js +14 -2
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -42,6 +42,13 @@ sap-ux change data-source /path/to/adaptation-project
|
|
|
42
42
|
```
|
|
43
43
|
If the project path is not provided, the current working directory will be used.
|
|
44
44
|
|
|
45
|
+
### inbound
|
|
46
|
+
Calling `sap-ux change inbound` allows replacing the Inbound FLP configurations of the base application in an adaptation project.
|
|
47
|
+
```sh
|
|
48
|
+
sap-ux change inbound /path/to/adaptation-project
|
|
49
|
+
```
|
|
50
|
+
If the project path is not provided, the current working directory will be used.
|
|
51
|
+
|
|
45
52
|
## remove
|
|
46
53
|
Calling `sap-ux remove` allows removing a feature to a project.
|
|
47
54
|
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Command } from 'commander';
|
|
2
|
+
/**
|
|
3
|
+
* Add a new sub-command to change the inbound of an adaptation project to the given command.
|
|
4
|
+
*
|
|
5
|
+
* @param {Command} cmd - The command to add the change inbound sub-command to.
|
|
6
|
+
*/
|
|
7
|
+
export declare function addChangeInboundCommand(cmd: Command): void;
|
|
8
|
+
//# sourceMappingURL=change-inbound.d.ts.map
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addChangeInboundCommand = void 0;
|
|
4
|
+
const tracing_1 = require("../../tracing");
|
|
5
|
+
const adp_tooling_1 = require("@sap-ux/adp-tooling");
|
|
6
|
+
const common_1 = require("../../common");
|
|
7
|
+
const validation_1 = require("../../validation");
|
|
8
|
+
/**
|
|
9
|
+
* Add a new sub-command to change the inbound of an adaptation project to the given command.
|
|
10
|
+
*
|
|
11
|
+
* @param {Command} cmd - The command to add the change inbound sub-command to.
|
|
12
|
+
*/
|
|
13
|
+
function addChangeInboundCommand(cmd) {
|
|
14
|
+
cmd.command('inbound [path]')
|
|
15
|
+
.option('-s, --simulate', 'simulate only do not write or install')
|
|
16
|
+
.action(async (path, options) => {
|
|
17
|
+
await changeInbound(path, !!options.simulate);
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
exports.addChangeInboundCommand = addChangeInboundCommand;
|
|
21
|
+
/**
|
|
22
|
+
* Changes the data source of an adaptation project.
|
|
23
|
+
*
|
|
24
|
+
* @param {string} basePath - The path to the adaptation project.
|
|
25
|
+
* @param {boolean} simulate - If set to true, then no files will be written to the filesystem.
|
|
26
|
+
*/
|
|
27
|
+
async function changeInbound(basePath, simulate) {
|
|
28
|
+
const logger = (0, tracing_1.getLogger)();
|
|
29
|
+
try {
|
|
30
|
+
if (!basePath) {
|
|
31
|
+
basePath = process.cwd();
|
|
32
|
+
}
|
|
33
|
+
await (0, validation_1.validateAdpProject)(basePath);
|
|
34
|
+
(0, validation_1.validateCloudAdpProject)(basePath);
|
|
35
|
+
const variant = (0, adp_tooling_1.getVariant)(basePath);
|
|
36
|
+
const change = variant.content.find((change) => change.changeType === 'appdescr_app_removeAllInboundsExceptOne');
|
|
37
|
+
const inboundId = change?.content?.inboundId;
|
|
38
|
+
const answers = await (0, common_1.promptYUIQuestions)((0, adp_tooling_1.getPromptsForChangeInbound)(), false);
|
|
39
|
+
const fs = await (0, adp_tooling_1.generateChange)(basePath, "appdescr_app_changeInbound" /* ChangeType.CHANGE_INBOUND */, {
|
|
40
|
+
answers,
|
|
41
|
+
inboundId,
|
|
42
|
+
variant
|
|
43
|
+
});
|
|
44
|
+
if (!simulate) {
|
|
45
|
+
await new Promise((resolve) => fs.commit(resolve));
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
await (0, tracing_1.traceChanges)(fs);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
logger.error(error?.message);
|
|
53
|
+
logger.debug(error);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=change-inbound.js.map
|
package/dist/cli/change/index.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getChangeCommands = void 0;
|
|
4
4
|
const commander_1 = require("commander");
|
|
5
5
|
const change_data_source_1 = require("./change-data-source");
|
|
6
|
+
const change_inbound_1 = require("./change-inbound");
|
|
6
7
|
/**
|
|
7
8
|
* Return 'create-fiori change *' commands. Commands include also the handler action.
|
|
8
9
|
*
|
|
@@ -12,6 +13,7 @@ function getChangeCommands() {
|
|
|
12
13
|
const addCommands = new commander_1.Command('change');
|
|
13
14
|
// create-fiori change data-source
|
|
14
15
|
(0, change_data_source_1.addChangeDataSourceCommand)(addCommands);
|
|
16
|
+
(0, change_inbound_1.addChangeInboundCommand)(addCommands);
|
|
15
17
|
return addCommands;
|
|
16
18
|
}
|
|
17
19
|
exports.getChangeCommands = getChangeCommands;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { hasFileDeletes, validateBasePath } from './validation';
|
|
1
|
+
export { hasFileDeletes, validateBasePath, validateAdpProject, validateCloudAdpProject } from './validation';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/validation/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateBasePath = exports.hasFileDeletes = void 0;
|
|
3
|
+
exports.validateCloudAdpProject = exports.validateAdpProject = exports.validateBasePath = exports.hasFileDeletes = void 0;
|
|
4
4
|
var validation_1 = require("./validation");
|
|
5
5
|
Object.defineProperty(exports, "hasFileDeletes", { enumerable: true, get: function () { return validation_1.hasFileDeletes; } });
|
|
6
6
|
Object.defineProperty(exports, "validateBasePath", { enumerable: true, get: function () { return validation_1.validateBasePath; } });
|
|
7
|
+
Object.defineProperty(exports, "validateAdpProject", { enumerable: true, get: function () { return validation_1.validateAdpProject; } });
|
|
8
|
+
Object.defineProperty(exports, "validateCloudAdpProject", { enumerable: true, get: function () { return validation_1.validateCloudAdpProject; } });
|
|
7
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -19,4 +19,10 @@ export declare function hasFileDeletes(fs: Editor): boolean;
|
|
|
19
19
|
* @param basePath - path to the adaptation project
|
|
20
20
|
*/
|
|
21
21
|
export declare function validateAdpProject(basePath: string): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* Validate if adaptation project is cloud, throws an error if not.
|
|
24
|
+
*
|
|
25
|
+
* @param basePath - path to the adaptation project
|
|
26
|
+
*/
|
|
27
|
+
export declare function validateCloudAdpProject(basePath: string): void;
|
|
22
28
|
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateAdpProject = exports.hasFileDeletes = exports.validateBasePath = void 0;
|
|
3
|
+
exports.validateCloudAdpProject = exports.validateAdpProject = exports.hasFileDeletes = exports.validateBasePath = void 0;
|
|
4
|
+
const adp_tooling_1 = require("@sap-ux/adp-tooling");
|
|
4
5
|
const project_access_1 = require("@sap-ux/project-access");
|
|
5
6
|
const fs_1 = require("fs");
|
|
6
7
|
const path_1 = require("path");
|
|
7
|
-
const adp_tooling_1 = require("@sap-ux/adp-tooling");
|
|
8
8
|
/**
|
|
9
9
|
* Validate base path of app, throw error if file is missing.
|
|
10
10
|
*
|
|
@@ -48,4 +48,16 @@ async function validateAdpProject(basePath) {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
exports.validateAdpProject = validateAdpProject;
|
|
51
|
+
/**
|
|
52
|
+
* Validate if adaptation project is cloud, throws an error if not.
|
|
53
|
+
*
|
|
54
|
+
* @param basePath - path to the adaptation project
|
|
55
|
+
*/
|
|
56
|
+
function validateCloudAdpProject(basePath) {
|
|
57
|
+
const manifest = (0, adp_tooling_1.getVariant)(basePath);
|
|
58
|
+
if (!manifest?.content?.some((change) => change.changeType === 'appdescr_app_removeAllInboundsExceptOne')) {
|
|
59
|
+
throw new Error('This command can only be used for Cloud Adaptation Project.');
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.validateCloudAdpProject = validateCloudAdpProject;
|
|
51
63
|
//# sourceMappingURL=validation.js.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-ux/create",
|
|
3
3
|
"description": "SAP Fiori tools module to add or remove features",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.28",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/SAP/open-ux-tools.git",
|
|
@@ -30,14 +30,14 @@
|
|
|
30
30
|
"mem-fs": "2.1.0",
|
|
31
31
|
"mem-fs-editor": "9.4.0",
|
|
32
32
|
"prompts": "2.4.2",
|
|
33
|
-
"@sap-ux/adp-tooling": "0.12.
|
|
33
|
+
"@sap-ux/adp-tooling": "0.12.18",
|
|
34
34
|
"@sap-ux/app-config-writer": "0.4.12",
|
|
35
|
-
"@sap-ux/cap-config-writer": "0.7.
|
|
35
|
+
"@sap-ux/cap-config-writer": "0.7.5",
|
|
36
36
|
"@sap-ux/cards-editor-config-writer": "0.4.1",
|
|
37
37
|
"@sap-ux/inquirer-common": "0.4.2",
|
|
38
38
|
"@sap-ux/logger": "0.6.0",
|
|
39
39
|
"@sap-ux/mockserver-config-writer": "0.6.1",
|
|
40
|
-
"@sap-ux/preview-middleware": "0.16.
|
|
40
|
+
"@sap-ux/preview-middleware": "0.16.26",
|
|
41
41
|
"@sap-ux/project-access": "1.25.7",
|
|
42
42
|
"@sap-ux/system-access": "0.5.3",
|
|
43
43
|
"@sap-ux/ui5-config": "0.23.1"
|