@sap-ux/preview-middleware 0.19.33 → 0.19.35
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 +50 -50
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# `@sap-ux/preview-middleware`
|
|
2
2
|
|
|
3
|
-
The `@sap-ux/preview-middleware` is a [Custom UI5 Server Middleware](https://sap.github.io/ui5-tooling/pages/extensibility/CustomServerMiddleware) for previewing an application in a local Fiori launchpad
|
|
4
|
-
It hosts a local Fiori launchpad based on your configuration as well as offers an API to modify flex changes in your project. The API is available at `/preview/api` and additional client code required for the preview is available at `/preview/client`.
|
|
3
|
+
The `@sap-ux/preview-middleware` is a [Custom UI5 Server Middleware](https://sap.github.io/ui5-tooling/pages/extensibility/CustomServerMiddleware) for previewing an application in a local SAP Fiori launchpad. It can be used either with the `ui5 serve` or the `fiori run` commands.
|
|
4
|
+
It hosts a local SAP Fiori launchpad based on your configuration as well as offers an API to modify flex changes in your project. The API is available at `/preview/api` and additional client code required for the preview is available at `/preview/client`.
|
|
5
5
|
|
|
6
6
|
When this middleware is used together with the `reload-middleware`, then the order in which the middlewares are loaded is important. The `reload-middleware` needs to be loaded before the `preview-middleware`. Hence the configuration in the `ui5.yaml` needs to look e.g. like this:
|
|
7
7
|
|
|
@@ -13,60 +13,60 @@ When this middleware is used together with the `reload-middleware`, then the ord
|
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
## [Configuration Options](#configuration-options)
|
|
16
|
-
| Option | Type
|
|
17
|
-
|
|
18
|
-
| `flp` |
|
|
19
|
-
| `flp.path` | `string`
|
|
20
|
-
| `flp.init` | `string`
|
|
21
|
-
| `flp.intent` |
|
|
22
|
-
| `flp.intent.object` | `string`
|
|
23
|
-
| `flp.intent.action` | `string`
|
|
24
|
-
| `flp.apps` | `array`
|
|
25
|
-
| `flp.libs` | `boolean` | `
|
|
26
|
-
| `flp.theme` | `string`
|
|
27
|
-
| `flp.enhancedHomePage`
|
|
28
|
-
| `adp.target` |
|
|
29
|
-
| `adp.ignoreCertErrors` | `boolean` | `false` |
|
|
30
|
-
| `rta` |
|
|
31
|
-
| `editors` |
|
|
32
|
-
| `editors.rta` | `array`
|
|
33
|
-
| `editors.rta.layer` | `string`
|
|
34
|
-
| `editors.rta.endpoints` | `array`
|
|
35
|
-
| `test` | `array`
|
|
36
|
-
| `debug` | `boolean` | `false` | Enables debug output
|
|
16
|
+
| Option | Value Type | Requirement Type | Default Value | Description |
|
|
17
|
+
|-------------------------|------------|------------------------------------------------|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
18
|
+
| `flp` | --- | optional | --- | Configuration object for the local SAP Fiori launchpad |
|
|
19
|
+
| `flp.path` | `string` | optional | `/test/flp.html` | The mount point of the local SAP Fiori launchpad. |
|
|
20
|
+
| `flp.init` | `string` | optional | `undefined` | UI5 module/script to be executed after the standard initialization |
|
|
21
|
+
| `flp.intent` | --- | optional | --- | Intent object to be used for the application |
|
|
22
|
+
| `flp.intent.object` | `string` | optional | `app` | Name of the semantic object |
|
|
23
|
+
| `flp.intent.action` | `string` | optional | `preview` | Name of the action |
|
|
24
|
+
| `flp.apps` | `array` | optional | `undefined` | Additional local apps that are available in the local SAP Fiori launchpad |
|
|
25
|
+
| `flp.libs` | `boolean` | optional | `false` | Flag to add a generic script fetching the paths of used libraries not available in UI5. To disable it, set it to `false`. If not set, then the project is checked for a `load-reuse-libs` script and, if available, the libraries are fetched as well |
|
|
26
|
+
| `flp.theme` | `string` | optional | `(calculated)` | Name of the UI5 theme to be used (default is `sap_horizon` or the first entry in the sap.ui.supportedThemes list provided in the manifest.json file if `sap_horizon` is not contained in the list) |
|
|
27
|
+
| `flp.enhancedHomePage` | `boolean` | optional | `false` | Flag for enabling enhanced FLP homepage, available only from UI5 version 1.123.0 onwards |
|
|
28
|
+
| `adp.target` | --- | mandatory for adaptation projects | --- | Configuration object defining the connected back end |
|
|
29
|
+
| `adp.ignoreCertErrors` | `boolean` | optional | `false` | Flag to ignore certification validation errors when working with development systems with self-signed certificates, for example |
|
|
30
|
+
| `rta` | --- | 🚫 deprecated</br> *use `editors.rta` instead* | --- | Configuration allowing to add mount points for runtime adaptation |
|
|
31
|
+
| `editors` | `array` | optional | `undefined` | List of configurations allowing to add mount points for additional editors |
|
|
32
|
+
| `editors.rta` | `array` | optional | `undefined` | Configuration allowing to add mount points for runtime adaptation |
|
|
33
|
+
| `editors.rta.layer` | `string` | optional | `(calculated)` | Property for defining the runtime adaptation layer for changes (default is `CUSTOMER_BASE` or read from the project for adaptation projects) |
|
|
34
|
+
| `editors.rta.endpoints` | `array` | optional | `undefined` | List of mount points for editing |
|
|
35
|
+
| `test` | `array` | optional | `undefined` | List of configurations for automated testing. |
|
|
36
|
+
| `debug` | `boolean` | optional | `false` | Enables the debug output |
|
|
37
37
|
|
|
38
38
|
### [`flp.apps`](#configuration-option-flpapps)
|
|
39
39
|
Array of additional application configurations:
|
|
40
40
|
|
|
41
|
-
| Option | Type
|
|
42
|
-
| ------------------------
|
|
43
|
-
| `target` | `string` |
|
|
44
|
-
| `local` or `componentId` | `string` |
|
|
45
|
-
| `intent` |
|
|
46
|
-
| `intent.object` | `string` | `(calculated)` |
|
|
47
|
-
| `intent.action` | `string` | `preview` |
|
|
41
|
+
| Option | Value Type | Requirement Type | Default Value | Description |
|
|
42
|
+
| ------------------------ |------------|------------------|----------------|-------------------------------------------------------------------------------------------------------------|
|
|
43
|
+
| `target` | `string` | mandatory | `undefined` | Target path of the additional application |
|
|
44
|
+
| `local` or `componentId` | `string` | mandatory | `undefined` | Either a local path to a folder containing the application or the `componentId` of a remote app is required |
|
|
45
|
+
| `intent` | --- | optional | --- | Intent object to be used for the application |
|
|
46
|
+
| `intent.object` | `string` | optional | `(calculated)` | Name of the semantic object. If not provided, then it will be calculated based on the application ID |
|
|
47
|
+
| `intent.action` | `string` | optional | `preview` | Name of the action |
|
|
48
48
|
|
|
49
49
|
### [`adp.target`](#configuration-option-adptarget)
|
|
50
|
-
| Option | Type
|
|
51
|
-
| -------------
|
|
52
|
-
| `url` | `string` mandatory (local) | Mandatory URL pointing to the
|
|
53
|
-
| `destination` | `string` mandatory (if no
|
|
54
|
-
| `client` | `string` optional |
|
|
55
|
-
| `scp` | `boolean` optional
|
|
50
|
+
| Option | Value Type | Requirement Type | Default Value | Description |
|
|
51
|
+
| ------------- |------------|-----------------------|---------------|--------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
52
|
+
| `url` | `string` | mandatory (local) | `undefined` | Mandatory URL pointing to the back-end system. *Not required if destination is provided and the proxy is running SAP Business Application Studio |
|
|
53
|
+
| `destination` | `string` | mandatory (if no URL) | `undefined` | Required if the back-end system is available as destination in SAP Business Application Studio. |
|
|
54
|
+
| `client` | `string` | optional | `undefined` | Parameter for the SAP client |
|
|
55
|
+
| `scp` | `boolean` | optional | `false` | Flag to execute the required OAuth routine for the ABAP environment on SAP BTP |
|
|
56
56
|
|
|
57
57
|
### [`editors`](#configuration-option-editors)
|
|
58
|
-
| Option | Type
|
|
59
|
-
|
|
60
|
-
| `rta.endpoints.path` | `string` mandatory | The mount point to be used for the editor.
|
|
61
|
-
| `rta.endpoints.developerMode` | `boolean` optional |
|
|
58
|
+
| Option | Value Type | Requirement Type | Default Value | Description |
|
|
59
|
+
|-------------------------------|------------|------------------|---------------|------------------------------------------------------------------------------------------------|
|
|
60
|
+
| `rta.endpoints.path` | `string` | mandatory | `undefined` | The mount point to be used for the editor. |
|
|
61
|
+
| `rta.endpoints.developerMode` | `boolean` | optional | `false` | Flag to enable the runtime adaptation developer mode (only supported for adaptation projects) |
|
|
62
62
|
|
|
63
63
|
### [`test`](#configuration-option-test)
|
|
64
|
-
| Option | Type
|
|
65
|
-
| ---------------
|
|
66
|
-
| `framework` | `string` mandatory | Currently `OPA5`, `QUnit` (only QUnit 2.3.2 provided as third-party module
|
|
67
|
-
| `path` | `string` optional
|
|
68
|
-
| `init` | `string` optional
|
|
69
|
-
| `pattern` | `string` optional
|
|
64
|
+
| Option | Value Type | Requirement Type | Default Value | Description |
|
|
65
|
+
| --------------- |------------|------------------|----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
66
|
+
| `framework` | `string` | mandatory | `undefined` | Currently `OPA5`, `QUnit` (only QUnit 2.3.2 provided as third-party module using [OpenUI5](https://github.com/SAP/openui5/blob/master/THIRDPARTY.txt)/SAPUI5) and `Testsuite` are supported. `Testsuite` will generate a testsuite for all configured frameworks that can be be used with a test runner (such as karma) |
|
|
67
|
+
| `path` | `string` | optional | `(calculated)` | The mount point to be used for test suite. By default, `/test/opaTests.qunit.html` is used for `OPA5`, `/test/unitTests.qunit.html` is used for `QUnit`, and `/test/testsuite.qunit.html` is used for `Testsuite` |
|
|
68
|
+
| `init` | `string` | optional | `undefined` | The mount point to be used for custom test runner script |
|
|
69
|
+
| `pattern` | `string` | optional | `(calculated)` | Optional glob pattern to find the tests. By default, `/test/**/*Journey.*` is used for `OPA5` and `/test/**/*Test.*` is used for `QUnit` (not applicable for `Testsuite`) |
|
|
70
70
|
|
|
71
71
|
|
|
72
72
|
## [Usage](#usage)
|
|
@@ -166,7 +166,7 @@ server:
|
|
|
166
166
|
- path: /test/adaptation-editor.html
|
|
167
167
|
developerMode: true
|
|
168
168
|
```
|
|
169
|
-
When the middleware is used in an adaptation project together with a middleware proxying requests to the
|
|
169
|
+
When the middleware is used in an adaptation project together with a middleware proxying requests to the back end e.g. the `backend-proxy-middleware`, then it is critically important that the `preview-middleware` is handling requests before the back-end proxy because it intercepts requests to the `manifest.json` of the original application and merges it with the local variant.
|
|
170
170
|
```Yaml
|
|
171
171
|
- name: preview-middleware
|
|
172
172
|
afterMiddleware: rcompression
|
|
@@ -192,9 +192,9 @@ return flp.router
|
|
|
192
192
|
|
|
193
193
|
|
|
194
194
|
## [Migration](#migration)
|
|
195
|
-
If you have no custom modifications in the local Fiori Launchpad sandbox files (`<webapp>/test/flpSandbox.html` or `<webapp>/test/flpSandboxMockserver.html`), the conversion is finished.
|
|
195
|
+
If you have no custom modifications in the local SAP Fiori Launchpad sandbox files (`<webapp>/test/flpSandbox.html` or `<webapp>/test/flpSandboxMockserver.html`), the conversion is finished.
|
|
196
196
|
|
|
197
|
-
If you have custom modifications in the local Fiori Launchpad sandbox files, you need to migrate them into a custom .js or .ts file (depending on your setup) and integrate this file as a custom `init` script into the configuration options of the middleware.
|
|
197
|
+
If you have custom modifications in the local SAP Fiori Launchpad sandbox files, you need to migrate them into a custom .js or .ts file (depending on your setup) and integrate this file as a custom `init` script into the configuration options of the middleware.
|
|
198
198
|
|
|
199
199
|
Sample:
|
|
200
200
|
|
|
@@ -210,7 +210,7 @@ to custom `test/init.ts`:
|
|
|
210
210
|
```ts
|
|
211
211
|
console.log('my custom code');
|
|
212
212
|
```
|
|
213
|
-
integrated
|
|
213
|
+
integrated using `ui5.yaml`:
|
|
214
214
|
|
|
215
215
|
```YAML
|
|
216
216
|
server:
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"bugs": {
|
|
10
10
|
"url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Apreview-middleware"
|
|
11
11
|
},
|
|
12
|
-
"version": "0.19.
|
|
12
|
+
"version": "0.19.35",
|
|
13
13
|
"license": "Apache-2.0",
|
|
14
14
|
"author": "@SAP/ux-tools-team",
|
|
15
15
|
"main": "dist/index.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"ejs": "3.1.10",
|
|
26
26
|
"mem-fs": "2.1.0",
|
|
27
27
|
"mem-fs-editor": "9.4.0",
|
|
28
|
-
"@sap-ux/adp-tooling": "0.13.
|
|
28
|
+
"@sap-ux/adp-tooling": "0.13.39",
|
|
29
29
|
"@sap-ux/btp-utils": "1.0.3",
|
|
30
30
|
"@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.6.4",
|
|
31
31
|
"@sap-ux/feature-toggle": "0.2.3",
|
|
@@ -51,9 +51,9 @@
|
|
|
51
51
|
"supertest": "6.3.3",
|
|
52
52
|
"@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.13.19",
|
|
53
53
|
"@sap-ux/axios-extension": "1.20.1",
|
|
54
|
-
"@sap-ux/i18n": "0.2.3",
|
|
55
54
|
"@sap-ux/store": "1.0.0",
|
|
56
|
-
"@sap-ux/ui5-info": "0.10.
|
|
55
|
+
"@sap-ux/ui5-info": "0.10.1",
|
|
56
|
+
"@sap-ux/i18n": "0.2.3"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"express": "4"
|