@sap-ux/cf-deploy-config-writer 0.2.3 → 0.2.5

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.
@@ -203,6 +203,9 @@ async function updateMtaConfig(cfConfig, fs) {
203
203
  const appModule = cfConfig.appId;
204
204
  const appRelativePath = (0, utils_1.toPosixPath)((0, path_1.relative)(cfConfig.rootPath, cfConfig.appPath));
205
205
  await mtaInstance.addApp(appModule, appRelativePath ?? '.');
206
+ if (mtaInstance.hasAppFrontendRouter()) {
207
+ cfConfig.addAppFrontendRouter = true;
208
+ }
206
209
  await (0, mta_config_1.addMtaDeployParameters)(mtaInstance);
207
210
  if ((cfConfig.addMtaDestination && cfConfig.isCap) || cfConfig.destinationName === constants_1.DefaultMTADestination) {
208
211
  // If the destination instance identifier is passed, create a destination instance
@@ -118,6 +118,12 @@ export declare class MtaConfig {
118
118
  * @returns {string | undefined} the cloud service name
119
119
  */
120
120
  get cloudServiceName(): string | undefined;
121
+ /**
122
+ * Returns true if the MTA contains an approuter module of type App Frontend Service.
123
+ *
124
+ * @returns {boolean} true if the mta contains an App Frontend Service
125
+ */
126
+ hasAppFrontendRouter(): boolean;
121
127
  /**
122
128
  * Returns the mta parameters.
123
129
  *
@@ -351,17 +351,19 @@ class MtaConfig {
351
351
  */
352
352
  async cleanupMissingResources() {
353
353
  this.log?.debug((0, i18n_1.t)('debug.addMissingModules'));
354
- if (!this.modules.has('com.sap.application.content:resource')) {
355
- await this.addAppContent();
356
- }
357
- // For Approuter Configuration generators, the destination resource is missing for both Standalone | Managed
358
- if (this.resources.get('destination')) {
359
- // Ensure the resource is added
360
- await this.updateDestinationResource(this.modules.has('com.sap.application.content:destination'));
361
- }
362
- else {
363
- // No destination resource found, add it, more common for standalone
364
- await this.addDestinationResource(this.modules.has('com.sap.application.content:destination'));
354
+ if (!this.modules.has('com.sap.application.content:appfront')) {
355
+ if (!this.modules.has('com.sap.application.content:resource')) {
356
+ await this.addAppContent();
357
+ }
358
+ // For Approuter Configuration generators, the destination resource is missing for both Standalone | Managed
359
+ if (this.resources.get('destination')) {
360
+ // Ensure the resource is added
361
+ await this.updateDestinationResource(this.modules.has('com.sap.application.content:destination'));
362
+ }
363
+ else {
364
+ // No destination resource found, add it, more common for standalone
365
+ await this.addDestinationResource(this.modules.has('com.sap.application.content:destination'));
366
+ }
365
367
  }
366
368
  }
367
369
  async cleanupModules() {
@@ -429,6 +431,14 @@ class MtaConfig {
429
431
  });
430
432
  return cloudServiceName;
431
433
  }
434
+ /**
435
+ * Returns true if the MTA contains an approuter module of type App Frontend Service.
436
+ *
437
+ * @returns {boolean} true if the mta contains an App Frontend Service
438
+ */
439
+ hasAppFrontendRouter() {
440
+ return this.modules.has('com.sap.application.content:appfront');
441
+ }
432
442
  /**
433
443
  * Returns the mta parameters.
434
444
  *
package/dist/utils.js CHANGED
@@ -167,7 +167,7 @@ async function generateSupportingConfig(config, fs) {
167
167
  if ((config.addManagedAppRouter || config.addAppFrontendRouter) &&
168
168
  mtaConfig.mtaId &&
169
169
  !fs.exists((0, path_1.join)(config.rootPath, constants_1.XSSecurityFile))) {
170
- addXSSecurityConfig(mtaConfig, fs, config.addManagedAppRouter);
170
+ addXSSecurityConfig(mtaConfig, fs, true);
171
171
  }
172
172
  // Be a good citizen and add a .gitignore if missing from the existing project root
173
173
  if (!fs.exists((0, path_1.join)(config.rootPath, '.gitignore'))) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sap-ux/cf-deploy-config-writer",
3
3
  "description": "Add or amend Cloud Foundry and ABAP deployment configuration for SAP projects",
4
- "version": "0.2.3",
4
+ "version": "0.2.5",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/SAP/open-ux-tools.git",
@@ -29,10 +29,10 @@
29
29
  "mem-fs": "2.1.0",
30
30
  "mem-fs-editor": "9.4.0",
31
31
  "hasbin": "1.2.3",
32
- "@sap-ux/yaml": "0.16.0",
32
+ "@sap-ux/project-access": "1.29.18",
33
33
  "@sap-ux/btp-utils": "1.0.3",
34
+ "@sap-ux/yaml": "0.16.0",
34
35
  "@sap-ux/logger": "0.6.0",
35
- "@sap-ux/project-access": "1.29.18",
36
36
  "@sap-ux/ui5-config": "0.26.5",
37
37
  "@sap-ux/nodejs-utils": "0.1.9"
38
38
  },