@sap-ux/ui5-application-inquirer 0.15.0 → 0.15.1
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.js
CHANGED
|
@@ -57,7 +57,7 @@ async function getQuestions(ui5Versions, promptOptions, capCdsInfo, isYUI = fals
|
|
|
57
57
|
[types_1.promptNames.skipAnnotations]: (0, prompts2_1.getSkipAnnotationsPrompt)()
|
|
58
58
|
};
|
|
59
59
|
// Hide not applicable prompts based on passed options or if this is a CAP project
|
|
60
|
-
let questions = (0, prompt_helpers_1.hidePrompts)(keyedPrompts, promptOptions,
|
|
60
|
+
let questions = (0, prompt_helpers_1.hidePrompts)(keyedPrompts, promptOptions, capCdsInfo);
|
|
61
61
|
// Add an additional condition to 'advanced' prompts so they can be shown/hidden at runtime
|
|
62
62
|
applyAdvancedOption(questions, promptOptions);
|
|
63
63
|
// Apply extended `validate`, `additionalMessages` or override `default` prompt properties
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { promptNames, type UI5ApplicationPromptOptions, type UI5ApplicationQuestion } from '../types';
|
|
2
|
+
import type { CdsUi5PluginInfo } from '@sap-ux/project-access';
|
|
2
3
|
/**
|
|
3
4
|
* Tests if a directory with the specified `appName` exists at the path specified by `targetPath`.
|
|
4
5
|
*
|
|
@@ -30,8 +31,8 @@ export declare function isVersionIncluded(version: string, minVersion: string):
|
|
|
30
31
|
*
|
|
31
32
|
* @param prompts Keyed prompts object containing all possible prompts
|
|
32
33
|
* @param promptOptions prompt options
|
|
33
|
-
* @param
|
|
34
|
+
* @param capCdsInfo CDS UI5 plugin information
|
|
34
35
|
* @returns the updated questions
|
|
35
36
|
*/
|
|
36
|
-
export declare function hidePrompts(prompts: Record<promptNames, UI5ApplicationQuestion>, promptOptions?: UI5ApplicationPromptOptions,
|
|
37
|
+
export declare function hidePrompts(prompts: Record<promptNames, UI5ApplicationQuestion>, promptOptions?: UI5ApplicationPromptOptions, capCdsInfo?: CdsUi5PluginInfo): UI5ApplicationQuestion[];
|
|
37
38
|
//# sourceMappingURL=prompt-helpers.d.ts.map
|
|
@@ -61,11 +61,12 @@ function isVersionIncluded(version, minVersion) {
|
|
|
61
61
|
*
|
|
62
62
|
* @param prompts Keyed prompts object containing all possible prompts
|
|
63
63
|
* @param promptOptions prompt options
|
|
64
|
-
* @param
|
|
64
|
+
* @param capCdsInfo CDS UI5 plugin information
|
|
65
65
|
* @returns the updated questions
|
|
66
66
|
*/
|
|
67
|
-
function hidePrompts(prompts, promptOptions,
|
|
67
|
+
function hidePrompts(prompts, promptOptions, capCdsInfo) {
|
|
68
68
|
const questions = [];
|
|
69
|
+
const isCapProject = !!capCdsInfo;
|
|
69
70
|
if (promptOptions ?? isCapProject) {
|
|
70
71
|
Object.keys(prompts).forEach((key) => {
|
|
71
72
|
const promptKey = key;
|
|
@@ -74,7 +75,10 @@ function hidePrompts(prompts, promptOptions, isCapProject = false) {
|
|
|
74
75
|
const hidePrompt = typeof promptOpt?.hide === 'function' ? promptOpt.hide(isCapProject) : promptOpt?.hide ?? false;
|
|
75
76
|
if (!hidePrompt &&
|
|
76
77
|
// Target directory is determined by the CAP project. `enableEsLint` and `targetFolder` are not available for CAP projects
|
|
77
|
-
!([types_1.promptNames.targetFolder, types_1.promptNames.enableEslint].includes(types_1.promptNames[promptKey]) &&
|
|
78
|
+
!([types_1.promptNames.targetFolder, types_1.promptNames.enableEslint].includes(types_1.promptNames[promptKey]) &&
|
|
79
|
+
isCapProject) &&
|
|
80
|
+
// `enableTypeScript` and `enableVirtualEndpoints` should not be shown for certain CAP projects i.e CAP Java
|
|
81
|
+
!([types_1.promptNames.enableTypeScript, types_1.promptNames.enableVirtualEndpoints].includes(types_1.promptNames[promptKey]) && (capCdsInfo ? !capCdsInfo?.hasMinCdsVersion : false))) {
|
|
78
82
|
questions.push(prompts[promptKey]);
|
|
79
83
|
}
|
|
80
84
|
});
|
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.15.
|
|
4
|
+
"version": "0.15.1",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/SAP/open-ux-tools.git",
|