@sap-ux/ui5-application-inquirer 0.8.13 → 0.9.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.
@@ -234,7 +234,8 @@ function getAddDeployConfigPrompt(targetDir, addDeployConfigOptions, isCapProjec
234
234
  };
235
235
  }
236
236
  /**
237
- * Get the `ui5Version` prompt.
237
+ * Get the `ui5Version` prompt. If the ui5VersionPromptOption `defaultChoice` has been specified and an exact verion match is found
238
+ * then the label from that option will be used instead of any other labels e.g. `(Maintained version)`
238
239
  *
239
240
  * @param ui5Versions the UI5 versions that will be available for selection
240
241
  * @param ui5VersionPromptOptions UI5 version prompt options
@@ -243,7 +244,7 @@ function getAddDeployConfigPrompt(targetDir, addDeployConfigOptions, isCapProjec
243
244
  function getUI5VersionPrompt(ui5Versions = [], ui5VersionPromptOptions) {
244
245
  // Set the default to be closest to the passed value or the default as defined by ui5 version service
245
246
  const defaultChoice = (0, inquirer_common_1.getDefaultUI5VersionChoice)(ui5Versions, ui5VersionPromptOptions?.defaultChoice);
246
- const ui5VersionChoices = (0, inquirer_common_1.ui5VersionsGrouped)(ui5Versions, ui5VersionPromptOptions?.includeSeparators, defaultChoice);
247
+ const ui5VersionChoices = (0, inquirer_common_1.ui5VersionsGrouped)(ui5Versions, ui5VersionPromptOptions?.includeSeparators, defaultChoice, !!ui5VersionPromptOptions?.defaultChoice && ui5VersionPromptOptions.defaultChoice.value === defaultChoice?.value);
247
248
  return {
248
249
  when: () => !!ui5VersionChoices,
249
250
  type: ui5VersionPromptOptions?.useAutocomplete ? 'autocomplete' : 'list',
package/dist/types.d.ts CHANGED
@@ -70,7 +70,10 @@ type UI5VersionPromptOptions = {
70
70
  */
71
71
  useAutocomplete?: boolean;
72
72
  /**
73
- * Choice will be added to the UI5 versions offered and set as the default selection
73
+ * Choice will be added to the UI5 versions offered and set as the default selection.
74
+ * If the specified default choice is found in the ui5 version list it will be set as the
75
+ * default. If it is not found it will be added as the first entry. In all cases the specified
76
+ * default choice `name` property will be used as the label.
74
77
  *
75
78
  */
76
79
  defaultChoice?: UI5VersionChoice;
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.8.13",
4
+ "version": "0.9.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/SAP/open-ux-tools.git",
@@ -23,7 +23,7 @@
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.5.14",
26
+ "@sap-ux/inquirer-common": "0.6.0",
27
27
  "@sap-ux/project-access": "1.28.10",
28
28
  "@sap-ux/project-input-validator": "0.3.4",
29
29
  "@sap-ux/ui5-info": "0.8.3"