@sap-ux/ui5-application-inquirer 0.14.39 → 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.
@@ -46,10 +46,10 @@ async function getQuestions(ui5Versions, promptOptions, capCdsInfo, isYUI = fals
46
46
  [types_1.promptNames.description]: (0, prompts1_1.getDescriptionPrompt)(),
47
47
  [types_1.promptNames.targetFolder]: (0, prompts1_1.getTargetFolderPrompt)(targetDir, shouldValidateFioriAppFolder),
48
48
  [types_1.promptNames.ui5Version]: (0, prompts1_1.getUI5VersionPrompt)(ui5Versions, promptOptions?.ui5Version),
49
- [types_1.promptNames.enableTypeScript]: (0, prompts1_1.getEnableTypeScriptPrompt)(capCdsInfo),
49
+ [types_1.promptNames.enableTypeScript]: (0, prompts1_1.getEnableTypeScriptPrompt)(),
50
50
  [types_1.promptNames.addDeployConfig]: (0, prompts1_1.getAddDeployConfigPrompt)(targetDir, promptOptions?.addDeployConfig, isCapProject),
51
51
  [types_1.promptNames.addFlpConfig]: (0, prompts1_1.getAddFlpConfigPrompt)(promptOptions?.addFlpConfig),
52
- [types_1.promptNames.enableVirtualEndpoints]: (0, prompts1_1.getEnableVirtualEndpoints)(capCdsInfo),
52
+ [types_1.promptNames.enableVirtualEndpoints]: (0, prompts1_1.getEnableVirtualEndpoints)(),
53
53
  [types_1.promptNames.showAdvanced]: (0, prompts2_1.getShowAdvancedPrompt)(),
54
54
  [types_1.promptNames.ui5Theme]: (0, prompts2_1.getUI5ThemePrompt)(),
55
55
  [types_1.promptNames.enableEslint]: (0, prompts2_1.getEnableEsLintPrompt)(),
@@ -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
  });
@@ -1,7 +1,6 @@
1
1
  import { promptNames } from '../types';
2
2
  import type { UI5Version } from '@sap-ux/ui5-info';
3
3
  import type { UI5ApplicationPromptOptions, UI5ApplicationQuestion } from '../types';
4
- import type { CdsUi5PluginInfo } from '@sap-ux/project-access';
5
4
  /**
6
5
  * Gets the `name` prompt.
7
6
  *
@@ -51,10 +50,9 @@ export declare function getUI5VersionPrompt(ui5Versions?: UI5Version[], ui5Versi
51
50
  /**
52
51
  * Get the `enableTypeScript` prompt.
53
52
  *
54
- * @param capCdsInfo CDS UI5 plugin information
55
53
  * @returns The `enableTypeScript` prompt
56
54
  */
57
- export declare function getEnableTypeScriptPrompt(capCdsInfo?: CdsUi5PluginInfo): UI5ApplicationQuestion;
55
+ export declare function getEnableTypeScriptPrompt(): UI5ApplicationQuestion;
58
56
  /**
59
57
  * Gets the `addDeployConfig` prompt.
60
58
  *
@@ -74,8 +72,7 @@ export declare function getAddFlpConfigPrompt(addFlpConfigOptions?: UI5Applicati
74
72
  /**
75
73
  * Get the `enableVirtualEndpoints` prompt.
76
74
  *
77
- * @param capCdsInfo CDS UI5 plugin information
78
75
  * @returns the `enableVirtualEndpoints` prompt
79
76
  */
80
- export declare function getEnableVirtualEndpoints(capCdsInfo?: CdsUi5PluginInfo): UI5ApplicationQuestion;
77
+ export declare function getEnableVirtualEndpoints(): UI5ApplicationQuestion;
81
78
  //# sourceMappingURL=prompts1.d.ts.map
@@ -17,7 +17,6 @@ const i18n_1 = require("../i18n");
17
17
  const types_1 = require("../types");
18
18
  const prompt_helpers_1 = require("./prompt-helpers");
19
19
  const validators_1 = require("./validators");
20
- const yeoman_ui_types_1 = require("@sap-devx/yeoman-ui-types");
21
20
  /**
22
21
  * Gets the `name` prompt.
23
22
  *
@@ -168,24 +167,10 @@ function getUI5VersionPrompt(ui5Versions = [], ui5VersionPromptOptions) {
168
167
  /**
169
168
  * Get the `enableTypeScript` prompt.
170
169
  *
171
- * @param capCdsInfo CDS UI5 plugin information
172
170
  * @returns The `enableTypeScript` prompt
173
171
  */
174
- function getEnableTypeScriptPrompt(capCdsInfo) {
172
+ function getEnableTypeScriptPrompt() {
175
173
  return {
176
- when: () => {
177
- if (capCdsInfo) {
178
- return capCdsInfo.hasMinCdsVersion;
179
- }
180
- return true;
181
- },
182
- additionalMessages: (val) => {
183
- let message;
184
- if (val && capCdsInfo?.hasMinCdsVersion && !capCdsInfo?.isWorkspaceEnabled) {
185
- message = { message: (0, i18n_1.t)('prompts.enableTypeScript.warningMsg'), severity: yeoman_ui_types_1.Severity.warning };
186
- }
187
- return message;
188
- },
189
174
  type: 'confirm',
190
175
  name: types_1.promptNames.enableTypeScript,
191
176
  message: (0, i18n_1.t)('prompts.enableTypeScript.message'),
@@ -259,17 +244,10 @@ function getAddFlpConfigPrompt(addFlpConfigOptions) {
259
244
  /**
260
245
  * Get the `enableVirtualEndpoints` prompt.
261
246
  *
262
- * @param capCdsInfo CDS UI5 plugin information
263
247
  * @returns the `enableVirtualEndpoints` prompt
264
248
  */
265
- function getEnableVirtualEndpoints(capCdsInfo) {
249
+ function getEnableVirtualEndpoints() {
266
250
  return {
267
- when: (answers) => {
268
- if (capCdsInfo) {
269
- return capCdsInfo.isCdsUi5PluginEnabled || !!answers?.enableTypeScript;
270
- }
271
- return true;
272
- },
273
251
  type: 'confirm',
274
252
  name: types_1.promptNames.enableVirtualEndpoints,
275
253
  guiOptions: {
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.39",
4
+ "version": "0.15.1",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/SAP/open-ux-tools.git",
@@ -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.27"
38
+ "@sap-ux/cap-config-writer": "0.11.0"
39
39
  },
40
40
  "engines": {
41
41
  "node": ">=20.x"