@sap-ux/generator-adp 0.9.31 → 0.9.32
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.
|
@@ -55,8 +55,10 @@ class AddAnnotationsToDataGenerator extends sub_gen_auth_base_1.default {
|
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
57
|
if (!this.answers.filePath) {
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
if (!this.isCFProject) {
|
|
59
|
+
const metadata = await this.manifestService.getDataSourceMetadata(this.answers.id);
|
|
60
|
+
changeData.annotation.namespaces = (0, odata_service_writer_1.getAnnotationNamespaces)({ metadata });
|
|
61
|
+
}
|
|
60
62
|
}
|
|
61
63
|
await (0, adp_tooling_1.generateChange)(this.projectPath, "appdescr_app_addAnnotationsToOData" /* ChangeType.ADD_ANNOTATIONS_TO_ODATA */, changeData, this.fs, (0, templates_1.getTemplatesOverwritePath)());
|
|
62
64
|
this.logger.log('Change written to changes folder');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Manifest } from '@sap-ux/project-access';
|
|
2
2
|
import { type AbapTarget } from '@sap-ux/system-access';
|
|
3
|
-
import type { DescriptorVariant } from '@sap-ux/adp-tooling';
|
|
4
|
-
import {
|
|
3
|
+
import type { DescriptorVariant, IManifestService } from '@sap-ux/adp-tooling';
|
|
4
|
+
import { SystemLookup } from '@sap-ux/adp-tooling';
|
|
5
5
|
import SubGeneratorBase from './sub-gen-base';
|
|
6
6
|
import type { GeneratorOpts } from '../utils/opts';
|
|
7
7
|
import type { GeneratorTypes } from '../types';
|
|
@@ -27,9 +27,9 @@ export default class SubGeneratorWithAuthBase extends SubGeneratorBase {
|
|
|
27
27
|
*/
|
|
28
28
|
protected readonly generatorType: GeneratorTypes;
|
|
29
29
|
/**
|
|
30
|
-
* The manifest service.
|
|
30
|
+
* The manifest service (ABAP or CF).
|
|
31
31
|
*/
|
|
32
|
-
manifestService:
|
|
32
|
+
manifestService: IManifestService;
|
|
33
33
|
/**
|
|
34
34
|
* Whether the generator requires authentication.
|
|
35
35
|
*/
|
|
@@ -42,6 +42,10 @@ export default class SubGeneratorWithAuthBase extends SubGeneratorBase {
|
|
|
42
42
|
* The system lookup instance.
|
|
43
43
|
*/
|
|
44
44
|
protected systemLookup: SystemLookup;
|
|
45
|
+
/**
|
|
46
|
+
* Whether this is a CF project.
|
|
47
|
+
*/
|
|
48
|
+
protected isCFProject: boolean;
|
|
45
49
|
/**
|
|
46
50
|
* The VSCode instance.
|
|
47
51
|
*/
|
|
@@ -61,7 +65,8 @@ export default class SubGeneratorWithAuthBase extends SubGeneratorBase {
|
|
|
61
65
|
protected onInit(): Promise<void>;
|
|
62
66
|
/**
|
|
63
67
|
* Retrieves and parses the manifest (app descriptor) of the current project.
|
|
64
|
-
*
|
|
68
|
+
* For CF projects, builds the project and reads the manifest from the dist folder.
|
|
69
|
+
* For ABAP projects, fetches the merged manifest via the ABAP service provider.
|
|
65
70
|
*
|
|
66
71
|
* @returns {Promise<Manifest>} The manifest.
|
|
67
72
|
*/
|
|
@@ -34,7 +34,7 @@ class SubGeneratorWithAuthBase extends sub_gen_base_1.default {
|
|
|
34
34
|
*/
|
|
35
35
|
generatorType;
|
|
36
36
|
/**
|
|
37
|
-
* The manifest service.
|
|
37
|
+
* The manifest service (ABAP or CF).
|
|
38
38
|
*/
|
|
39
39
|
manifestService;
|
|
40
40
|
/**
|
|
@@ -49,6 +49,10 @@ class SubGeneratorWithAuthBase extends sub_gen_base_1.default {
|
|
|
49
49
|
* The system lookup instance.
|
|
50
50
|
*/
|
|
51
51
|
systemLookup;
|
|
52
|
+
/**
|
|
53
|
+
* Whether this is a CF project.
|
|
54
|
+
*/
|
|
55
|
+
isCFProject = false;
|
|
52
56
|
/**
|
|
53
57
|
* The VSCode instance.
|
|
54
58
|
*/
|
|
@@ -75,6 +79,14 @@ class SubGeneratorWithAuthBase extends sub_gen_base_1.default {
|
|
|
75
79
|
async onInit() {
|
|
76
80
|
await (0, i18n_1.initI18n)();
|
|
77
81
|
this.systemLookup = new adp_tooling_1.SystemLookup(this.logger);
|
|
82
|
+
this.isCFProject = await (0, adp_tooling_1.isCFEnvironment)(this.projectPath);
|
|
83
|
+
if (this.isCFProject) {
|
|
84
|
+
this.system = '';
|
|
85
|
+
this.logger.log('CF project detected, will use build output for manifest');
|
|
86
|
+
this._registerPrompts(new yeoman_ui_types_1.Prompts((0, steps_1.getSubGenAuthPages)(this.generatorType, this.system)));
|
|
87
|
+
this.prompts.splice(0, 1, []);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
78
90
|
const adpConfig = await (0, adp_tooling_1.getAdpConfig)(this.projectPath, node_path_1.default.join(this.projectPath, 'ui5.yaml'));
|
|
79
91
|
this.abapTarget = adpConfig.target;
|
|
80
92
|
this.system = ((0, btp_utils_1.isAppStudio)() ? this.abapTarget.destination : this.abapTarget.url) ?? '';
|
|
@@ -94,21 +106,27 @@ class SubGeneratorWithAuthBase extends sub_gen_base_1.default {
|
|
|
94
106
|
}
|
|
95
107
|
/**
|
|
96
108
|
* Retrieves and parses the manifest (app descriptor) of the current project.
|
|
97
|
-
*
|
|
109
|
+
* For CF projects, builds the project and reads the manifest from the dist folder.
|
|
110
|
+
* For ABAP projects, fetches the merged manifest via the ABAP service provider.
|
|
98
111
|
*
|
|
99
112
|
* @returns {Promise<Manifest>} The manifest.
|
|
100
113
|
*/
|
|
101
114
|
async getManifest() {
|
|
102
|
-
let requestOptions;
|
|
103
|
-
if (this.requiresAuth) {
|
|
104
|
-
const credentials = (await this.prompt((0, credentials_1.getCredentialsPrompts)(this.abapTarget, this.logger)));
|
|
105
|
-
requestOptions = { auth: { username: credentials.username, password: credentials.password } };
|
|
106
|
-
}
|
|
107
115
|
this.variant = await (0, adp_tooling_1.getVariant)(this.projectPath);
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
116
|
+
if (this.isCFProject) {
|
|
117
|
+
this.manifestService = await adp_tooling_1.ManifestServiceCF.init(this.projectPath, this.logger);
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
let requestOptions;
|
|
121
|
+
if (this.requiresAuth) {
|
|
122
|
+
const credentials = (await this.prompt((0, credentials_1.getCredentialsPrompts)(this.abapTarget, this.logger)));
|
|
123
|
+
requestOptions = { auth: { username: credentials.username, password: credentials.password } };
|
|
124
|
+
}
|
|
125
|
+
const yamlPath = node_path_1.default.join(this.projectPath, 'ui5.yaml');
|
|
126
|
+
const { target, ignoreCertErrors = false } = await (0, adp_tooling_1.getAdpConfig)(this.projectPath, yamlPath);
|
|
127
|
+
const provider = await (0, system_access_1.createAbapServiceProvider)(target, { ...requestOptions, ignoreCertErrors }, true, this.logger);
|
|
128
|
+
this.manifestService = await adp_tooling_1.ManifestService.initMergedManifest(provider, this.projectPath, this.variant, this.logger);
|
|
129
|
+
}
|
|
112
130
|
const manifest = this.manifestService.getManifest();
|
|
113
131
|
const oDataSources = this.manifestService.getManifestDataSources();
|
|
114
132
|
this.logger.log(`OData sources from manifest\n${JSON.stringify(oDataSources, null, 2)}`);
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"displayName": "SAPUI5 Adaptation Project",
|
|
4
4
|
"homepage": "https://help.sap.com/viewer/584e0bcbfd4a4aff91c815cefa0bce2d/Cloud/en-US/ada9567b767941aba8d49fdb4fdedea7.html",
|
|
5
5
|
"description": "Adaptation project allows you to create an app variant for an existing SAP Fiori elements-based or SAPUI5 freestyle application, without changing the original application.",
|
|
6
|
-
"version": "0.9.
|
|
6
|
+
"version": "0.9.32",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "https://github.com/SAP/open-ux-tools.git",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"i18next": "25.8.18",
|
|
31
31
|
"yeoman-generator": "5.10.0",
|
|
32
32
|
"uuid": "11.1.0",
|
|
33
|
-
"@sap-ux/adp-tooling": "0.18.
|
|
33
|
+
"@sap-ux/adp-tooling": "0.18.95",
|
|
34
34
|
"@sap-ux/axios-extension": "1.25.24",
|
|
35
35
|
"@sap-ux/btp-utils": "1.1.10",
|
|
36
36
|
"@sap-ux/feature-toggle": "0.3.7",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"fs-extra": "11.3.4",
|
|
58
58
|
"rimraf": "6.1.3",
|
|
59
59
|
"yeoman-test": "6.3.0",
|
|
60
|
-
"@sap-ux/deploy-config-sub-generator": "0.5.
|
|
60
|
+
"@sap-ux/deploy-config-sub-generator": "0.5.114"
|
|
61
61
|
},
|
|
62
62
|
"engines": {
|
|
63
63
|
"node": ">=20.x"
|