@sap-ux/generator-adp 0.1.7 → 0.1.9

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.
@@ -31,9 +31,9 @@ export default class extends Generator {
31
31
  */
32
32
  private configAnswers;
33
33
  /**
34
- * Target folder for the generated project.
34
+ * Project attribute answers.
35
35
  */
36
- private targetFolder;
36
+ private attributeAnswers;
37
37
  /**
38
38
  * SystemLookup instance for managing system endpoints.
39
39
  */
@@ -54,6 +54,12 @@ export default class extends Generator {
54
54
  writing(): Promise<void>;
55
55
  install(): Promise<void>;
56
56
  end(): void;
57
+ /**
58
+ * Combines the target folder and project name.
59
+ *
60
+ * @returns {string} The project path from the answers.
61
+ */
62
+ private _getProjectPath;
57
63
  /**
58
64
  * Sets up the prompts for the generator.
59
65
  */
@@ -3,19 +3,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ const path_1 = require("path");
6
7
  const yeoman_generator_1 = __importDefault(require("yeoman-generator"));
7
8
  const yeoman_ui_types_1 = require("@sap-devx/yeoman-ui-types");
9
+ const fiori_generator_shared_1 = require("@sap-ux/fiori-generator-shared");
8
10
  const logger_1 = require("@sap-ux/logger");
9
- const feature_toggle_1 = require("@sap-ux/feature-toggle");
10
11
  const adp_tooling_1 = require("@sap-ux/adp-tooling");
11
- const fiori_generator_shared_1 = require("@sap-ux/fiori-generator-shared");
12
+ const feature_toggle_1 = require("@sap-ux/feature-toggle");
12
13
  const layer_1 = require("./layer");
13
14
  const i18n_1 = require("../utils/i18n");
14
15
  const telemetryEvents_1 = require("../telemetryEvents");
15
16
  const logger_2 = __importDefault(require("../utils/logger"));
17
+ const attributes_1 = require("./questions/attributes");
16
18
  const configuration_1 = require("./questions/configuration");
17
19
  const deps_1 = require("../utils/deps");
18
- const default_values_1 = require("./questions/helper/default-values");
19
20
  /**
20
21
  * Generator for creating an Adaptation Project.
21
22
  *
@@ -47,9 +48,9 @@ class default_1 extends yeoman_generator_1.default {
47
48
  */
48
49
  configAnswers;
49
50
  /**
50
- * Target folder for the generated project.
51
+ * Project attribute answers.
51
52
  */
52
- targetFolder;
53
+ attributeAnswers;
53
54
  /**
54
55
  * SystemLookup instance for managing system endpoints.
55
56
  */
@@ -76,10 +77,14 @@ class default_1 extends yeoman_generator_1.default {
76
77
  }
77
78
  async initializing() {
78
79
  await (0, i18n_1.initI18n)();
79
- const pages = [{ name: (0, i18n_1.t)('yuiNavSteps.configurationName'), description: (0, i18n_1.t)('yuiNavSteps.configurationDescr') }];
80
+ const pages = [
81
+ { name: (0, i18n_1.t)('yuiNavSteps.configurationName'), description: (0, i18n_1.t)('yuiNavSteps.configurationDescr') },
82
+ { name: (0, i18n_1.t)('yuiNavSteps.projectAttributesName'), description: (0, i18n_1.t)('yuiNavSteps.projectAttributesDescr') }
83
+ ];
80
84
  this.prompts.splice(0, 0, pages);
81
85
  this.layer = await (0, layer_1.getFlexLayer)();
82
86
  this.systemLookup = new adp_tooling_1.SystemLookup(this.toolsLogger);
87
+ this.prompter = new configuration_1.ConfigPrompter(this.systemLookup, this.layer, this.toolsLogger);
83
88
  await fiori_generator_shared_1.TelemetryHelper.initTelemetrySettings({
84
89
  consumerModule: {
85
90
  name: '@sap/generator-fiori:generator-adp',
@@ -90,7 +95,6 @@ class default_1 extends yeoman_generator_1.default {
90
95
  });
91
96
  }
92
97
  async prompting() {
93
- this.prompter = new configuration_1.ConfigPrompter(this.systemLookup, this.layer, this.toolsLogger);
94
98
  const isCLI = (0, fiori_generator_shared_1.getHostEnvironment)() === fiori_generator_shared_1.hostEnvironment.cli;
95
99
  const configQuestions = this.prompter.getPrompts({
96
100
  appValidationCli: { hide: !isCLI },
@@ -99,22 +103,35 @@ class default_1 extends yeoman_generator_1.default {
99
103
  this.configAnswers = await this.prompt(configQuestions);
100
104
  this.logger.info(`System: ${this.configAnswers.system}`);
101
105
  this.logger.info(`Application: ${JSON.stringify(this.configAnswers.application, null, 2)}`);
106
+ const { ui5Versions, systemVersion } = this.prompter.ui5;
107
+ const promptConfig = {
108
+ ui5Versions,
109
+ isVersionDetected: !!systemVersion,
110
+ isCloudProject: this.prompter.isCloud,
111
+ layer: this.layer
112
+ };
113
+ const defaultFolder = (0, fiori_generator_shared_1.getDefaultTargetFolder)(this.options.vscode) ?? process.cwd();
114
+ const options = {
115
+ targetFolder: { default: defaultFolder },
116
+ ui5ValidationCli: { hide: !isCLI }
117
+ };
118
+ const attributesQuestions = (0, attributes_1.getPrompts)(this.destinationPath(), promptConfig, options);
119
+ this.attributeAnswers = await this.prompt(attributesQuestions);
120
+ this.logger.info(`Project Attributes: ${JSON.stringify(this.attributeAnswers, null, 2)}`);
102
121
  }
103
122
  async writing() {
104
123
  try {
105
- const projectName = (0, default_values_1.getDefaultProjectName)(this.destinationPath());
106
- const namespace = (0, default_values_1.generateValidNamespace)(projectName, this.layer);
107
- this.targetFolder = this.destinationPath(projectName);
108
124
  const packageJson = (0, deps_1.getPackageInfo)();
109
125
  const config = await (0, adp_tooling_1.getConfig)({
110
126
  provider: this.prompter.provider,
111
127
  configAnswers: this.configAnswers,
128
+ attributeAnswers: this.attributeAnswers,
129
+ publicVersions: this.prompter?.ui5?.publicVersions,
112
130
  layer: this.layer,
113
- defaults: { namespace },
114
131
  packageJson,
115
132
  logger: this.toolsLogger
116
133
  });
117
- await (0, adp_tooling_1.generate)(this.targetFolder, config, this.fs);
134
+ await (0, adp_tooling_1.generate)(this._getProjectPath(), config, this.fs);
118
135
  }
119
136
  catch (e) {
120
137
  this.logger.error(`Writing phase failed: ${e}`);
@@ -124,7 +141,7 @@ class default_1 extends yeoman_generator_1.default {
124
141
  async install() {
125
142
  try {
126
143
  if (this.shouldInstallDeps) {
127
- await (0, deps_1.installDependencies)(this.targetFolder);
144
+ await (0, deps_1.installDependencies)(this._getProjectPath());
128
145
  }
129
146
  }
130
147
  catch (e) {
@@ -137,11 +154,19 @@ class default_1 extends yeoman_generator_1.default {
137
154
  ...this.options.telemetryData
138
155
  }) ?? {};
139
156
  if (telemetryData) {
140
- (0, fiori_generator_shared_1.sendTelemetry)(telemetryEvents_1.EventName.ADAPTATION_PROJECT_CREATED, telemetryData, this.targetFolder).catch((error) => {
157
+ (0, fiori_generator_shared_1.sendTelemetry)(telemetryEvents_1.EventName.ADAPTATION_PROJECT_CREATED, telemetryData, this._getProjectPath()).catch((error) => {
141
158
  this.logger.error((0, i18n_1.t)('error.telemetry', { error }));
142
159
  });
143
160
  }
144
161
  }
162
+ /**
163
+ * Combines the target folder and project name.
164
+ *
165
+ * @returns {string} The project path from the answers.
166
+ */
167
+ _getProjectPath() {
168
+ return (0, path_1.join)(this.attributeAnswers.targetFolder, this.attributeAnswers.projectName);
169
+ }
145
170
  /**
146
171
  * Sets up the prompts for the generator.
147
172
  */
@@ -0,0 +1,19 @@
1
+ import { FlexLayer } from '@sap-ux/adp-tooling';
2
+ import type { AttributesQuestion, AttributePromptOptions } from '../types';
3
+ interface Config {
4
+ isCloudProject: boolean;
5
+ layer: FlexLayer;
6
+ ui5Versions: string[];
7
+ isVersionDetected: boolean;
8
+ }
9
+ /**
10
+ * Returns all project attribute prompts, filtering based on promptOptions.
11
+ *
12
+ * @param {string} path - The project base path.
13
+ * @param {Config} config - Configuration values needed for conditional prompt logic.
14
+ * @param {AttributePromptOptions} [promptOptions] - Optional settings to control visibility and defaults.
15
+ * @returns {AttributesQuestion[]} An array of prompt objects for basic info input.
16
+ */
17
+ export declare function getPrompts(path: string, config: Config, promptOptions?: AttributePromptOptions): AttributesQuestion[];
18
+ export {};
19
+ //# sourceMappingURL=attributes.d.ts.map
@@ -0,0 +1,199 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getPrompts = void 0;
4
+ const adp_tooling_1 = require("@sap-ux/adp-tooling");
5
+ const project_input_validator_1 = require("@sap-ux/project-input-validator");
6
+ const i18n_1 = require("../../utils/i18n");
7
+ const types_1 = require("../types");
8
+ const tooltip_1 = require("./helper/tooltip");
9
+ const default_values_1 = require("./helper/default-values");
10
+ const additional_messages_1 = require("./helper/additional-messages");
11
+ /**
12
+ * Returns all project attribute prompts, filtering based on promptOptions.
13
+ *
14
+ * @param {string} path - The project base path.
15
+ * @param {Config} config - Configuration values needed for conditional prompt logic.
16
+ * @param {AttributePromptOptions} [promptOptions] - Optional settings to control visibility and defaults.
17
+ * @returns {AttributesQuestion[]} An array of prompt objects for basic info input.
18
+ */
19
+ function getPrompts(path, config, promptOptions) {
20
+ const { isVersionDetected, ui5Versions, isCloudProject, layer } = config;
21
+ const isCustomerBase = layer === "CUSTOMER_BASE" /* FlexLayer.CUSTOMER_BASE */;
22
+ const keyedPrompts = {
23
+ [types_1.attributePromptNames.projectName]: getProjectNamePrompt(path, isCustomerBase, promptOptions?.[types_1.attributePromptNames.projectName]),
24
+ [types_1.attributePromptNames.title]: getApplicationTitlePrompt(promptOptions?.[types_1.attributePromptNames.title]),
25
+ [types_1.attributePromptNames.namespace]: getNamespacePrompt(isCustomerBase, promptOptions?.[types_1.attributePromptNames.namespace]),
26
+ [types_1.attributePromptNames.targetFolder]: getTargetFolderPrompt(promptOptions?.[types_1.attributePromptNames.targetFolder]),
27
+ [types_1.attributePromptNames.ui5Version]: getUi5VersionPrompt(ui5Versions, isVersionDetected, isCloudProject),
28
+ [types_1.attributePromptNames.ui5ValidationCli]: getUi5VersionValidationPromptForCli(),
29
+ [types_1.attributePromptNames.enableTypeScript]: getEnableTypeScriptPrompt(promptOptions?.[types_1.attributePromptNames.enableTypeScript])
30
+ };
31
+ const questions = Object.entries(keyedPrompts)
32
+ .filter(([promptName]) => {
33
+ const options = promptOptions?.[promptName];
34
+ return !(options && 'hide' in options && options.hide);
35
+ })
36
+ .map(([_, question]) => question);
37
+ return questions;
38
+ }
39
+ exports.getPrompts = getPrompts;
40
+ /**
41
+ * Creates the project name input prompt.
42
+ *
43
+ * @param {string} path - The base project path.
44
+ * @param {boolean} isCustomerBase - Whether the layer is CUSTOMER_BASE.
45
+ * @param {ProjectNamePromptOptions} [_] - Optional prompt options.
46
+ * @returns {AttributesQuestion} The prompt configuration for project name.
47
+ */
48
+ function getProjectNamePrompt(path, isCustomerBase, _) {
49
+ return {
50
+ type: 'input',
51
+ name: types_1.attributePromptNames.projectName,
52
+ message: (0, i18n_1.t)('prompts.projectNameLabel'),
53
+ default: (answers) => (0, default_values_1.getDefaultProjectName)(answers.targetFolder || path),
54
+ guiOptions: {
55
+ mandatory: true,
56
+ breadcrumb: true,
57
+ hint: (0, tooltip_1.getProjectNameTooltip)(isCustomerBase)
58
+ },
59
+ validate: (value, answers) => (0, project_input_validator_1.validateProjectName)(value, answers.targetFolder || path, isCustomerBase),
60
+ store: false
61
+ };
62
+ }
63
+ /**
64
+ * Creates the application title input prompt.
65
+ *
66
+ * @param {ApplicationTitlePromptOptions} [options] - Optional prompt options.
67
+ * @returns {AttributesQuestion} The prompt configuration for application title.
68
+ */
69
+ function getApplicationTitlePrompt(options) {
70
+ return {
71
+ type: 'input',
72
+ name: types_1.attributePromptNames.title,
73
+ message: (0, i18n_1.t)('prompts.appTitleLabel'),
74
+ default: options?.default ?? (0, i18n_1.t)('prompts.appTitleDefault'),
75
+ guiOptions: {
76
+ mandatory: true,
77
+ breadcrumb: true,
78
+ hint: (0, i18n_1.t)('prompts.appTitleTooltip')
79
+ },
80
+ validate: project_input_validator_1.validateEmptyString,
81
+ store: false
82
+ };
83
+ }
84
+ /**
85
+ * Creates the namespace input prompt.
86
+ *
87
+ * @param {boolean} isCustomerBase - Whether the layer is CUSTOMER_BASE.
88
+ * @param {NamespacePromptOptions} [options] - Optional prompt options.
89
+ * @returns {AttributesQuestion} The prompt configuration for namespace.
90
+ */
91
+ function getNamespacePrompt(isCustomerBase, options) {
92
+ const prompt = {
93
+ type: 'input',
94
+ name: types_1.attributePromptNames.namespace,
95
+ message: (0, i18n_1.t)('prompts.namespaceLabel'),
96
+ default: (answers) => options?.default ?? (0, default_values_1.getDefaultNamespace)(answers.projectName, isCustomerBase),
97
+ guiOptions: {
98
+ applyDefaultWhenDirty: true
99
+ },
100
+ store: false
101
+ };
102
+ if (!isCustomerBase) {
103
+ prompt.guiOptions.type = 'label';
104
+ prompt.when = (answers) => !!answers.projectName;
105
+ }
106
+ else {
107
+ prompt.guiOptions.mandatory = true;
108
+ prompt.guiOptions.breadcrumb = true;
109
+ prompt.validate = (value, answers) => (0, project_input_validator_1.validateNamespaceAdp)(value, answers.projectName, isCustomerBase);
110
+ }
111
+ return prompt;
112
+ }
113
+ /**
114
+ * Creates the target folder prompt.
115
+ *
116
+ * @param {TargetFolderPromptOptions} [options] - Optional prompt options.
117
+ * @returns {AttributesQuestion} The prompt configuration for target folder.
118
+ */
119
+ function getTargetFolderPrompt(options) {
120
+ return {
121
+ type: 'input',
122
+ name: 'targetFolder',
123
+ message: (0, i18n_1.t)('prompts.projectFolderLabel'),
124
+ guiOptions: {
125
+ type: 'folder-browser',
126
+ applyDefaultWhenDirty: true,
127
+ mandatory: true,
128
+ breadcrumb: (0, i18n_1.t)('prompts.projectFolderPath')
129
+ },
130
+ validate: (value, answers) => (0, project_input_validator_1.validateProjectFolder)(value, answers.projectName),
131
+ default: (answers) => answers.targetFolder || options?.default,
132
+ store: false
133
+ };
134
+ }
135
+ /**
136
+ * Creates the UI5 version selection prompt.
137
+ *
138
+ * @param {string[]} ui5Versions - Array of available UI5 versions.
139
+ * @param {boolean} isVersionDetected - Whether a UI5 version was detected from the system.
140
+ * @param {boolean} isCloudProject - Whether the project is for a cloud-based system.
141
+ * @returns {AttributesQuestion} The prompt configuration for UI5 version.
142
+ */
143
+ function getUi5VersionPrompt(ui5Versions, isVersionDetected, isCloudProject) {
144
+ return {
145
+ type: 'list',
146
+ name: types_1.attributePromptNames.ui5Version,
147
+ message: (0, i18n_1.t)('prompts.ui5VersionLabel'),
148
+ when: !isCloudProject,
149
+ choices: ui5Versions,
150
+ guiOptions: {
151
+ applyDefaultWhenDirty: true,
152
+ hint: (0, i18n_1.t)('prompts.ui5VersionTooltip'),
153
+ breadcrumb: true,
154
+ mandatory: true
155
+ },
156
+ validate: async (version) => await (0, adp_tooling_1.validateUI5VersionExists)(version),
157
+ default: async () => await (0, default_values_1.getDefaultVersion)(ui5Versions),
158
+ additionalMessages: () => (0, additional_messages_1.getVersionAdditionalMessages)(isVersionDetected)
159
+ };
160
+ }
161
+ /**
162
+ * Only used in the CLI context when prompt is of type `list` because the validation does not run on CLI for the UI5 Version list prompt.
163
+ *
164
+ * @returns {YUIQuestion<AttributesAnswers>} Dummy prompt that runs in the CLI only.
165
+ */
166
+ function getUi5VersionValidationPromptForCli() {
167
+ return {
168
+ name: types_1.attributePromptNames.ui5ValidationCli,
169
+ when: async (answers) => {
170
+ if (!answers.ui5Version) {
171
+ return false;
172
+ }
173
+ const result = await (0, adp_tooling_1.validateUI5VersionExists)(answers.ui5Version);
174
+ if (typeof result === 'string') {
175
+ throw new Error(result);
176
+ }
177
+ return false;
178
+ }
179
+ };
180
+ }
181
+ /**
182
+ * Creates the TypeScript enablement confirm prompt.
183
+ *
184
+ * @param {EnableTypeScriptPromptOptions} [options] - Optional prompt options to control visibility.
185
+ * @returns {AttributesQuestion} The prompt configuration for TypeScript confirmation.
186
+ */
187
+ function getEnableTypeScriptPrompt(options) {
188
+ return {
189
+ type: 'confirm',
190
+ name: types_1.attributePromptNames.enableTypeScript,
191
+ message: 'Enable TypeScript',
192
+ default: false,
193
+ when: options?.hide ?? true,
194
+ guiOptions: {
195
+ breadcrumb: true
196
+ }
197
+ };
198
+ }
199
+ //# sourceMappingURL=attributes.js.map
@@ -2,11 +2,10 @@ import { FlexLayer } from '@sap-ux/adp-tooling';
2
2
  import type { ToolsLogger } from '@sap-ux/logger';
3
3
  import type { Manifest } from '@sap-ux/project-access';
4
4
  import { type AbapServiceProvider } from '@sap-ux/axios-extension';
5
- import type { SystemLookup } from '@sap-ux/adp-tooling';
5
+ import type { SystemLookup, UI5Version } from '@sap-ux/adp-tooling';
6
6
  import type { ConfigPromptOptions, ConfigQuestion } from '../types';
7
7
  /**
8
8
  * A stateful prompter class that creates configuration questions.
9
- * This class accepts the needed dependencies and keeps track of state (e.g. the ApplicationManager instance).
10
9
  * It exposes a single public method {@link getPrompts} to retrieve the configuration questions.
11
10
  */
12
11
  export declare class ConfigPrompter {
@@ -65,9 +64,33 @@ export declare class ConfigPrompter {
65
64
  */
66
65
  private isPartiallySupported;
67
66
  /**
68
- * UI5 version manager for handling version-related validations.
67
+ * UI5 versions in string format.
69
68
  */
70
- private readonly ui5Info;
69
+ private ui5Versions;
70
+ /**
71
+ * Publicly available UI5 versions.
72
+ */
73
+ private publicVersions;
74
+ /**
75
+ * System UI5 version.
76
+ */
77
+ private systemVersion;
78
+ /**
79
+ * Returns the needed ui5 properties from calling the CDN.
80
+ *
81
+ * @returns Object with properties related to ui5.
82
+ */
83
+ get ui5(): {
84
+ ui5Versions: string[];
85
+ systemVersion: string | undefined;
86
+ publicVersions: UI5Version;
87
+ };
88
+ /**
89
+ * Returns flag indicating if the project is a cloud project.
90
+ *
91
+ * @returns Whether system is cloud-ready.
92
+ */
93
+ get isCloud(): boolean;
71
94
  /**
72
95
  * Returns the configured abap provider instance.
73
96
  *
@@ -79,7 +102,7 @@ export declare class ConfigPrompter {
79
102
  *
80
103
  * @returns Application manifest.
81
104
  */
82
- get manifest(): Manifest;
105
+ get manifest(): Manifest | undefined;
83
106
  /**
84
107
  * Indicates whether the application loads views synchronously.
85
108
  *
@@ -172,14 +195,14 @@ export declare class ConfigPrompter {
172
195
  /**
173
196
  * Validates the selected application to ensure it is supported.
174
197
  *
175
- * @param {Application} app - The application to validate.
198
+ * @param {SourceApplication} app - The application to validate.
176
199
  * @returns {Promise<boolean | string>} True if the application is valid, otherwise an error message.
177
200
  */
178
201
  private validateAppData;
179
202
  /**
180
203
  * Evaluate if the application version supports certain features.
181
204
  *
182
- * @param {Application} application - The application data.
205
+ * @param {SourceApplication} application - The application data.
183
206
  */
184
207
  private evaluateAppSupport;
185
208
  /**
@@ -187,20 +210,19 @@ export declare class ConfigPrompter {
187
210
  *
188
211
  * @returns A promise that resolves when system data is fetched.
189
212
  */
190
- private getSystemData;
213
+ private loadSystemData;
191
214
  /**
192
- * Handles the fetching and validation of system data.
215
+ * Fetches and processes SAPUI5 version data from the system and public sources.
193
216
  *
194
- * @returns {Promise<boolean | string>} True if successful, or an error message if an error occurs.
217
+ * @returns {Promise<void>} A promise that resolves once all version data is loaded and assigned.
195
218
  */
196
- private handleSystemDataValidation;
219
+ private loadUI5Versions;
197
220
  /**
198
- * Validates the UI5 system version based on the provided value or fetches all relevant versions if no value is provided.
199
- * Updates the internal state with the fetched versions and the detection status.
221
+ * Handles the fetching and validation of system data.
200
222
  *
201
- * @returns {Promise<void>} Resolves after checking system ui5 version.
223
+ * @returns {Promise<boolean | string>} True if successful, or an error message if an error occurs.
202
224
  */
203
- private validateSystemVersion;
225
+ private handleSystemDataValidation;
204
226
  /**
205
227
  * Handles errors that occur while fetching system information, setting default values and rethrowing if necessary.
206
228
  *
@@ -11,7 +11,6 @@ const conditions_1 = require("./helper/conditions");
11
11
  const additional_messages_1 = require("./helper/additional-messages");
12
12
  /**
13
13
  * A stateful prompter class that creates configuration questions.
14
- * This class accepts the needed dependencies and keeps track of state (e.g. the ApplicationManager instance).
15
14
  * It exposes a single public method {@link getPrompts} to retrieve the configuration questions.
16
15
  */
17
16
  class ConfigPrompter {
@@ -70,9 +69,37 @@ class ConfigPrompter {
70
69
  */
71
70
  isPartiallySupported = false;
72
71
  /**
73
- * UI5 version manager for handling version-related validations.
72
+ * UI5 versions in string format.
74
73
  */
75
- ui5Info;
74
+ ui5Versions;
75
+ /**
76
+ * Publicly available UI5 versions.
77
+ */
78
+ publicVersions;
79
+ /**
80
+ * System UI5 version.
81
+ */
82
+ systemVersion;
83
+ /**
84
+ * Returns the needed ui5 properties from calling the CDN.
85
+ *
86
+ * @returns Object with properties related to ui5.
87
+ */
88
+ get ui5() {
89
+ return {
90
+ ui5Versions: this.ui5Versions,
91
+ systemVersion: this.systemVersion,
92
+ publicVersions: this.publicVersions
93
+ };
94
+ }
95
+ /**
96
+ * Returns flag indicating if the project is a cloud project.
97
+ *
98
+ * @returns Whether system is cloud-ready.
99
+ */
100
+ get isCloud() {
101
+ return !!this.isCloudProject;
102
+ }
76
103
  /**
77
104
  * Returns the configured abap provider instance.
78
105
  *
@@ -87,7 +114,7 @@ class ConfigPrompter {
87
114
  * @returns Application manifest.
88
115
  */
89
116
  get manifest() {
90
- return this.manifest;
117
+ return this.appManifest;
91
118
  }
92
119
  /**
93
120
  * Indicates whether the application loads views synchronously.
@@ -108,7 +135,6 @@ class ConfigPrompter {
108
135
  this.systemLookup = systemLookup;
109
136
  this.logger = logger;
110
137
  this.isCustomerBase = layer === "CUSTOMER_BASE" /* FlexLayer.CUSTOMER_BASE */;
111
- this.ui5Info = adp_tooling_1.UI5VersionInfo.getInstance(layer);
112
138
  }
113
139
  /**
114
140
  * Retrieves an array of configuration questions based on provided options.
@@ -305,7 +331,10 @@ class ConfigPrompter {
305
331
  };
306
332
  try {
307
333
  this.abapProvider = await (0, adp_tooling_1.getConfiguredProvider)(options, this.logger);
308
- await this.getSystemData();
334
+ const validationResult = await this.handleSystemDataValidation();
335
+ if (typeof validationResult === 'string') {
336
+ return validationResult;
337
+ }
309
338
  this.targetApps = await (0, adp_tooling_1.loadApps)(this.abapProvider, this.isCustomerBase);
310
339
  this.isLoginSuccessful = true;
311
340
  return true;
@@ -354,7 +383,7 @@ class ConfigPrompter {
354
383
  /**
355
384
  * Validates the selected application to ensure it is supported.
356
385
  *
357
- * @param {Application} app - The application to validate.
386
+ * @param {SourceApplication} app - The application to validate.
358
387
  * @returns {Promise<boolean | string>} True if the application is valid, otherwise an error message.
359
388
  */
360
389
  async validateAppData(app) {
@@ -378,12 +407,11 @@ class ConfigPrompter {
378
407
  /**
379
408
  * Evaluate if the application version supports certain features.
380
409
  *
381
- * @param {Application} application - The application data.
410
+ * @param {SourceApplication} application - The application data.
382
411
  */
383
412
  evaluateAppSupport(application) {
384
- const systemVersion = this.ui5Info.systemVersion;
385
- const isFullSupport = this.ui5Info.isVersionDetected && !(0, adp_tooling_1.isFeatureSupportedVersion)('1.96.0', systemVersion);
386
- const isPartialSupport = this.ui5Info.isVersionDetected && isFullSupport && (0, adp_tooling_1.isFeatureSupportedVersion)('1.90.0', systemVersion);
413
+ const isFullSupport = !!this.systemVersion && !(0, adp_tooling_1.isFeatureSupportedVersion)('1.96.0', this.systemVersion);
414
+ const isPartialSupport = !!this.systemVersion && isFullSupport && (0, adp_tooling_1.isFeatureSupportedVersion)('1.90.0', this.systemVersion);
387
415
  this.setSupportFlags(application, isFullSupport, isPartialSupport);
388
416
  }
389
417
  /**
@@ -391,7 +419,7 @@ class ConfigPrompter {
391
419
  *
392
420
  * @returns A promise that resolves when system data is fetched.
393
421
  */
394
- async getSystemData() {
422
+ async loadSystemData() {
395
423
  try {
396
424
  this.isCloudProject = await this.abapProvider.isAbapCloud();
397
425
  this.flexUISystem = await (0, adp_tooling_1.getFlexUISupportedSystem)(this.abapProvider, this.isCustomerBase);
@@ -400,6 +428,17 @@ class ConfigPrompter {
400
428
  this.handleSystemError(e);
401
429
  }
402
430
  }
431
+ /**
432
+ * Fetches and processes SAPUI5 version data from the system and public sources.
433
+ *
434
+ * @returns {Promise<void>} A promise that resolves once all version data is loaded and assigned.
435
+ */
436
+ async loadUI5Versions() {
437
+ const version = await (0, adp_tooling_1.getSystemUI5Version)(this.abapProvider);
438
+ this.systemVersion = (0, adp_tooling_1.checkSystemVersionPattern)(version);
439
+ this.publicVersions = await (0, adp_tooling_1.fetchPublicVersions)();
440
+ this.ui5Versions = await (0, adp_tooling_1.getRelevantVersions)(this.systemVersion, this.isCustomerBase, this.publicVersions);
441
+ }
403
442
  /**
404
443
  * Handles the fetching and validation of system data.
405
444
  *
@@ -407,8 +446,8 @@ class ConfigPrompter {
407
446
  */
408
447
  async handleSystemDataValidation() {
409
448
  try {
410
- await this.getSystemData();
411
- await this.validateSystemVersion();
449
+ await this.loadSystemData();
450
+ await this.loadUI5Versions();
412
451
  if (!this.isCustomerBase && this.isCloudProject) {
413
452
  return (0, i18n_1.t)('error.cloudSystemsForInternalUsers');
414
453
  }
@@ -419,22 +458,6 @@ class ConfigPrompter {
419
458
  return e.message;
420
459
  }
421
460
  }
422
- /**
423
- * Validates the UI5 system version based on the provided value or fetches all relevant versions if no value is provided.
424
- * Updates the internal state with the fetched versions and the detection status.
425
- *
426
- * @returns {Promise<void>} Resolves after checking system ui5 version.
427
- */
428
- async validateSystemVersion() {
429
- try {
430
- const version = await (0, adp_tooling_1.getSystemUI5Version)(this.abapProvider);
431
- await this.ui5Info.getRelevantVersions(version);
432
- }
433
- catch (e) {
434
- this.logger.debug(`Could not fetch system version: ${e.message}`);
435
- await this.ui5Info.getRelevantVersions();
436
- }
437
- }
438
461
  /**
439
462
  * Handles errors that occur while fetching system information, setting default values and rethrowing if necessary.
440
463
  *
@@ -1,4 +1,4 @@
1
- import { Severity } from '@sap-devx/yeoman-ui-types';
1
+ import type { IMessageSeverity } from '@sap-devx/yeoman-ui-types';
2
2
  import type { FlexUISupportedSystem, SourceApplication } from '@sap-ux/adp-tooling';
3
3
  interface SupportFlags {
4
4
  hasSyncViews: boolean;
@@ -11,13 +11,10 @@ interface SupportFlags {
11
11
  *
12
12
  * @param {FlexUISupportedSystem | undefined} flexUISystem - An optional object containing flags indicating if the system
13
13
  * is on-premise and whether UI Flex is enabled.
14
- * @param isCloudProject
15
- * @returns {{message: string, severity: Severity} | undefined} An object containing a message and its severity level.
14
+ * @param {boolean} isCloudProject - Whether the project is for a cloud-based system.
15
+ * @returns {IMessageSeverity | undefined} An object containing a message and its severity level.
16
16
  */
17
- export declare const getSystemAdditionalMessages: (flexUISystem: FlexUISupportedSystem | undefined, isCloudProject: boolean) => {
18
- message: string;
19
- severity: Severity;
20
- } | undefined;
17
+ export declare const getSystemAdditionalMessages: (flexUISystem: FlexUISupportedSystem | undefined, isCloudProject: boolean) => IMessageSeverity | undefined;
21
18
  /**
22
19
  * Provides an additional contextual message for the selected application, based on its compatibility,
23
20
  * feature support, or sync-loading behavior.
@@ -25,11 +22,15 @@ export declare const getSystemAdditionalMessages: (flexUISystem: FlexUISupported
25
22
  * @param {SourceApplication} app - The selected application object.
26
23
  * @param {SupportFlags} flags - Flags indicating support for sync views, Adp-over-Adp, and V4 internal apps.
27
24
  * @param {boolean} isApplicationSupported - Indicates whether the application is supported at all.
28
- * @returns {{ message: string; severity: Severity } | undefined} Message object or undefined if no message is applicable.
25
+ * @returns {IMessageSeverity | undefined} Message object or undefined if no message is applicable.
29
26
  */
30
- export declare const getAppAdditionalMessages: (app: SourceApplication, { hasSyncViews, isSupported, isPartiallySupported, isV4AppInternalMode }: SupportFlags, isApplicationSupported: boolean) => {
31
- message: string;
32
- severity: Severity;
33
- } | undefined;
27
+ export declare const getAppAdditionalMessages: (app: SourceApplication, { hasSyncViews, isSupported, isPartiallySupported, isV4AppInternalMode }: SupportFlags, isApplicationSupported: boolean) => IMessageSeverity | undefined;
28
+ /**
29
+ * Provides additional messages related to UI5 version detection based on system and authentication conditions.
30
+ *
31
+ * @param {boolean} isVersionDetected - Flag indicating that the system ui5 version was detected.
32
+ * @returns {object | undefined} An object containing a message and its severity level if conditions are met; otherwise, undefined.
33
+ */
34
+ export declare const getVersionAdditionalMessages: (isVersionDetected: boolean) => IMessageSeverity | undefined;
34
35
  export {};
35
36
  //# sourceMappingURL=additional-messages.d.ts.map
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getAppAdditionalMessages = exports.getSystemAdditionalMessages = void 0;
3
+ exports.getVersionAdditionalMessages = exports.getAppAdditionalMessages = exports.getSystemAdditionalMessages = void 0;
4
4
  const yeoman_ui_types_1 = require("@sap-devx/yeoman-ui-types");
5
5
  const axios_extension_1 = require("@sap-ux/axios-extension");
6
6
  const i18n_1 = require("../../../utils/i18n");
@@ -9,8 +9,8 @@ const i18n_1 = require("../../../utils/i18n");
9
9
  *
10
10
  * @param {FlexUISupportedSystem | undefined} flexUISystem - An optional object containing flags indicating if the system
11
11
  * is on-premise and whether UI Flex is enabled.
12
- * @param isCloudProject
13
- * @returns {{message: string, severity: Severity} | undefined} An object containing a message and its severity level.
12
+ * @param {boolean} isCloudProject - Whether the project is for a cloud-based system.
13
+ * @returns {IMessageSeverity | undefined} An object containing a message and its severity level.
14
14
  */
15
15
  const getSystemAdditionalMessages = (flexUISystem, isCloudProject) => {
16
16
  const isOnPremise = flexUISystem?.isOnPremise;
@@ -54,7 +54,7 @@ exports.getSystemAdditionalMessages = getSystemAdditionalMessages;
54
54
  * @param {SourceApplication} app - The selected application object.
55
55
  * @param {SupportFlags} flags - Flags indicating support for sync views, Adp-over-Adp, and V4 internal apps.
56
56
  * @param {boolean} isApplicationSupported - Indicates whether the application is supported at all.
57
- * @returns {{ message: string; severity: Severity } | undefined} Message object or undefined if no message is applicable.
57
+ * @returns {IMessageSeverity | undefined} Message object or undefined if no message is applicable.
58
58
  */
59
59
  const getAppAdditionalMessages = (app, { hasSyncViews, isSupported, isPartiallySupported, isV4AppInternalMode }, isApplicationSupported) => {
60
60
  if (!app) {
@@ -84,6 +84,23 @@ const getAppAdditionalMessages = (app, { hasSyncViews, isSupported, isPartiallyS
84
84
  severity: yeoman_ui_types_1.Severity.warning
85
85
  };
86
86
  }
87
+ return undefined;
87
88
  };
88
89
  exports.getAppAdditionalMessages = getAppAdditionalMessages;
90
+ /**
91
+ * Provides additional messages related to UI5 version detection based on system and authentication conditions.
92
+ *
93
+ * @param {boolean} isVersionDetected - Flag indicating that the system ui5 version was detected.
94
+ * @returns {object | undefined} An object containing a message and its severity level if conditions are met; otherwise, undefined.
95
+ */
96
+ const getVersionAdditionalMessages = (isVersionDetected) => {
97
+ if (!isVersionDetected) {
98
+ return {
99
+ message: (0, i18n_1.t)('validators.ui5VersionNotDetectedError'),
100
+ severity: yeoman_ui_types_1.Severity.warning
101
+ };
102
+ }
103
+ return undefined;
104
+ };
105
+ exports.getVersionAdditionalMessages = getVersionAdditionalMessages;
89
106
  //# sourceMappingURL=additional-messages.js.map
@@ -1,25 +1,25 @@
1
- import { FlexLayer } from '@sap-ux/adp-tooling';
2
1
  /**
3
2
  * Generates a namespace for a project based on its layer.
4
3
  *
5
4
  * @param {string} projectName - The name of the project.
6
- * @param {FlexLayer} layer - The UI5 Flex layer, indicating the deployment layer (e.g., CUSTOMER_BASE).
5
+ * @param {FlexLayer} isCustomerBase - Indicates the deployment layer (e.g., CUSTOMER_BASE).
7
6
  * @returns {string} The namespace string, prefixed appropriately if it's a customer base project.
8
7
  */
9
- export declare function generateValidNamespace(projectName: string, layer: FlexLayer): string;
8
+ export declare function getDefaultNamespace(projectName: string, isCustomerBase: boolean): string;
10
9
  /**
11
- * Retrieves a list of project directory names that match a specific naming pattern from the given directory path.
10
+ * Generates a default project name based on the existing projects in the specified directory.
12
11
  *
13
- * @param {string} path - The directory path from which to list project names.
14
- * @param {RegExp} regex - The specific naming pattern to filter by.
15
- * @returns {string[]} An array of project names that match the pattern /^app\.variant[0-9]{1,3}$/, sorted in reverse order.
12
+ * @param {string} basePath - Base path of the project.
13
+ * @param {string} dirName - Directory name to search for.
14
+ * @returns {string} A default project name with an incremented index if similar projects exist.
16
15
  */
17
- export declare function getProjectNames(path: string, regex?: RegExp): string[];
16
+ export declare function getDefaultProjectName(basePath: string, dirName?: string): string;
18
17
  /**
19
- * Generates a default project name based on the existing projects in the specified directory.
18
+ * Gets the default UI5 version from the system versions list by validating the first available version.
19
+ * If the first version is valid according to the UI5 service, it returns that version; otherwise, returns an empty string.
20
20
  *
21
- * @param {string} path - The directory path where projects are located.
22
- * @returns {string} A default project name with an incremented index if similar projects exist.
21
+ * @param {string[]} ui5Versions Array of available versions.
22
+ * @returns {Promise<string>} The valid UI5 version or an empty string if the first version is not valid or if there are no versions.
23
23
  */
24
- export declare function getDefaultProjectName(path: string): string;
24
+ export declare function getDefaultVersion(ui5Versions: string[]): Promise<string>;
25
25
  //# sourceMappingURL=default-values.d.ts.map
@@ -1,54 +1,51 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getDefaultProjectName = exports.getProjectNames = exports.generateValidNamespace = void 0;
3
+ exports.getDefaultVersion = exports.getDefaultProjectName = exports.getDefaultNamespace = void 0;
4
+ const path_1 = require("path");
4
5
  const fs_1 = require("fs");
5
- const APP_VARIANT_REGEX = /^app[.]variant\d{1,3}$/;
6
+ const adp_tooling_1 = require("@sap-ux/adp-tooling");
7
+ const DEFAULT_PREFIX = 'app.variant';
6
8
  /**
7
9
  * Generates a namespace for a project based on its layer.
8
10
  *
9
11
  * @param {string} projectName - The name of the project.
10
- * @param {FlexLayer} layer - The UI5 Flex layer, indicating the deployment layer (e.g., CUSTOMER_BASE).
12
+ * @param {FlexLayer} isCustomerBase - Indicates the deployment layer (e.g., CUSTOMER_BASE).
11
13
  * @returns {string} The namespace string, prefixed appropriately if it's a customer base project.
12
14
  */
13
- function generateValidNamespace(projectName, layer) {
14
- return layer === "CUSTOMER_BASE" /* FlexLayer.CUSTOMER_BASE */ ? `customer.${projectName}` : projectName;
15
+ function getDefaultNamespace(projectName, isCustomerBase) {
16
+ return isCustomerBase ? `customer.${projectName}` : projectName;
15
17
  }
16
- exports.generateValidNamespace = generateValidNamespace;
18
+ exports.getDefaultNamespace = getDefaultNamespace;
17
19
  /**
18
- * Retrieves a list of project directory names that match a specific naming pattern from the given directory path.
20
+ * Generates a default project name based on the existing projects in the specified directory.
19
21
  *
20
- * @param {string} path - The directory path from which to list project names.
21
- * @param {RegExp} regex - The specific naming pattern to filter by.
22
- * @returns {string[]} An array of project names that match the pattern /^app\.variant[0-9]{1,3}$/, sorted in reverse order.
22
+ * @param {string} basePath - Base path of the project.
23
+ * @param {string} dirName - Directory name to search for.
24
+ * @returns {string} A default project name with an incremented index if similar projects exist.
23
25
  */
24
- function getProjectNames(path, regex = APP_VARIANT_REGEX) {
25
- return (0, fs_1.readdirSync)(path, { withFileTypes: true })
26
- .filter((dirent) => !dirent.isFile() && regex.test(dirent.name))
27
- .map((dirent) => dirent.name)
28
- .sort((a, b) => {
29
- const numA = parseInt(a.replace('app.variant', ''), 10);
30
- const numB = parseInt(b.replace('app.variant', ''), 10);
31
- return numA - numB;
32
- })
33
- .reverse();
26
+ function getDefaultProjectName(basePath, dirName = DEFAULT_PREFIX) {
27
+ let newDir = dirName;
28
+ let index = 1;
29
+ while ((0, fs_1.existsSync)((0, path_1.join)(basePath, newDir))) {
30
+ index++;
31
+ newDir = `${dirName}${index}`;
32
+ }
33
+ return newDir;
34
34
  }
35
- exports.getProjectNames = getProjectNames;
35
+ exports.getDefaultProjectName = getDefaultProjectName;
36
36
  /**
37
- * Generates a default project name based on the existing projects in the specified directory.
37
+ * Gets the default UI5 version from the system versions list by validating the first available version.
38
+ * If the first version is valid according to the UI5 service, it returns that version; otherwise, returns an empty string.
38
39
  *
39
- * @param {string} path - The directory path where projects are located.
40
- * @returns {string} A default project name with an incremented index if similar projects exist.
40
+ * @param {string[]} ui5Versions Array of available versions.
41
+ * @returns {Promise<string>} The valid UI5 version or an empty string if the first version is not valid or if there are no versions.
41
42
  */
42
- function getDefaultProjectName(path) {
43
- const projectNames = getProjectNames(path);
44
- const defaultPrefix = 'app.variant';
45
- if (projectNames.length === 0) {
46
- return `${defaultPrefix}1`;
43
+ async function getDefaultVersion(ui5Versions) {
44
+ if (ui5Versions?.length === 0) {
45
+ return '';
47
46
  }
48
- const lastProject = projectNames[0];
49
- const lastProjectIdx = lastProject.replace(defaultPrefix, '');
50
- const newProjectIndex = parseInt(lastProjectIdx, 10) + 1;
51
- return `${defaultPrefix}${newProjectIndex}`;
47
+ const isValid = await (0, adp_tooling_1.validateUI5VersionExists)(ui5Versions[0]);
48
+ return isValid === true ? ui5Versions[0] : '';
52
49
  }
53
- exports.getDefaultProjectName = getDefaultProjectName;
50
+ exports.getDefaultVersion = getDefaultVersion;
54
51
  //# sourceMappingURL=default-values.js.map
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Returns a tooltip message for project name input fields, customized based on the project's user layer.
3
+ *
4
+ * @param {boolean} isCustomerBase - Determines if the tooltip is for a customer base project.
5
+ * @returns {string} A tooltip message with specific validation rules.
6
+ */
7
+ export declare function getProjectNameTooltip(isCustomerBase: boolean): string;
8
+ //# sourceMappingURL=tooltip.d.ts.map
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getProjectNameTooltip = void 0;
4
+ const i18n_1 = require("../../../utils/i18n");
5
+ /**
6
+ * Returns a tooltip message for project name input fields, customized based on the project's user layer.
7
+ *
8
+ * @param {boolean} isCustomerBase - Determines if the tooltip is for a customer base project.
9
+ * @returns {string} A tooltip message with specific validation rules.
10
+ */
11
+ function getProjectNameTooltip(isCustomerBase) {
12
+ const baseType = isCustomerBase ? 'Ext' : 'Int';
13
+ const lengthErrorMsg = (0, i18n_1.t)(`prompts.projectNameLengthError${baseType}`);
14
+ const validationErrorMsg = (0, i18n_1.t)(`prompts.projectNameValidationError${baseType}`);
15
+ return `${lengthErrorMsg} ${validationErrorMsg}`;
16
+ }
17
+ exports.getProjectNameTooltip = getProjectNameTooltip;
18
+ //# sourceMappingURL=tooltip.js.map
@@ -1,6 +1,6 @@
1
1
  import type Generator from 'yeoman-generator';
2
2
  import type { AppWizard } from '@sap-devx/yeoman-ui-types';
3
- import type { ConfigAnswers } from '@sap-ux/adp-tooling';
3
+ import type { AttributesAnswers, ConfigAnswers } from '@sap-ux/adp-tooling';
4
4
  import type { YUIQuestion } from '@sap-ux/inquirer-common';
5
5
  import type { TelemetryData } from '@sap-ux/fiori-generator-shared';
6
6
  export interface AdpGeneratorOptions extends Generator.GeneratorOptions {
@@ -71,4 +71,43 @@ export type ConfigPromptOptions = Partial<{
71
71
  [configPromptNames.application]: ApplicationPromptOptions;
72
72
  [configPromptNames.appValidationCli]: CliValidationPromptOptions;
73
73
  }>;
74
+ export declare enum attributePromptNames {
75
+ projectName = "projectName",
76
+ title = "title",
77
+ namespace = "namespace",
78
+ targetFolder = "targetFolder",
79
+ ui5Version = "ui5Version",
80
+ ui5ValidationCli = "ui5ValidationCli",
81
+ enableTypeScript = "enableTypeScript"
82
+ }
83
+ export type AttributesQuestion = YUIQuestion<AttributesAnswers>;
84
+ export interface ProjectNamePromptOptions {
85
+ hide?: boolean;
86
+ }
87
+ export interface ApplicationTitlePromptOptions {
88
+ default?: string;
89
+ hide?: boolean;
90
+ }
91
+ export interface NamespacePromptOptions {
92
+ default?: string;
93
+ hide?: boolean;
94
+ }
95
+ export interface TargetFolderPromptOptions {
96
+ default?: string;
97
+ }
98
+ export interface UI5VersionPromptOptions {
99
+ default?: string;
100
+ }
101
+ export interface EnableTypeScriptPromptOptions {
102
+ hide?: boolean;
103
+ }
104
+ export type AttributePromptOptions = Partial<{
105
+ [attributePromptNames.projectName]: ProjectNamePromptOptions;
106
+ [attributePromptNames.title]: ApplicationTitlePromptOptions;
107
+ [attributePromptNames.namespace]: NamespacePromptOptions;
108
+ [attributePromptNames.targetFolder]: TargetFolderPromptOptions;
109
+ [attributePromptNames.ui5Version]: UI5VersionPromptOptions;
110
+ [attributePromptNames.ui5ValidationCli]: CliValidationPromptOptions;
111
+ [attributePromptNames.enableTypeScript]: EnableTypeScriptPromptOptions;
112
+ }>;
74
113
  //# sourceMappingURL=types.d.ts.map
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.configPromptNames = void 0;
3
+ exports.attributePromptNames = exports.configPromptNames = void 0;
4
4
  /**
5
5
  * Enumeration of prompt names used in the configuration.
6
6
  */
@@ -13,4 +13,14 @@ var configPromptNames;
13
13
  configPromptNames["application"] = "application";
14
14
  configPromptNames["appValidationCli"] = "appValidationCli";
15
15
  })(configPromptNames || (exports.configPromptNames = configPromptNames = {}));
16
+ var attributePromptNames;
17
+ (function (attributePromptNames) {
18
+ attributePromptNames["projectName"] = "projectName";
19
+ attributePromptNames["title"] = "title";
20
+ attributePromptNames["namespace"] = "namespace";
21
+ attributePromptNames["targetFolder"] = "targetFolder";
22
+ attributePromptNames["ui5Version"] = "ui5Version";
23
+ attributePromptNames["ui5ValidationCli"] = "ui5ValidationCli";
24
+ attributePromptNames["enableTypeScript"] = "enableTypeScript";
25
+ })(attributePromptNames || (exports.attributePromptNames = attributePromptNames = {}));
16
26
  //# sourceMappingURL=types.js.map
@@ -1,7 +1,9 @@
1
1
  {
2
2
  "yuiNavSteps": {
3
3
  "configurationName": "System and Application Selection",
4
- "configurationDescr": "Configure the system and select an application."
4
+ "configurationDescr": "Configure the system and select an application.",
5
+ "projectAttributesName": "Project Attributes",
6
+ "projectAttributesDescr": "Configure the main project attributes."
5
7
  },
6
8
  "prompts": {
7
9
  "systemLabel": "System",
@@ -13,10 +15,24 @@
13
15
  "applicationListLabel": "Application",
14
16
  "applicationListTooltip": "Select the application for which you want to create an app variant.",
15
17
  "projectTypeLabel": "Project Type",
18
+ "projectNameLabel": "Project Name",
19
+ "projectNameTooltip": "Enter the project name for your app variant.",
20
+ "appTitleLabel": "Application Title",
21
+ "appTitleTooltip": "Enter the application title for your app variant.",
22
+ "appTitleDefault": "App Variant Title",
23
+ "namespaceLabel": "Namespace",
24
+ "projectFolderLabel": "Project Folder Path",
25
+ "projectFolderPath": "Project Path",
26
+ "ui5VersionLabel": "SAPUI5 Version",
27
+ "ui5VersionTooltip": "Select the SAPUI5 version you want to use to preview your app variant.",
16
28
  "appInfoLabel": "Synchronous views are detected for this application. Therefore, the controller extensions are not supported. Controller extension functionality on these views will be disabled.",
17
29
  "notSupportedAdpOverAdpLabel": "You have selected 'Adaptation Project' as the base. The selected system has a SAPUI5 version lower than 1.90. Therefore, it does not support 'Adaptation Project' as а base for a new adaptation project. You will be able to create such а project, but after deployment it will not work until the SAPUI5 version of the system is updated.",
18
30
  "isPartiallySupportedAdpOverAdpLabel": "You have selected 'Adaptation Project' as the base. The selected system has a SAPUI5 version lower than 1.96 and in order for your adaptation project based on adaptation project to work after deployment, you will need to apply SAP Note 756 SP0 on your system.",
19
- "v4AppNotOfficialLabel": "You have selected an app based on SAP Fiori elements for OData V4. Note the following important information when you create adaptation changes: https://wiki.wdf.sap.corp/wiki/display/fioritech/Adaptation+Project+Support"
31
+ "v4AppNotOfficialLabel": "You have selected an app based on SAP Fiori elements for OData V4. Note the following important information when you create adaptation changes: https://wiki.wdf.sap.corp/wiki/display/fioritech/Adaptation+Project+Support",
32
+ "projectNameLengthErrorExt": "The name cannot contain more than 61 characters or end with the word 'component'.",
33
+ "projectNameValidationErrorExt": "The name must contain only latin alphanumeric characters. Different parts can be separated by a period and every part must start with a letter.",
34
+ "projectNameLengthErrorInt": "The name cannot start with the word 'customer', or contain more than 61 characters, or end with the word 'component'.",
35
+ "projectNameValidationErrorInt": "The name must contain only latin alphanumeric characters and it must have at least two parts. The different parts must be separated by a period and every part must start with a letter."
20
36
  },
21
37
  "error": {
22
38
  "selectCannotBeEmptyError": "{{value}} has to be selected.",
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@sap-ux/generator-adp",
3
3
  "displayName": "SAPUI5 Adaptation Project",
4
4
  "description": "Adaptation project allows you to create an app variant for an existing SAP Fiori elements-based or SAPUI5 freestyle application, without changing the original application.",
5
- "version": "0.1.7",
5
+ "version": "0.1.9",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/SAP/open-ux-tools.git",
@@ -29,16 +29,16 @@
29
29
  "i18next": "23.5.1",
30
30
  "yeoman-generator": "5.10.0",
31
31
  "uuid": "10.0.0",
32
- "@sap-ux/adp-tooling": "0.13.28",
33
- "@sap-ux/axios-extension": "1.19.3",
32
+ "@sap-ux/adp-tooling": "0.13.30",
33
+ "@sap-ux/axios-extension": "1.20.0",
34
34
  "@sap-ux/btp-utils": "1.0.3",
35
35
  "@sap-ux/feature-toggle": "0.2.3",
36
36
  "@sap-ux/inquirer-common": "0.6.35",
37
37
  "@sap-ux/logger": "0.6.0",
38
38
  "@sap-ux/project-access": "1.29.18",
39
39
  "@sap-ux/store": "1.0.0",
40
- "@sap-ux/system-access": "0.5.35",
41
- "@sap-ux/project-input-validator": "0.5.0",
40
+ "@sap-ux/system-access": "0.5.36",
41
+ "@sap-ux/project-input-validator": "0.5.1",
42
42
  "@sap-ux/fiori-generator-shared": "0.10.2"
43
43
  },
44
44
  "devDependencies": {