@sap-ux/ui5-application-inquirer 0.15.0 → 0.15.2

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.
@@ -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, isCapProject);
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 isCapProject if we are generating into a CAP project certain prompts may be removed
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, isCapProject?: boolean): UI5ApplicationQuestion[];
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 isCapProject if we are generating into a CAP project certain prompts may be removed
64
+ * @param capCdsInfo CDS UI5 plugin information
65
65
  * @returns the updated questions
66
66
  */
67
- function hidePrompts(prompts, promptOptions, isCapProject = false) {
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]) && isCapProject)) {
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.0",
4
+ "version": "0.15.2",
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.7.35",
26
+ "@sap-ux/inquirer-common": "0.7.36",
27
27
  "@sap-ux/project-access": "1.30.12",
28
28
  "@sap-ux/project-input-validator": "0.6.17",
29
29
  "@sap-ux/ui5-info": "0.12.1"
@@ -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.11.0"
38
+ "@sap-ux/cap-config-writer": "0.12.1"
39
39
  },
40
40
  "engines": {
41
41
  "node": ">=20.x"