@sap-ux/create 0.8.92 → 0.9.0
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 +6 -0
- package/dist/cli/add/navigation-config.js +29 -5
- package/package.json +6 -5
package/README.md
CHANGED
|
@@ -119,6 +119,12 @@ Calling `sap-ux add smartlinks-config` adds a smartLinks configuration to a proj
|
|
|
119
119
|
sap-ux add smartlinks-config [path]
|
|
120
120
|
```
|
|
121
121
|
|
|
122
|
+
### add inbound-navigation
|
|
123
|
+
Calling `sap-ux add inbound-navigation` adds a Fiori Launchpad configuration to a project.
|
|
124
|
+
```sh
|
|
125
|
+
sap-ux add inbound-navigation [path]
|
|
126
|
+
```
|
|
127
|
+
|
|
122
128
|
### variants-config
|
|
123
129
|
Calling `sap-ux add variants-config` will add the necessary configuration to an existing yaml file and the script to package.json for variants creation. It will use the configuration from the yaml file passed by cli or default to `ui5.yaml`, as provided by the `fiori-tools-preview` or `preview-middleware`.
|
|
124
130
|
```sh
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addInboundNavigationConfigCommand = addInboundNavigationConfigCommand;
|
|
4
|
+
const mem_fs_editor_1 = require("mem-fs-editor");
|
|
5
|
+
const mem_fs_1 = require("mem-fs");
|
|
6
|
+
const flp_config_inquirer_1 = require("@sap-ux/flp-config-inquirer");
|
|
4
7
|
const app_config_writer_1 = require("@sap-ux/app-config-writer");
|
|
5
|
-
const
|
|
8
|
+
const common_1 = require("../../common");
|
|
6
9
|
const validation_1 = require("../../validation");
|
|
10
|
+
const tracing_1 = require("../../tracing");
|
|
7
11
|
/**
|
|
8
12
|
* Add the "add inbound-navigation" command to a passed command.
|
|
9
13
|
*
|
|
@@ -31,18 +35,38 @@ async function addInboundNavigationConfig(basePath, simulate) {
|
|
|
31
35
|
try {
|
|
32
36
|
logger.debug(`Called add inbound navigation-config for path '${basePath}', simulate is '${simulate}'`);
|
|
33
37
|
await (0, validation_1.validateBasePath)(basePath);
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
38
|
+
const fs = (0, mem_fs_editor_1.create)((0, mem_fs_1.create)());
|
|
39
|
+
const { manifest } = await (0, app_config_writer_1.readManifest)(basePath, fs);
|
|
40
|
+
const inbounds = manifest?.['sap.app']?.crossNavigation?.inbounds;
|
|
41
|
+
const config = await getUserConfig(inbounds);
|
|
42
|
+
if (!config) {
|
|
43
|
+
logger.info('User chose not to overwrite existing inbound navigation configuration.');
|
|
44
|
+
return;
|
|
37
45
|
}
|
|
38
|
-
await (0,
|
|
46
|
+
await (0, app_config_writer_1.generateInboundNavigationConfig)(basePath, config, true, fs);
|
|
39
47
|
if (!simulate) {
|
|
40
48
|
fs.commit(() => logger.info(`Inbound navigation configuration complete.`));
|
|
41
49
|
}
|
|
50
|
+
else {
|
|
51
|
+
await (0, tracing_1.traceChanges)(fs);
|
|
52
|
+
}
|
|
42
53
|
}
|
|
43
54
|
catch (error) {
|
|
44
55
|
logger.error(`Error while executing add inbound navigation configuration '${error.message}'`);
|
|
45
56
|
logger.debug(error);
|
|
46
57
|
}
|
|
47
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* Prompts the user for inbound navigation configuration.
|
|
61
|
+
*
|
|
62
|
+
* @param inbounds - The existing inbounds to avoid conflicts.
|
|
63
|
+
* @returns {Promise<FLPConfigAnswers | undefined>} The user-provided configuration or undefined if skipped.
|
|
64
|
+
*/
|
|
65
|
+
async function getUserConfig(inbounds) {
|
|
66
|
+
const config = await (0, common_1.promptYUIQuestions)(await (0, flp_config_inquirer_1.getPrompts)(Object.keys(inbounds ?? {})), false);
|
|
67
|
+
if (config?.subTitle === '') {
|
|
68
|
+
config.subTitle = undefined;
|
|
69
|
+
}
|
|
70
|
+
return config?.overwrite === false ? undefined : config;
|
|
71
|
+
}
|
|
48
72
|
//# sourceMappingURL=navigation-config.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.
|
|
4
|
+
"version": "0.9.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/SAP/open-ux-tools.git",
|
|
@@ -32,18 +32,19 @@
|
|
|
32
32
|
"prompts": "2.4.2",
|
|
33
33
|
"@sap-ux/abap-deploy-config-inquirer": "1.1.0",
|
|
34
34
|
"@sap-ux/abap-deploy-config-writer": "0.0.62",
|
|
35
|
-
"@sap-ux/adp-tooling": "0.12.
|
|
36
|
-
"@sap-ux/app-config-writer": "0.
|
|
35
|
+
"@sap-ux/adp-tooling": "0.12.85",
|
|
36
|
+
"@sap-ux/app-config-writer": "0.5.0",
|
|
37
37
|
"@sap-ux/cap-config-writer": "0.7.60",
|
|
38
38
|
"@sap-ux/cards-editor-config-writer": "0.4.7",
|
|
39
39
|
"@sap-ux/inquirer-common": "0.5.4",
|
|
40
40
|
"@sap-ux/logger": "0.6.0",
|
|
41
41
|
"@sap-ux/mockserver-config-writer": "0.6.7",
|
|
42
42
|
"@sap-ux/odata-service-writer": "0.23.3",
|
|
43
|
-
"@sap-ux/preview-middleware": "0.16.
|
|
43
|
+
"@sap-ux/preview-middleware": "0.16.131",
|
|
44
44
|
"@sap-ux/project-access": "1.28.7",
|
|
45
45
|
"@sap-ux/system-access": "0.5.19",
|
|
46
|
-
"@sap-ux/ui5-config": "0.25.2"
|
|
46
|
+
"@sap-ux/ui5-config": "0.25.2",
|
|
47
|
+
"@sap-ux/flp-config-inquirer": "0.1.0"
|
|
47
48
|
},
|
|
48
49
|
"devDependencies": {
|
|
49
50
|
"@types/diff": "5.0.9",
|