@sap-ux/cf-deploy-config-writer 0.3.10 → 0.3.11

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.
package/README.md CHANGED
@@ -16,8 +16,8 @@ Yarn
16
16
  Pnpm
17
17
  `pnpm add @sap-ux/cf-deploy-config-writer`
18
18
 
19
- ## Example: Reading and writing MTA Configurations
20
- Generate an `MtaConfig` instance to read an `mta.yaml` configuration to allow you append different resources and modules. For example HTML5 resources, routing modules or append mta extension configurations.
19
+ ## Example: Reading and Writing MTA Configurations
20
+ Generate an `MtaConfig` instance to read an `mta.yaml` configuration to allow you to append different resources and modules. For example HTML5 resources, routing modules or append mta extension configurations.
21
21
 
22
22
  Dependent on the [MTA Tool](https://www.npmjs.com/package/mta) being installed globally on your dev space.
23
23
  - For VSCode, run the command `npm i -g mta`
@@ -43,7 +43,7 @@ await mtaConfig.addMtaExtensionConfig('mynewdestination', 'https://my-service-ur
43
43
  await mtaConfig.save();
44
44
  ```
45
45
 
46
- ## Example: Appending a Managed Approuter Configuration to an SAP Fiori UI5 Application
46
+ ## Example: Appending a `Managed` Approuter Configuration to an SAP Fiori UI5 Application
47
47
 
48
48
  Calling the `generateAppConfig` function to append Cloud Foundry configuration to a HTML5 application, assumes `manifest.json` and `ui5.yaml` configurations are present otherwise the process will exit with an error;
49
49
  ```Typescript
@@ -86,9 +86,9 @@ const exampleWriter = async () => {
86
86
  await exampleWriter();
87
87
  ```
88
88
 
89
- ## Example: Generate a Base `Managed` | `Standalone` Approuter Configuration
89
+ ## Example: Generate a Base `Managed` | `Standard` Approuter Configuration
90
90
 
91
- Calling the `generateBaseConfig` function to generate a `new` Cloud Foundry configuration, supporting `managed` | `standalone` configurations;
91
+ Calling the `generateBaseConfig` function to generate a `new` Cloud Foundry configuration, supporting `Managed` | `Standard` configurations;
92
92
  - Creates a new `mta.yaml` into the specified `mtaPath`, it will fail if an existing `mta.yaml` is found
93
93
  - Optional parameters include adding a `connectivity` service if the SAP BTP destination is using an `OnPremise` configuration
94
94
  - New configuration will include a destination instance to expose a `UI5` endpoint, consumed by SAP Fiori applications when deployed to Cloud Foundry
@@ -99,8 +99,8 @@ import { join } from 'path';
99
99
  const exampleWriter = async () => {
100
100
  const mtaPath = join(__dirname, 'testproject');
101
101
  // If your SAPUI5 application will be consuming an SAB BTP OnPremise destination, Connectivity serivce is required; Refer to https://discovery-center.cloud.sap/serviceCatalog/connectivity-service?region=all
102
- const addConnectivityService = true;
103
- // Generate a managed approuter configuration, toggle the routerType to RouterModuleType.Standard for a standalone configuration
102
+ const addConnectivityService = true;
103
+ // Generate an approuter configuration, with the default being a Managed Approuter, toggle the routerType to genereate RouterModuleType.AppFront or RouterModuleType.Standard configurations
104
104
  const fs = await generateBaseConfig({ mtaId: 'mymtaproject', routerType: RouterModuleType.Managed, mtaPath, addConnectivityService });
105
105
  return new Promise((resolve) => {
106
106
  fs.commit(resolve); // When using with Yeoman it handle the fs commit.
@@ -110,8 +110,8 @@ const exampleWriter = async () => {
110
110
  await exampleWriter();
111
111
  ```
112
112
 
113
- ## Example: Generate a CAP `Managed` | `Standalone` Approuter Configuration
114
- Calling the `generateCAPConfig` function to generate a `new` Cloud Foundry configuration, supporting `managed` | `standalone` configurations;
113
+ ## Example: Generate a CAP `Managed` | `AppFront` | `Standard` Approuter Configuration
114
+ Calling the `generateCAPConfig` function to generate a `new` Cloud Foundry configuration, supporting `Managed` | `AppFront` | `Standard` configurations;
115
115
  - Generate a CAP `mta.yaml` with `destination`, `HTML5-Repo` and `XSUAA` services added by default
116
116
  - To align the `package.json` and `package-lock.json` to support the mta prebuild script `npm ci`, you need to execute the `npm install`
117
117
  - New configuration will include destination instances to expose `UI5` and `CAP` endpoints, consumed by SAP Fiori applications when deployed to Cloud Foundry
@@ -122,7 +122,7 @@ import { join } from 'path';
122
122
 
123
123
  const exampleWriter = async () => {
124
124
  const mtaPath = join(__dirname, 'testcapproject');
125
- // Generate a managed approuter configuration, toggle the routerType to RouterModuleType.Standard or RouterModuleType.Managed
125
+ // Generate an approuter configuration, with the default being a Managed Approuter, toggle the routerType to genereate RouterModuleType.AppFront or RouterModuleType.Standard configurations
126
126
  const fs = await generateCAPConfig({ mtaId: 'mymtaproject', routerType: RouterModuleType.Managed, mtaPath });
127
127
  return new Promise((resolve) => {
128
128
  fs.commit(resolve); // When using with Yeoman it handle the fs commit.
@@ -132,6 +132,25 @@ const exampleWriter = async () => {
132
132
  await exampleWriter();
133
133
  ```
134
134
 
135
+ ## Additional Information
136
+
137
+ * When appending Cloud Foundry deployment configuration to a HTML5 application that is missing a backend `path` in`ui5.yaml`, or there is no `dataSources` defined in `manifest.json`, the `xs-app.json` routing is appended with `'<apply-service-segment-path>'`. This is to allow you to append a custom service path if you introduce custom AJAX calls or add a new OData service.
138
+
139
+ For example, the following configuration will be appended to the `xs-app.json` routing list:
140
+
141
+ ```json
142
+ {
143
+ "source": "^<apply-service-segment-path>/(.*)$",
144
+ "target": "<apply-service-segment-path>/$1",
145
+ "destination": "mydestination",
146
+ "authenticationType": "xsuaa",
147
+ "csrfProtection": false
148
+ }
149
+ ```
150
+
151
+ Replace `<apply-service-segment-path>` with the actual service path you want to use, for example `/sap` or `/myservice`;
152
+
153
+
135
154
  ## Keywords
136
155
  SAP Fiori elements
137
156
  SAP UI5
@@ -67,7 +67,7 @@ async function getUpdatedConfig(cfAppConfig, fs) {
67
67
  destinationAuthentication: cfAppConfig.destinationAuthentication || destinationAuthentication,
68
68
  isDestinationFullUrl: cfAppConfig.isDestinationFullUrl ?? destinationIsFullUrl,
69
69
  apiHubConfig: cfAppConfig.apiHubConfig,
70
- firstServicePathSegment: firstServicePathSegmentUI5Config || firstServicePathSegment,
70
+ firstServicePathSegment: firstServicePathSegmentUI5Config ?? firstServicePathSegment ?? '<apply-service-segment-path>',
71
71
  mtaId,
72
72
  mtaPath,
73
73
  isCap,
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.3.10",
4
+ "version": "0.3.11",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/SAP/open-ux-tools.git",