@sap-ux/generator-adp 0.3.78 → 0.4.1

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.
@@ -68,10 +68,6 @@ export default class extends Generator {
68
68
  * Indicates if the current layer is based on a customer base.
69
69
  */
70
70
  private isCustomerBase;
71
- /**
72
- * Base application inbounds, if the base application is an FLP app.
73
- */
74
- private baseAppInbounds?;
75
71
  /**
76
72
  * Creates an instance of the generator.
77
73
  *
@@ -3,29 +3,29 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ const yeoman_ui_types_1 = require("@sap-devx/yeoman-ui-types");
6
7
  const path_1 = require("path");
7
8
  const yeoman_generator_1 = __importDefault(require("yeoman-generator"));
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 logger_1 = require("@sap-ux/logger");
11
10
  const feature_toggle_1 = require("@sap-ux/feature-toggle");
12
11
  const fiori_generator_shared_1 = require("@sap-ux/fiori-generator-shared");
13
- const layer_1 = require("./layer");
14
- const i18n_1 = require("../utils/i18n");
12
+ const logger_1 = require("@sap-ux/logger");
15
13
  const telemetryEvents_1 = require("../telemetryEvents");
16
- const opts_1 = require("../utils/opts");
17
- const logger_2 = __importDefault(require("../utils/logger"));
18
- const attributes_1 = require("./questions/attributes");
19
- const configuration_1 = require("./questions/configuration");
20
- const validators_1 = require("./questions/helper/validators");
14
+ const appWizardCache_1 = require("../utils/appWizardCache");
21
15
  const deps_1 = require("../utils/deps");
16
+ const i18n_1 = require("../utils/i18n");
17
+ const logger_2 = __importDefault(require("../utils/logger"));
18
+ const opts_1 = require("../utils/opts");
22
19
  const parse_json_input_1 = require("../utils/parse-json-input");
23
- const subgenHelpers_1 = require("../utils/subgenHelpers");
24
- const appWizardCache_1 = require("../utils/appWizardCache");
25
- const default_values_1 = require("./questions/helper/default-values");
26
20
  const steps_1 = require("../utils/steps");
27
- const workspace_1 = require("../utils/workspace");
21
+ const subgenHelpers_1 = require("../utils/subgenHelpers");
28
22
  const templates_1 = require("../utils/templates");
23
+ const workspace_1 = require("../utils/workspace");
24
+ const layer_1 = require("./layer");
25
+ const attributes_1 = require("./questions/attributes");
26
+ const configuration_1 = require("./questions/configuration");
27
+ const default_values_1 = require("./questions/helper/default-values");
28
+ const validators_1 = require("./questions/helper/validators");
29
29
  const generatorTitle = 'Adaptation Project';
30
30
  /**
31
31
  * Generator for creating an Adaptation Project.
@@ -95,10 +95,6 @@ class default_1 extends yeoman_generator_1.default {
95
95
  * Indicates if the current layer is based on a customer base.
96
96
  */
97
97
  isCustomerBase;
98
- /**
99
- * Base application inbounds, if the base application is an FLP app.
100
- */
101
- baseAppInbounds;
102
98
  /**
103
99
  * Creates an instance of the generator.
104
100
  *
@@ -171,14 +167,11 @@ class default_1 extends yeoman_generator_1.default {
171
167
  prompts: this.prompts
172
168
  };
173
169
  const defaultFolder = (0, fiori_generator_shared_1.getDefaultTargetFolder)(this.options.vscode) ?? process.cwd();
174
- if (this.prompter.isCloud) {
175
- this.baseAppInbounds = await (0, adp_tooling_1.getBaseAppInbounds)(this.configAnswers.application.id, this.prompter.provider);
176
- }
177
170
  const options = {
178
171
  targetFolder: { default: defaultFolder, hide: this.shouldCreateExtProject },
179
172
  ui5ValidationCli: { hide: !this.isCli },
180
173
  enableTypeScript: { hide: this.shouldCreateExtProject },
181
- addFlpConfig: { hasBaseAppInbounds: !!this.baseAppInbounds, hide: this.shouldCreateExtProject },
174
+ addFlpConfig: { hasBaseAppInbounds: !!this.prompter.baseAppInbounds, hide: this.shouldCreateExtProject },
182
175
  addDeployConfig: { hide: this.shouldCreateExtProject || !this.isCustomerBase }
183
176
  };
184
177
  const attributesQuestions = (0, attributes_1.getPrompts)(this.destinationPath(), promptConfig, options);
@@ -199,7 +192,7 @@ class default_1 extends yeoman_generator_1.default {
199
192
  (0, subgenHelpers_1.addFlpGen)({
200
193
  vscode: this.vscode,
201
194
  projectRootPath: this._getProjectPath(),
202
- inbounds: this.baseAppInbounds,
195
+ inbounds: this.prompter.baseAppInbounds,
203
196
  layer: this.layer
204
197
  }, this.composeWith.bind(this), this.logger, this.appWizard);
205
198
  }
@@ -374,7 +367,7 @@ class default_1 extends yeoman_generator_1.default {
374
367
  (0, steps_1.updateWizardSteps)(this.prompts, (0, steps_1.getDeployPage)(), (0, i18n_1.t)('yuiNavSteps.projectAttributesName'), this.attributeAnswers.addDeployConfig);
375
368
  }
376
369
  if (!flpPagesExist) {
377
- (0, steps_1.updateFlpWizardSteps)(!!this.baseAppInbounds, this.prompts, this.attributeAnswers.projectName, !!this.attributeAnswers.addFlpConfig);
370
+ (0, steps_1.updateFlpWizardSteps)(!!this.prompter.baseAppInbounds, this.prompts, this.attributeAnswers.projectName, !!this.attributeAnswers.addFlpConfig);
378
371
  }
379
372
  }
380
373
  }
@@ -1,8 +1,8 @@
1
+ import type { SystemLookup, UI5Version } from '@sap-ux/adp-tooling';
1
2
  import { FlexLayer } from '@sap-ux/adp-tooling';
2
- import type { ToolsLogger } from '@sap-ux/logger';
3
- import type { Manifest } from '@sap-ux/project-access';
4
3
  import { type AbapServiceProvider } from '@sap-ux/axios-extension';
5
- import type { SystemLookup, UI5Version } from '@sap-ux/adp-tooling';
4
+ import type { ToolsLogger } from '@sap-ux/logger';
5
+ import type { Manifest, ManifestNamespace } from '@sap-ux/project-access';
6
6
  import type { ConfigPromptOptions, ConfigQuestion } from '../types';
7
7
  /**
8
8
  * A stateful prompter class that creates configuration questions.
@@ -79,6 +79,10 @@ export declare class ConfigPrompter {
79
79
  * System UI5 version.
80
80
  */
81
81
  private systemVersion;
82
+ /**
83
+ * Base application inbounds, if the base application is an FLP app.
84
+ */
85
+ private baseApplicationInbounds?;
82
86
  /**
83
87
  * Returns the needed ui5 properties from calling the CDN.
84
88
  *
@@ -119,6 +123,12 @@ export declare class ConfigPrompter {
119
123
  * @returns {boolean} True if the application is supported.
120
124
  */
121
125
  get isAppSupported(): boolean;
126
+ /**
127
+ * Base application inbounds, if the base application is an FLP app.
128
+ *
129
+ * @returns {ManifestNamespace.Inbound|undefined} Returns the base application inbounds.
130
+ */
131
+ get baseAppInbounds(): ManifestNamespace.Inbound | undefined;
122
132
  /**
123
133
  * Creates an instance of ConfigPrompter.
124
134
  *
@@ -2,16 +2,16 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ConfigPrompter = void 0;
4
4
  const adp_tooling_1 = require("@sap-ux/adp-tooling");
5
- const project_input_validator_1 = require("@sap-ux/project-input-validator");
6
5
  const axios_extension_1 = require("@sap-ux/axios-extension");
7
6
  const btp_utils_1 = require("@sap-ux/btp-utils");
7
+ const project_input_validator_1 = require("@sap-ux/project-input-validator");
8
8
  const i18n_1 = require("../../utils/i18n");
9
9
  const types_1 = require("../types");
10
- const message_1 = require("./helper/message");
11
- const choices_1 = require("./helper/choices");
12
- const validators_1 = require("./helper/validators");
13
10
  const additional_messages_1 = require("./helper/additional-messages");
11
+ const choices_1 = require("./helper/choices");
14
12
  const conditions_1 = require("./helper/conditions");
13
+ const message_1 = require("./helper/message");
14
+ const validators_1 = require("./helper/validators");
15
15
  /**
16
16
  * A stateful prompter class that creates configuration questions.
17
17
  * It exposes a single public method {@link getPrompts} to retrieve the configuration questions.
@@ -87,6 +87,10 @@ class ConfigPrompter {
87
87
  * System UI5 version.
88
88
  */
89
89
  systemVersion;
90
+ /**
91
+ * Base application inbounds, if the base application is an FLP app.
92
+ */
93
+ baseApplicationInbounds;
90
94
  /**
91
95
  * Returns the needed ui5 properties from calling the CDN.
92
96
  *
@@ -139,6 +143,14 @@ class ConfigPrompter {
139
143
  get isAppSupported() {
140
144
  return this.isApplicationSupported;
141
145
  }
146
+ /**
147
+ * Base application inbounds, if the base application is an FLP app.
148
+ *
149
+ * @returns {ManifestNamespace.Inbound|undefined} Returns the base application inbounds.
150
+ */
151
+ get baseAppInbounds() {
152
+ return this.baseApplicationInbounds;
153
+ }
142
154
  /**
143
155
  * Creates an instance of ConfigPrompter.
144
156
  *
@@ -394,18 +406,27 @@ class ConfigPrompter {
394
406
  return (0, i18n_1.t)('error.selectCannotBeEmptyError', { value: 'Application' });
395
407
  }
396
408
  const validationResult = await this.validateAppData(app);
397
- if (!(0, btp_utils_1.isAppStudio)()) {
398
- return validationResult;
399
- }
400
409
  const isKnownUnsupported = validationResult === (0, i18n_1.t)('error.appDoesNotSupportManifest') ||
401
410
  validationResult === (0, i18n_1.t)('error.appDoesNotSupportFlexibility');
402
- if (isKnownUnsupported) {
411
+ if ((0, btp_utils_1.isAppStudio)() && isKnownUnsupported) {
403
412
  this.logger.error(validationResult);
404
413
  this.appValidationErrorMessage = validationResult;
405
414
  this.isApplicationSupported = false;
415
+ // Continue to the next prompt for extension project.
406
416
  return true;
407
417
  }
408
- return validationResult;
418
+ if (typeof validationResult === 'string') {
419
+ return validationResult;
420
+ }
421
+ if (this.isCloud) {
422
+ try {
423
+ this.baseApplicationInbounds = await (0, adp_tooling_1.getBaseAppInbounds)(app.id, this.provider);
424
+ }
425
+ catch (error) {
426
+ return (0, i18n_1.t)('error.fetchBaseInboundsFailed', { error: error.message });
427
+ }
428
+ }
429
+ return true;
409
430
  }
410
431
  /**
411
432
  * Validates the password by setting up the provider and, if necessary,
@@ -77,6 +77,7 @@
77
77
  "systemNotFound": "System could not be found or is not supported: {{system}}. Please check the system exists.",
78
78
  "applicationNotFound": "The application could not be found or is not supported: {{appName}}. Please check the application exists.",
79
79
  "backendCommunicationError": "An error occurred when communicating with the back end. Please try again later.",
80
- "pleaseProvideAllRequiredData": "Please provide the required data and try again."
80
+ "pleaseProvideAllRequiredData": "Please provide the required data and try again.",
81
+ "fetchBaseInboundsFailed": "Fetching base application inbounds failed: {{error}}."
81
82
  }
82
83
  }
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.3.78",
6
+ "version": "0.4.1",
7
7
  "repository": {
8
8
  "type": "git",
9
9
  "url": "https://github.com/SAP/open-ux-tools.git",
@@ -30,18 +30,18 @@
30
30
  "i18next": "25.3.0",
31
31
  "yeoman-generator": "5.10.0",
32
32
  "uuid": "10.0.0",
33
- "@sap-ux/adp-tooling": "0.15.27",
33
+ "@sap-ux/adp-tooling": "0.15.28",
34
34
  "@sap-ux/axios-extension": "1.22.7",
35
35
  "@sap-ux/btp-utils": "1.1.1",
36
36
  "@sap-ux/feature-toggle": "0.3.1",
37
- "@sap-ux/inquirer-common": "0.7.41",
37
+ "@sap-ux/inquirer-common": "0.7.42",
38
38
  "@sap-ux/logger": "0.7.0",
39
- "@sap-ux/project-access": "1.30.14",
39
+ "@sap-ux/project-access": "1.31.0",
40
40
  "@sap-ux/store": "1.1.4",
41
41
  "@sap-ux/system-access": "0.6.16",
42
- "@sap-ux/project-input-validator": "0.6.19",
43
- "@sap-ux/fiori-generator-shared": "0.13.14",
44
- "@sap-ux/odata-service-writer": "0.27.19"
42
+ "@sap-ux/project-input-validator": "0.6.20",
43
+ "@sap-ux/fiori-generator-shared": "0.13.15",
44
+ "@sap-ux/odata-service-writer": "0.27.20"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@jest/types": "30.0.1",
@@ -56,7 +56,7 @@
56
56
  "fs-extra": "10.0.0",
57
57
  "rimraf": "5.0.5",
58
58
  "yeoman-test": "6.3.0",
59
- "@sap-ux/deploy-config-sub-generator": "0.4.7"
59
+ "@sap-ux/deploy-config-sub-generator": "0.4.8"
60
60
  },
61
61
  "engines": {
62
62
  "node": ">=20.x"