@sap-ux/create 1.0.50 → 1.0.52
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { create as createStorage } from 'mem-fs';
|
|
2
2
|
import { create } from 'mem-fs-editor';
|
|
3
|
-
import { generateInboundConfig, getAdpConfig, getInboundsFromManifest, getVariant, getBaseAppInbounds, getCfBaseAppInbounds, isCFEnvironment, loadCfConfig, getAppParamsFromUI5Yaml } from '@sap-ux/adp-tooling';
|
|
3
|
+
import { generateInboundConfig, getAdpConfig, getInboundsFromManifest, getVariant, getBaseAppInbounds, getCfBaseAppInbounds, isCFEnvironment, loadCfConfig, getAppParamsFromUI5Yaml, getSystemUI5Version } from '@sap-ux/adp-tooling';
|
|
4
4
|
import { getPrompts, tileActions } from '@sap-ux/flp-config-inquirer';
|
|
5
5
|
import { FileName, getAppType } from '@sap-ux/project-access';
|
|
6
6
|
import { createAbapServiceProvider } from '@sap-ux/system-access';
|
|
@@ -54,11 +54,12 @@ async function addInboundNavigationConfig(basePath, simulate, yamlPath) {
|
|
|
54
54
|
variant = { isAdp: true, content: await getVariant(basePath, fs) };
|
|
55
55
|
}
|
|
56
56
|
const inbounds = await getInbounds(basePath, yamlPath, fs, logger, variant);
|
|
57
|
+
const { data: inboundData, systemUI5Version, isCfProject } = inbounds;
|
|
57
58
|
let tileSettingsAnswers;
|
|
58
|
-
if (
|
|
59
|
-
tileSettingsAnswers = await promptYUIQuestions(getTileSettingsQuestions(
|
|
59
|
+
if (inboundData && isAdp) {
|
|
60
|
+
tileSettingsAnswers = await promptYUIQuestions(getTileSettingsQuestions(inboundData), false);
|
|
60
61
|
}
|
|
61
|
-
const answers = await getUserAnswers(
|
|
62
|
+
const answers = await getUserAnswers(inboundData, isAdp, tileSettingsAnswers);
|
|
62
63
|
if (!answers && tileSettingsAnswers?.tileHandlingAction !== tileActions.REPLACE) {
|
|
63
64
|
logger.info('User chose not to overwrite existing inbound navigation configuration.');
|
|
64
65
|
return;
|
|
@@ -66,7 +67,7 @@ async function addInboundNavigationConfig(basePath, simulate, yamlPath) {
|
|
|
66
67
|
await generateConfig(basePath, {
|
|
67
68
|
flpConfigAnswers: answers,
|
|
68
69
|
tileSettingsAnswers
|
|
69
|
-
}, variant, fs,
|
|
70
|
+
}, variant, fs, inboundData, systemUI5Version, isCfProject);
|
|
70
71
|
if (!simulate) {
|
|
71
72
|
fs.commit(() => logger.info(`Inbound navigation configuration complete.`));
|
|
72
73
|
}
|
|
@@ -81,25 +82,31 @@ async function addInboundNavigationConfig(basePath, simulate, yamlPath) {
|
|
|
81
82
|
}
|
|
82
83
|
/**
|
|
83
84
|
* Retrieves the inbounds for the given project, handling both ADP and Fiori scenarios.
|
|
85
|
+
* For ABAP ADP projects also returns the system UI5 version to enable version-based change type selection.
|
|
84
86
|
*
|
|
85
87
|
* @param {string} basePath - The base path to the project.
|
|
86
88
|
* @param {string} yamlPath - The path to the project configuration file in YAML format.
|
|
87
89
|
* @param {Editor} fs - The mem-fs editor instance.
|
|
88
90
|
* @param {ToolsLogger} logger - The logger instance.
|
|
89
91
|
* @param {DescriptorVariant} [variant] - The descriptor variant, if applicable.
|
|
90
|
-
* @returns {Promise<
|
|
92
|
+
* @returns {Promise<{data, systemUI5Version, isCfProject}>} Inbounds plus optional version/CF context.
|
|
91
93
|
*/
|
|
92
94
|
async function getInbounds(basePath, yamlPath, fs, logger, variant) {
|
|
93
95
|
if (variant.isAdp) {
|
|
94
96
|
if (await isCFEnvironment(basePath)) {
|
|
95
|
-
|
|
97
|
+
const data = await getCfInbounds(basePath, variant.content, logger);
|
|
98
|
+
return { data, systemUI5Version: undefined, isCfProject: true };
|
|
96
99
|
}
|
|
97
100
|
const { target, ignoreCertErrors = false } = await getAdpConfig(basePath, yamlPath);
|
|
98
101
|
const provider = await createAbapServiceProvider(target, { ignoreCertErrors }, true, logger);
|
|
99
|
-
|
|
102
|
+
const [data, systemUI5Version] = await Promise.all([
|
|
103
|
+
getBaseAppInbounds(variant.content.reference, provider),
|
|
104
|
+
getSystemUI5Version(provider, logger)
|
|
105
|
+
]);
|
|
106
|
+
return { data, systemUI5Version, isCfProject: false };
|
|
100
107
|
}
|
|
101
108
|
const manifest = await retrieveManifest(basePath, fs);
|
|
102
|
-
return getInboundsFromManifest(manifest);
|
|
109
|
+
return { data: getInboundsFromManifest(manifest), systemUI5Version: undefined, isCfProject: false };
|
|
103
110
|
}
|
|
104
111
|
/**
|
|
105
112
|
* Retrieves the inbounds for a CF adaptation project using the FDC service.
|
|
@@ -169,13 +176,15 @@ async function getUserAnswers(inbounds, isAdp, tileSettingsAnswers) {
|
|
|
169
176
|
* @param {Variant} variant - The descriptor variant information.
|
|
170
177
|
* @param {Editor} fs - The mem-fs editor instance.
|
|
171
178
|
* @param {ManifestNamespace.Inbound} [inbounds] - Base application inbounds
|
|
179
|
+
* @param {string} [systemUI5Version] - System UI5 version, used to select change type for ABAP projects.
|
|
180
|
+
* @param {boolean} [isCfProject] - Whether this is a CF adaptation project.
|
|
172
181
|
* @returns {Promise<void>} A promise that resolves when the configuration is generated.
|
|
173
182
|
*/
|
|
174
|
-
async function generateConfig(basePath, answers, variant, fs, inbounds) {
|
|
183
|
+
async function generateConfig(basePath, answers, variant, fs, inbounds, systemUI5Version, isCfProject = false) {
|
|
175
184
|
const { flpConfigAnswers, tileSettingsAnswers } = answers;
|
|
176
185
|
if (variant.isAdp) {
|
|
177
186
|
const config = getAdpFlpInboundsWriterConfig(flpConfigAnswers, variant.content.layer, tileSettingsAnswers, inbounds);
|
|
178
|
-
await generateInboundConfig(basePath, config, fs);
|
|
187
|
+
await generateInboundConfig(basePath, config, fs, systemUI5Version, isCfProject);
|
|
179
188
|
}
|
|
180
189
|
else {
|
|
181
190
|
await generateInboundNavigationConfig(basePath, flpConfigAnswers, true, fs);
|
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": "1.0.
|
|
4
|
+
"version": "1.0.52",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/SAP/open-ux-tools.git",
|
|
@@ -35,19 +35,19 @@
|
|
|
35
35
|
"prompts": "2.4.2",
|
|
36
36
|
"@sap-ux/abap-deploy-config-inquirer": "2.0.24",
|
|
37
37
|
"@sap-ux/abap-deploy-config-writer": "1.0.14",
|
|
38
|
-
"@sap-ux/adp-tooling": "1.0.
|
|
38
|
+
"@sap-ux/adp-tooling": "1.0.30",
|
|
39
39
|
"@sap-ux/btp-utils": "2.0.5",
|
|
40
|
-
"@sap-ux/app-config-writer": "1.1.
|
|
40
|
+
"@sap-ux/app-config-writer": "1.1.9",
|
|
41
41
|
"@sap-ux/cap-config-writer": "1.0.20",
|
|
42
42
|
"@sap-ux/logger": "1.0.3",
|
|
43
43
|
"@sap-ux/mockserver-config-writer": "1.0.10",
|
|
44
44
|
"@sap-ux/odata-service-writer": "1.0.12",
|
|
45
|
-
"@sap-ux/preview-middleware": "1.0.
|
|
45
|
+
"@sap-ux/preview-middleware": "1.0.39",
|
|
46
46
|
"@sap-ux/project-access": "2.1.6",
|
|
47
47
|
"@sap-ux/system-access": "1.0.7",
|
|
48
48
|
"@sap-ux/store": "2.0.4",
|
|
49
49
|
"@sap-ux/ui5-config": "1.0.5",
|
|
50
|
-
"@sap-ux/flp-config-inquirer": "1.0.
|
|
50
|
+
"@sap-ux/flp-config-inquirer": "1.0.30",
|
|
51
51
|
"@sap-ux/nodejs-utils": "1.0.7",
|
|
52
52
|
"@sap-ux/axios-extension": "2.0.7"
|
|
53
53
|
},
|