@sap-ux/ui5-application-inquirer 0.14.26 → 0.14.28
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.
- package/dist/prompts/index.d.ts +1 -1
- package/dist/prompts/index.js +16 -3
- package/package.json +4 -4
package/dist/prompts/index.d.ts
CHANGED
|
@@ -10,5 +10,5 @@ import type { CdsUi5PluginInfo } from '@sap-ux/project-access';
|
|
|
10
10
|
* @param [isYUI] - optional, default is `false`. Changes the behaviour of some validation since YUI does not re-validate prompts that may be inter-dependant.
|
|
11
11
|
* @returns the prompts
|
|
12
12
|
*/
|
|
13
|
-
export declare function getQuestions(ui5Versions: UI5Version[], promptOptions?: UI5ApplicationPromptOptions, capCdsInfo?: CdsUi5PluginInfo, isYUI?: boolean): UI5ApplicationQuestion[]
|
|
13
|
+
export declare function getQuestions(ui5Versions: UI5Version[], promptOptions?: UI5ApplicationPromptOptions, capCdsInfo?: CdsUi5PluginInfo, isYUI?: boolean): Promise<UI5ApplicationQuestion[]>;
|
|
14
14
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/prompts/index.js
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.getQuestions = getQuestions;
|
|
4
7
|
/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */
|
|
5
8
|
// Nullish coalescing operator lint warnings disabled as its not appropriate in most cases where empty strings are not considered valid
|
|
9
|
+
const os_1 = __importDefault(require("os"));
|
|
10
|
+
const path_1 = require("path");
|
|
6
11
|
const inquirer_common_1 = require("@sap-ux/inquirer-common");
|
|
7
12
|
const prompts1_1 = require("./prompts1");
|
|
8
13
|
const prompts2_1 = require("./prompts2");
|
|
14
|
+
const project_input_validator_1 = require("@sap-ux/project-input-validator");
|
|
9
15
|
const types_1 = require("../types");
|
|
10
16
|
const prompt_helpers_1 = require("./prompt-helpers");
|
|
11
17
|
/**
|
|
@@ -17,21 +23,28 @@ const prompt_helpers_1 = require("./prompt-helpers");
|
|
|
17
23
|
* @param [isYUI] - optional, default is `false`. Changes the behaviour of some validation since YUI does not re-validate prompts that may be inter-dependant.
|
|
18
24
|
* @returns the prompts
|
|
19
25
|
*/
|
|
20
|
-
function getQuestions(ui5Versions, promptOptions, capCdsInfo, isYUI = false) {
|
|
26
|
+
async function getQuestions(ui5Versions, promptOptions, capCdsInfo, isYUI = false) {
|
|
21
27
|
// Set shared defaults
|
|
22
28
|
const appName = typeof promptOptions?.[types_1.promptNames.name]?.default === 'string'
|
|
23
29
|
? promptOptions[types_1.promptNames.name].default
|
|
24
30
|
: promptOptions?.[types_1.promptNames.name]?.defaultValue;
|
|
25
|
-
|
|
31
|
+
let targetDir = typeof promptOptions?.[types_1.promptNames.targetFolder]?.default === 'string'
|
|
26
32
|
? promptOptions[types_1.promptNames.targetFolder].default // Default functions will be applied later, these replace the existing defaults
|
|
27
33
|
: promptOptions?.[types_1.promptNames.targetFolder]?.defaultValue ?? process.cwd();
|
|
34
|
+
const shouldValidateFioriAppFolder = promptOptions?.[types_1.promptNames.targetFolder]?.validateFioriAppFolder;
|
|
35
|
+
if (shouldValidateFioriAppFolder) {
|
|
36
|
+
const isValidFolder = await (0, project_input_validator_1.validateFioriAppProjectFolder)(targetDir);
|
|
37
|
+
if (isValidFolder !== true) {
|
|
38
|
+
targetDir = (0, path_1.join)(os_1.default.homedir(), 'projects');
|
|
39
|
+
}
|
|
40
|
+
}
|
|
28
41
|
const isCapProject = !!capCdsInfo;
|
|
29
42
|
const keyedPrompts = {
|
|
30
43
|
[types_1.promptNames.name]: (0, prompts1_1.getNamePrompt)(targetDir, isCapProject, appName, isYUI),
|
|
31
44
|
[types_1.promptNames.title]: (0, prompts1_1.getTitlePrompt)(),
|
|
32
45
|
[types_1.promptNames.namespace]: (0, prompts1_1.getNamespacePrompt)(appName),
|
|
33
46
|
[types_1.promptNames.description]: (0, prompts1_1.getDescriptionPrompt)(),
|
|
34
|
-
[types_1.promptNames.targetFolder]: (0, prompts1_1.getTargetFolderPrompt)(targetDir,
|
|
47
|
+
[types_1.promptNames.targetFolder]: (0, prompts1_1.getTargetFolderPrompt)(targetDir, shouldValidateFioriAppFolder),
|
|
35
48
|
[types_1.promptNames.ui5Version]: (0, prompts1_1.getUI5VersionPrompt)(ui5Versions, promptOptions?.ui5Version),
|
|
36
49
|
[types_1.promptNames.enableTypeScript]: (0, prompts1_1.getEnableTypeScriptPrompt)(capCdsInfo),
|
|
37
50
|
[types_1.promptNames.addDeployConfig]: (0, prompts1_1.getAddDeployConfigPrompt)(targetDir, promptOptions?.addDeployConfig, isCapProject),
|
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.14.
|
|
4
|
+
"version": "0.14.28",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/SAP/open-ux-tools.git",
|
|
@@ -23,9 +23,9 @@
|
|
|
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.7.
|
|
26
|
+
"@sap-ux/inquirer-common": "0.7.24",
|
|
27
27
|
"@sap-ux/project-access": "1.30.7",
|
|
28
|
-
"@sap-ux/project-input-validator": "0.6.
|
|
28
|
+
"@sap-ux/project-input-validator": "0.6.12",
|
|
29
29
|
"@sap-ux/ui5-info": "0.12.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@types/lodash": "4.14.202",
|
|
36
36
|
"@types/semver": "7.5.4",
|
|
37
37
|
"inquirer": "8.2.6",
|
|
38
|
-
"@sap-ux/cap-config-writer": "0.10.
|
|
38
|
+
"@sap-ux/cap-config-writer": "0.10.20"
|
|
39
39
|
},
|
|
40
40
|
"engines": {
|
|
41
41
|
"node": ">=20.x"
|