@sap-ux/cf-deploy-config-sub-generator 0.1.27 → 0.1.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.
@@ -30,6 +30,7 @@ export default class extends DeploymentGenerator {
30
30
  private destinationName;
31
31
  private abort;
32
32
  private deployConfigExists;
33
+ private packageName;
33
34
  /**
34
35
  * Constructor for the CF deployment configuration generator.
35
36
  *
@@ -43,6 +43,7 @@ class default_1 extends deploy_config_generator_shared_1.DeploymentGenerator {
43
43
  destinationName;
44
44
  abort = false;
45
45
  deployConfigExists = false;
46
+ packageName;
46
47
  /**
47
48
  * Constructor for the CF deployment configuration generator.
48
49
  *
@@ -114,6 +115,13 @@ class default_1 extends deploy_config_generator_shared_1.DeploymentGenerator {
114
115
  }
115
116
  this.isCap = true;
116
117
  this.projectRoot = capRoot;
118
+ try {
119
+ this.packageName =
120
+ this.fs.readJSON((0, path_1.join)(this.projectRoot, project_access_1.FileName.Package))?.name ?? '';
121
+ }
122
+ catch {
123
+ // Ignore errors while reading the package.json file, will be handled in the validators of the respective modules
124
+ }
117
125
  }
118
126
  else if (this.mtaPath) {
119
127
  this.projectRoot = (0, path_1.dirname)(this.mtaPath);
@@ -150,6 +158,7 @@ class default_1 extends deploy_config_generator_shared_1.DeploymentGenerator {
150
158
  return;
151
159
  }
152
160
  // Configure defaults
161
+ this.appRouterAnswers.mtaId = this.packageName; // Required for the MTA validation
153
162
  this.destinationName = cf_deploy_config_writer_1.DefaultMTADestination;
154
163
  this.options.overwrite = true; // Don't prompt the user to overwrite files we've just written!
155
164
  this.answers = {};
@@ -217,7 +226,7 @@ class default_1 extends deploy_config_generator_shared_1.DeploymentGenerator {
217
226
  await this._writing();
218
227
  }
219
228
  else {
220
- // Need to delay `init` as the yaml configurations wont be ready!
229
+ // Need to delay `init` as the yaml configurations won't be ready!
221
230
  await this._init();
222
231
  await this._writing();
223
232
  }
@@ -57,7 +57,7 @@ async function getCFApprouterQuestionsForCap({ projectRoot }) {
57
57
  // Disable some prompts, not required for CAP flow
58
58
  const appRouterPromptOptions = {
59
59
  [cf_deploy_config_inquirer_1.appRouterPromptNames.mtaPath]: projectRoot,
60
- [cf_deploy_config_inquirer_1.appRouterPromptNames.mtaId]: true,
60
+ [cf_deploy_config_inquirer_1.appRouterPromptNames.mtaId]: false, // CDS Flow will auto generate this based on the package.json name property
61
61
  [cf_deploy_config_inquirer_1.appRouterPromptNames.mtaDescription]: false,
62
62
  [cf_deploy_config_inquirer_1.appRouterPromptNames.mtaVersion]: false,
63
63
  [cf_deploy_config_inquirer_1.appRouterPromptNames.routerType]: true,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sap-ux/cf-deploy-config-sub-generator",
3
3
  "description": "Generators for configuring Cloud Foundry deployment configuration",
4
- "version": "0.1.27",
4
+ "version": "0.1.28",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/SAP/open-ux-tools.git",
@@ -25,12 +25,12 @@
25
25
  "yeoman-generator": "5.10.0",
26
26
  "@sap-ux/btp-utils": "1.0.2",
27
27
  "@sap-ux/cf-deploy-config-writer": "0.1.22",
28
- "@sap-ux/cf-deploy-config-inquirer": "0.2.18",
28
+ "@sap-ux/cf-deploy-config-inquirer": "0.2.19",
29
29
  "@sap-ux/deploy-config-generator-shared": "0.0.37",
30
30
  "@sap-ux/feature-toggle": "0.2.3",
31
31
  "@sap-ux/fiori-generator-shared": "0.9.9",
32
- "@sap-ux/i18n": "0.2.3",
33
32
  "@sap-ux/inquirer-common": "0.6.29",
33
+ "@sap-ux/i18n": "0.2.3",
34
34
  "@sap-ux/project-access": "1.29.16",
35
35
  "@sap-ux/ui5-config": "0.26.4"
36
36
  },