@sap-ux/generator-adp 0.2.2 → 0.2.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/generators/app/index.d.ts +4 -0
- package/generators/app/index.js +9 -1
- package/generators/app/questions/configuration.d.ts +4 -0
- package/generators/app/questions/configuration.js +10 -4
- package/generators/app/questions/helper/message.d.ts +2 -1
- package/generators/app/questions/helper/message.js +6 -1
- package/generators/translations/generator-adp.i18n.json +3 -2
- package/package.json +2 -2
package/generators/app/index.js
CHANGED
|
@@ -7,9 +7,9 @@ const path_1 = require("path");
|
|
|
7
7
|
const yeoman_generator_1 = __importDefault(require("yeoman-generator"));
|
|
8
8
|
const yeoman_ui_types_1 = require("@sap-devx/yeoman-ui-types");
|
|
9
9
|
const adp_tooling_1 = require("@sap-ux/adp-tooling");
|
|
10
|
-
const feature_toggle_1 = require("@sap-ux/feature-toggle");
|
|
11
10
|
const fiori_generator_shared_1 = require("@sap-ux/fiori-generator-shared");
|
|
12
11
|
const logger_1 = require("@sap-ux/logger");
|
|
12
|
+
const feature_toggle_1 = require("@sap-ux/feature-toggle");
|
|
13
13
|
const layer_1 = require("./layer");
|
|
14
14
|
const i18n_1 = require("../utils/i18n");
|
|
15
15
|
const telemetryEvents_1 = require("../telemetryEvents");
|
|
@@ -72,6 +72,10 @@ class default_1 extends yeoman_generator_1.default {
|
|
|
72
72
|
* Instance of AbapServiceProvider.
|
|
73
73
|
*/
|
|
74
74
|
abapProvider;
|
|
75
|
+
/**
|
|
76
|
+
* Application manifest.
|
|
77
|
+
*/
|
|
78
|
+
manifest;
|
|
75
79
|
/**
|
|
76
80
|
* Publicly available UI5 versions.
|
|
77
81
|
*/
|
|
@@ -162,6 +166,7 @@ class default_1 extends yeoman_generator_1.default {
|
|
|
162
166
|
}
|
|
163
167
|
const provider = this.jsonInput ? this.abapProvider : this.prompter.provider;
|
|
164
168
|
const publicVersions = this.jsonInput ? this.publicVersions : this.prompter.ui5.publicVersions;
|
|
169
|
+
const manifest = this.jsonInput ? this.manifest : this.prompter.manifest;
|
|
165
170
|
const packageJson = (0, deps_1.getPackageInfo)();
|
|
166
171
|
const config = await (0, adp_tooling_1.getConfig)({
|
|
167
172
|
provider,
|
|
@@ -169,6 +174,7 @@ class default_1 extends yeoman_generator_1.default {
|
|
|
169
174
|
attributeAnswers: this.attributeAnswers,
|
|
170
175
|
systemVersion: this.prompter?.ui5?.systemVersion,
|
|
171
176
|
publicVersions,
|
|
177
|
+
manifest,
|
|
172
178
|
layer: this.layer,
|
|
173
179
|
packageJson,
|
|
174
180
|
logger: this.toolsLogger
|
|
@@ -279,6 +285,8 @@ class default_1 extends yeoman_generator_1.default {
|
|
|
279
285
|
if (!application) {
|
|
280
286
|
throw new Error((0, i18n_1.t)('error.applicationNotFound', { appName: baseApplicationName }));
|
|
281
287
|
}
|
|
288
|
+
const sourceManifest = new adp_tooling_1.SourceManifest(this.abapProvider, application.id);
|
|
289
|
+
this.manifest = await sourceManifest.getManifest();
|
|
282
290
|
this.configAnswers = {
|
|
283
291
|
system,
|
|
284
292
|
username,
|
|
@@ -47,6 +47,10 @@ export declare class ConfigPrompter {
|
|
|
47
47
|
* Flag indicating whether the selected application is supported.
|
|
48
48
|
*/
|
|
49
49
|
private isApplicationSupported;
|
|
50
|
+
/**
|
|
51
|
+
* Error message to be shown in the confirm extension project prompt.
|
|
52
|
+
*/
|
|
53
|
+
private appValidationErrorMessage;
|
|
50
54
|
/**
|
|
51
55
|
* Indicates whether views are loaded synchronously.
|
|
52
56
|
*/
|
|
@@ -55,6 +55,10 @@ class ConfigPrompter {
|
|
|
55
55
|
* Flag indicating whether the selected application is supported.
|
|
56
56
|
*/
|
|
57
57
|
isApplicationSupported;
|
|
58
|
+
/**
|
|
59
|
+
* Error message to be shown in the confirm extension project prompt.
|
|
60
|
+
*/
|
|
61
|
+
appValidationErrorMessage;
|
|
58
62
|
/**
|
|
59
63
|
* Indicates whether views are loaded synchronously.
|
|
60
64
|
*/
|
|
@@ -363,7 +367,7 @@ class ConfigPrompter {
|
|
|
363
367
|
return {
|
|
364
368
|
type: 'confirm',
|
|
365
369
|
name: types_1.configPromptNames.shouldCreateExtProject,
|
|
366
|
-
message: () => (0, message_1.getExtProjectMessage)(this.isApplicationSupported, this.containsSyncViews),
|
|
370
|
+
message: () => (0, message_1.getExtProjectMessage)(this.isApplicationSupported, this.containsSyncViews, this.appValidationErrorMessage),
|
|
367
371
|
default: false,
|
|
368
372
|
guiOptions: {
|
|
369
373
|
applyDefaultWhenDirty: true
|
|
@@ -388,9 +392,11 @@ class ConfigPrompter {
|
|
|
388
392
|
if (!(0, btp_utils_1.isAppStudio)()) {
|
|
389
393
|
return validationResult;
|
|
390
394
|
}
|
|
391
|
-
|
|
392
|
-
validationResult === (0, i18n_1.t)('error.
|
|
395
|
+
const isKnownUnsupported = validationResult === (0, i18n_1.t)('error.appDoesNotSupportManifest') ||
|
|
396
|
+
validationResult === (0, i18n_1.t)('error.appDoesNotSupportFlexibility');
|
|
397
|
+
if (isKnownUnsupported) {
|
|
393
398
|
this.logger.error(validationResult);
|
|
399
|
+
this.appValidationErrorMessage = validationResult;
|
|
394
400
|
this.isApplicationSupported = false;
|
|
395
401
|
return true;
|
|
396
402
|
}
|
|
@@ -573,7 +579,7 @@ class ConfigPrompter {
|
|
|
573
579
|
}
|
|
574
580
|
const ui5 = this.appManifest?.['sap.ui5'];
|
|
575
581
|
if (ui5?.flexEnabled === false) {
|
|
576
|
-
throw new Error((0, i18n_1.t)('error.
|
|
582
|
+
throw new Error((0, i18n_1.t)('error.appDoesNotSupportFlexibility'));
|
|
577
583
|
}
|
|
578
584
|
}
|
|
579
585
|
/**
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @param {boolean} isApplicationSupported - Whether the selected application is supported.
|
|
5
5
|
* @param {boolean} hasSyncViews - Whether synchronized views exist for the app.
|
|
6
|
+
* @param {string} [errorMessage] - Optional validation error message (only used in BAS).
|
|
6
7
|
* @returns {string} A message for confirm extension project prompt.
|
|
7
8
|
*/
|
|
8
|
-
export declare const getExtProjectMessage: (isApplicationSupported: boolean, hasSyncViews: boolean) => string;
|
|
9
|
+
export declare const getExtProjectMessage: (isApplicationSupported: boolean, hasSyncViews: boolean, errorMessage?: string) => string;
|
|
9
10
|
//# sourceMappingURL=message.d.ts.map
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getExtProjectMessage = void 0;
|
|
4
|
+
const btp_utils_1 = require("@sap-ux/btp-utils");
|
|
4
5
|
const i18n_1 = require("../../../utils/i18n");
|
|
5
6
|
/**
|
|
6
7
|
* Creates a message for extension project prompt based on the provided parameters.
|
|
7
8
|
*
|
|
8
9
|
* @param {boolean} isApplicationSupported - Whether the selected application is supported.
|
|
9
10
|
* @param {boolean} hasSyncViews - Whether synchronized views exist for the app.
|
|
11
|
+
* @param {string} [errorMessage] - Optional validation error message (only used in BAS).
|
|
10
12
|
* @returns {string} A message for confirm extension project prompt.
|
|
11
13
|
*/
|
|
12
|
-
const getExtProjectMessage = (isApplicationSupported, hasSyncViews) => {
|
|
14
|
+
const getExtProjectMessage = (isApplicationSupported, hasSyncViews, errorMessage) => {
|
|
15
|
+
if ((0, btp_utils_1.isAppStudio)() && errorMessage) {
|
|
16
|
+
return `${errorMessage} ${(0, i18n_1.t)('prompts.extProjectSuggestion')}`;
|
|
17
|
+
}
|
|
13
18
|
return isApplicationSupported && hasSyncViews
|
|
14
19
|
? (0, i18n_1.t)('prompts.createExtProjectWithSyncViewsLabel')
|
|
15
20
|
: (0, i18n_1.t)('prompts.createExtProjectLabel');
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"achLabel": "Application Component Hierarchy",
|
|
20
20
|
"achHint": "The purpose of ACH components is to enable the support organization to indicate which BCP/ticket component might be responsible for a particular issue.",
|
|
21
21
|
"createExtProjectLabel": "The selected application is not supported by the SAPUI5 Adaptation Project. For more information, see SAPUI5 Adaptation Project documentation. Do you want to create an extension project instead?",
|
|
22
|
+
"extProjectSuggestion": "Do you want to create an extension project instead?",
|
|
22
23
|
"createExtProjectWithSyncViewsLabel": "Do you want to create an extension project instead? An extension project gives you the ability to create controller extensions for synchronous and asynchronous views.",
|
|
23
24
|
"createExtProjectContinueLabel": "Please select whether you want to continue.",
|
|
24
25
|
"projectTypeLabel": "Project Type",
|
|
@@ -51,8 +52,8 @@
|
|
|
51
52
|
"notDeployableSystemError": "The system that you have selected is not an ABAP On-Premise system which supports DTA_FOLDER deployment. Adaptation projects are only supported on those systems. Please choose an ABAP On-Premise system which supports DTA_FOLDER deployment.",
|
|
52
53
|
"notFlexEnabledError": "The system that you have selected is not an ABAP On-Premise system which supports flexibility. Adaptation projects are only supported on those systems. Please choose an ABAP On-Premise system which supports flexibility. If you continue, you will only be able to create an extension project.",
|
|
53
54
|
"manifestCouldNotBeValidated": "The manifest.json file of the selected application could not be validated. Please select a different application.",
|
|
54
|
-
"
|
|
55
|
-
"appDoesNotSupportManifest": "The selected application is not supported by
|
|
55
|
+
"appDoesNotSupportFlexibility": "The selected application does not support flexibility as it has (`flexEnabled=false`). SAPUI5 Adaptation Project only supports applications that support flexibility. Please select a different application.",
|
|
56
|
+
"appDoesNotSupportManifest": "The selected application is not supported by SAPUI5 Adaptation Project as it does not have a manifest.json file. Please select a different application.",
|
|
56
57
|
"extensibilityGenNotFound": "Extensibility Project generator plugin was not found in your dev space, and is required for this action. To proceed, please install the <SAPUI5 Layout Editor & Extensibility> extension.",
|
|
57
58
|
"creatingExtensionProjectError": "Creating the extension project failed. To see the error, view the logs.",
|
|
58
59
|
"appParameterMissing": "Could not create an extension project because the application parameters are missing. Please select a different application.",
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@sap-ux/generator-adp",
|
|
3
3
|
"displayName": "SAPUI5 Adaptation Project",
|
|
4
4
|
"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.",
|
|
5
|
-
"version": "0.2.
|
|
5
|
+
"version": "0.2.3",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "https://github.com/SAP/open-ux-tools.git",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"i18next": "23.5.1",
|
|
30
30
|
"yeoman-generator": "5.10.0",
|
|
31
31
|
"uuid": "10.0.0",
|
|
32
|
-
"@sap-ux/adp-tooling": "0.13.
|
|
32
|
+
"@sap-ux/adp-tooling": "0.13.45",
|
|
33
33
|
"@sap-ux/axios-extension": "1.20.3",
|
|
34
34
|
"@sap-ux/btp-utils": "1.0.3",
|
|
35
35
|
"@sap-ux/feature-toggle": "0.2.4",
|