@sap-ux/ui5-application-inquirer 0.9.31 → 0.11.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.
@@ -34,11 +34,4 @@ export declare function isVersionIncluded(version: string, minVersion: string):
34
34
  * @returns the updated questions
35
35
  */
36
36
  export declare function hidePrompts(prompts: Record<promptNames, UI5ApplicationQuestion>, promptOptions?: UI5ApplicationPromptOptions, isCapProject?: boolean): UI5ApplicationQuestion[];
37
- /**
38
- * @param targetPath the target directory path.
39
- * @param appName the application directory name.
40
- * @param validateFioriAppFolder if true, validates the target path as a Fiori App project.
41
- * @returns true if validated for Fiori App Project and Project Folder, false if appName length is less than 2. Otherwise appropriate validation message.
42
- */
43
- export declare function validateTargetFolder(targetPath: string, appName: string, validateFioriAppFolder?: boolean): Promise<string | boolean>;
44
37
  //# sourceMappingURL=prompt-helpers.d.ts.map
@@ -4,15 +4,12 @@ exports.appPathExists = appPathExists;
4
4
  exports.defaultAppName = defaultAppName;
5
5
  exports.isVersionIncluded = isVersionIncluded;
6
6
  exports.hidePrompts = hidePrompts;
7
- exports.validateTargetFolder = validateTargetFolder;
8
7
  const ui5_info_1 = require("@sap-ux/ui5-info");
9
8
  const fs_1 = require("fs");
10
9
  const path_1 = require("path");
11
10
  const semver_1 = require("semver");
12
11
  const i18n_1 = require("../i18n");
13
12
  const types_1 = require("../types");
14
- const project_input_validator_1 = require("@sap-ux/project-input-validator");
15
- const validators_1 = require("./validators");
16
13
  /**
17
14
  * Tests if a directory with the specified `appName` exists at the path specified by `targetPath`.
18
15
  *
@@ -84,23 +81,4 @@ function hidePrompts(prompts, promptOptions, isCapProject) {
84
81
  }
85
82
  return questions;
86
83
  }
87
- /**
88
- * @param targetPath the target directory path.
89
- * @param appName the application directory name.
90
- * @param validateFioriAppFolder if true, validates the target path as a Fiori App project.
91
- * @returns true if validated for Fiori App Project and Project Folder, false if appName length is less than 2. Otherwise appropriate validation message.
92
- */
93
- async function validateTargetFolder(targetPath, appName, validateFioriAppFolder) {
94
- if (validateFioriAppFolder === true) {
95
- const isFioriValid = await (0, validators_1.validateFioriAppProjectFolder)(targetPath);
96
- if (isFioriValid !== true) {
97
- return isFioriValid;
98
- }
99
- }
100
- const isProjectValid = (0, project_input_validator_1.validateProjectFolder)(targetPath, appName);
101
- if (isProjectValid !== true) {
102
- return isProjectValid;
103
- }
104
- return true;
105
- }
106
84
  //# sourceMappingURL=prompt-helpers.js.map
@@ -282,7 +282,7 @@ function getTargetFolderPrompt(targetDir, validateFioriAppFolder) {
282
282
  default: (answers) => answers.targetFolder || targetDir,
283
283
  validate: async (target, { name = '' }) => {
284
284
  if (name.length > 2) {
285
- return await (0, prompt_helpers_1.validateTargetFolder)(target, name, validateFioriAppFolder);
285
+ return await (0, project_input_validator_1.validateFioriAppTargetFolder)(target, name, validateFioriAppFolder);
286
286
  }
287
287
  return false;
288
288
  }
@@ -7,11 +7,4 @@
7
7
  * @returns true, if valid, or a string message indicating the reason why the input is invalid
8
8
  */
9
9
  export declare function validateAppName(appName: string, targetDir: string): boolean | string;
10
- /**
11
- * Returns true if the specified target path does not contain a Fiori project.
12
- *
13
- * @param targetDir the target directory path.
14
- * @returns true, if not Fiori Project, or string message indicating that the path contains a Fiori project.
15
- */
16
- export declare function validateFioriAppProjectFolder(targetDir: string): Promise<string | boolean>;
17
10
  //# sourceMappingURL=validators.d.ts.map
@@ -1,11 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.validateAppName = validateAppName;
4
- exports.validateFioriAppProjectFolder = validateFioriAppProjectFolder;
5
4
  const project_input_validator_1 = require("@sap-ux/project-input-validator");
6
5
  const prompt_helpers_1 = require("./prompt-helpers");
7
6
  const i18n_1 = require("../i18n");
8
- const project_access_1 = require("@sap-ux/project-access");
9
7
  /**
10
8
  * Returns true (valid) if the specified projectName is a valid module name
11
9
  * and if an application folder (directory) at the specified path does not exist.
@@ -25,24 +23,4 @@ function validateAppName(appName, targetDir) {
25
23
  }
26
24
  return true;
27
25
  }
28
- /**
29
- * Returns true if the specified target path does not contain a Fiori project.
30
- *
31
- * @param targetDir the target directory path.
32
- * @returns true, if not Fiori Project, or string message indicating that the path contains a Fiori project.
33
- */
34
- async function validateFioriAppProjectFolder(targetDir) {
35
- // Check if the target directory contains a CAP project
36
- if (!!(await (0, project_access_1.findCapProjectRoot)(targetDir, false)) || !!(await (0, project_access_1.getCapProjectType)(targetDir))) {
37
- return (0, i18n_1.t)('validators.folderContainsCapApp');
38
- }
39
- // Check if the target directory contains a Fiori project
40
- const appRoot = await (0, project_access_1.findRootsForPath)(targetDir);
41
- if (appRoot) {
42
- return (0, i18n_1.t)('validators.folderContainsFioriApp', { path: appRoot.appRoot });
43
- }
44
- else {
45
- return true;
46
- }
47
- }
48
26
  //# sourceMappingURL=validators.js.map
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.9.31",
4
+ "version": "0.11.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.6.31",
26
27
  "@sap-ux/project-access": "1.29.18",
27
- "@sap-ux/project-input-validator": "0.3.4",
28
- "@sap-ux/ui5-info": "0.9.1",
29
- "@sap-ux/inquirer-common": "0.6.31"
28
+ "@sap-ux/project-input-validator": "0.5.0",
29
+ "@sap-ux/ui5-info": "0.9.1"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@sap-devx/yeoman-ui-types": "1.14.4",