@sap-ux/ui5-application-inquirer 0.18.5 → 0.19.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.
@@ -43,7 +43,7 @@ async function getQuestions(ui5Versions, promptOptions, capCdsInfo, isYUI = fals
43
43
  [types_1.promptNames.title]: (0, prompts1_1.getTitlePrompt)(),
44
44
  [types_1.promptNames.namespace]: (0, prompts1_1.getNamespacePrompt)(appName),
45
45
  [types_1.promptNames.description]: (0, prompts1_1.getDescriptionPrompt)(),
46
- [types_1.promptNames.targetFolder]: (0, prompts1_1.getTargetFolderPrompt)(targetDir, shouldValidateFioriAppFolder),
46
+ [types_1.promptNames.targetFolder]: (0, prompts1_1.getTargetFolderPrompt)(targetDir, shouldValidateFioriAppFolder, isYUI),
47
47
  [types_1.promptNames.ui5Version]: (0, prompts1_1.getUI5VersionPrompt)(ui5Versions, promptOptions?.ui5Version),
48
48
  [types_1.promptNames.enableTypeScript]: (0, prompts1_1.getEnableTypeScriptPrompt)(),
49
49
  [types_1.promptNames.addDeployConfig]: (0, prompts1_1.getAddDeployConfigPrompt)(targetDir, promptOptions?.addDeployConfig, isCapProject),
@@ -36,9 +36,10 @@ export declare function getDescriptionPrompt(): UI5ApplicationQuestion;
36
36
  *
37
37
  * @param targetDir provides a default value for the target folder path
38
38
  * @param validateFioriAppFolder validates the target folder path as a Fiori app project
39
+ * @param isYUI if true, input is returned unchanged (YUI folder browser already supplies absolute paths)
39
40
  * @returns the `targetFolder` prompt
40
41
  */
41
- export declare function getTargetFolderPrompt(targetDir: string, validateFioriAppFolder?: boolean): UI5ApplicationQuestion;
42
+ export declare function getTargetFolderPrompt(targetDir: string, validateFioriAppFolder?: boolean, isYUI?: boolean): UI5ApplicationQuestion;
42
43
  /**
43
44
  * Get the `ui5Version` prompt. If the ui5VersionPromptOption `defaultChoice` has been specified and an exact verion match is found
44
45
  * then the label from that option will be used instead of any other labels e.g. `(Maintained version)`
@@ -10,6 +10,7 @@ exports.getEnableTypeScriptPrompt = getEnableTypeScriptPrompt;
10
10
  exports.getAddDeployConfigPrompt = getAddDeployConfigPrompt;
11
11
  exports.getAddFlpConfigPrompt = getAddFlpConfigPrompt;
12
12
  exports.getEnableVirtualEndpoints = getEnableVirtualEndpoints;
13
+ const node_path_1 = require("node:path");
13
14
  const inquirer_common_1 = require("@sap-ux/inquirer-common");
14
15
  const project_access_1 = require("@sap-ux/project-access");
15
16
  const project_input_validator_1 = require("@sap-ux/project-input-validator");
@@ -114,9 +115,10 @@ function getDescriptionPrompt() {
114
115
  *
115
116
  * @param targetDir provides a default value for the target folder path
116
117
  * @param validateFioriAppFolder validates the target folder path as a Fiori app project
118
+ * @param isYUI if true, input is returned unchanged (YUI folder browser already supplies absolute paths)
117
119
  * @returns the `targetFolder` prompt
118
120
  */
119
- function getTargetFolderPrompt(targetDir, validateFioriAppFolder) {
121
+ function getTargetFolderPrompt(targetDir, validateFioriAppFolder, isYUI) {
120
122
  return {
121
123
  type: 'input',
122
124
  name: types_1.promptNames.targetFolder,
@@ -128,6 +130,12 @@ function getTargetFolderPrompt(targetDir, validateFioriAppFolder) {
128
130
  breadcrumb: (0, i18n_1.t)('prompts.targetFolder.breadcrumb')
129
131
  },
130
132
  default: (answers) => answers.targetFolder || targetDir,
133
+ filter: (input) => {
134
+ if (isYUI) {
135
+ return input;
136
+ }
137
+ return input && !(0, node_path_1.isAbsolute)(input) ? (0, node_path_1.resolve)(input) : input;
138
+ },
131
139
  validate: async (target, { name = '' }) => {
132
140
  if (name.length > 2) {
133
141
  return await (0, project_input_validator_1.validateFioriAppTargetFolder)(target, name, validateFioriAppFolder);
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.18.5",
4
+ "version": "0.19.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/SAP/open-ux-tools.git",
@@ -25,8 +25,8 @@
25
25
  "semver": "7.7.4",
26
26
  "@sap-ux/inquirer-common": "0.13.2",
27
27
  "@sap-ux/project-access": "1.38.1",
28
- "@sap-ux/project-input-validator": "0.7.2",
29
- "@sap-ux/ui5-info": "0.14.0"
28
+ "@sap-ux/ui5-info": "0.14.0",
29
+ "@sap-ux/project-input-validator": "0.7.2"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@sap-devx/yeoman-ui-types": "1.25.0",