@sap-ux/ui5-application-inquirer 0.2.7 → 0.3.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.
@@ -270,7 +270,11 @@ function getAddDeployConfigPrompt(targetDir, addDeployConfigOptions, isCapProjec
270
270
  * @returns the `ui5Version` prompt
271
271
  */
272
272
  function getUI5VersionPrompt(ui5Versions = [], ui5VersionPromptOptions) {
273
- const ui5VersionChoices = (0, inquirer_common_1.ui5VersionsGrouped)(ui5Versions, ui5VersionPromptOptions === null || ui5VersionPromptOptions === void 0 ? void 0 : ui5VersionPromptOptions.includeSeparators, ui5VersionPromptOptions === null || ui5VersionPromptOptions === void 0 ? void 0 : ui5VersionPromptOptions.defaultChoice);
273
+ // Set the default to be closest to the passed value or the default as defined by ui5 version service
274
+ const defaultChoice = (0, inquirer_common_1.getDefaultUI5VersionChoice)(ui5Versions, ui5VersionPromptOptions === null || ui5VersionPromptOptions === void 0 ? void 0 : ui5VersionPromptOptions.defaultChoice);
275
+ const ui5VersionChoices = (0, inquirer_common_1.ui5VersionsGrouped)(ui5Versions, ui5VersionPromptOptions === null || ui5VersionPromptOptions === void 0 ? void 0 : ui5VersionPromptOptions.includeSeparators
276
+ // defaultChoice - this is added to support systemn versions however currently the middleware preview does not support this
277
+ );
274
278
  return {
275
279
  when: () => !!ui5VersionChoices,
276
280
  type: (ui5VersionPromptOptions === null || ui5VersionPromptOptions === void 0 ? void 0 : ui5VersionPromptOptions.useAutocomplete) ? 'autocomplete' : 'list',
@@ -283,9 +287,7 @@ function getUI5VersionPrompt(ui5Versions = [], ui5VersionPromptOptions) {
283
287
  source: (prevAnswers, input) => (0, inquirer_common_1.searchChoices)(input, ui5VersionChoices),
284
288
  message: (0, i18n_1.t)('prompts.appUi5VersionMessage'),
285
289
  default: () => {
286
- var _a, _b, _c;
287
- // Set the default to be the passed value or the default as defined by ui5 version service
288
- return ((_b = (_a = ui5VersionPromptOptions === null || ui5VersionPromptOptions === void 0 ? void 0 : ui5VersionPromptOptions.defaultChoice) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : (_c = ui5Versions.find((ui5Ver) => ui5Ver.default && ui5Ver.version)) === null || _c === void 0 ? void 0 : _c.version);
290
+ return defaultChoice === null || defaultChoice === void 0 ? void 0 : defaultChoice.value;
289
291
  }
290
292
  };
291
293
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sap-ux/ui5-application-inquirer",
3
3
  "description": "Prompts module that can prompt users for inputs required for UI5 application writing",
4
- "version": "0.2.7",
4
+ "version": "0.3.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/SAP/open-ux-tools.git",
@@ -23,10 +23,10 @@
23
23
  "inquirer-autocomplete-prompt": "2.0.1",
24
24
  "lodash": "4.17.21",
25
25
  "semver": "7.5.4",
26
- "@sap-ux/inquirer-common": "0.2.1",
26
+ "@sap-ux/inquirer-common": "0.2.3",
27
27
  "@sap-ux/project-access": "1.19.2",
28
28
  "@sap-ux/project-input-validator": "0.2.3",
29
- "@sap-ux/ui5-info": "0.3.2"
29
+ "@sap-ux/ui5-info": "0.3.3"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@sap-devx/yeoman-ui-types": "1.14.4",