@sap-ux/preview-middleware 0.20.30 → 0.20.32

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
@@ -32,7 +32,7 @@ When this middleware is used together with the `reload-middleware`, then the ord
32
32
  | `editors.rta` | `array` | optional | `undefined` | Configuration allowing to add mount points for runtime adaptation |
33
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
34
  | `editors.rta.endpoints` | `array` | optional | `undefined` | List of mount points for editing
35
- | `editors.cardGenerator` | --- | optional | `undefined` | Configuration object to enable card generation for an application.
35
+ | `editors.cardGenerator` | --- | optional | `undefined` | Configuration object to enable card generation for an application (only supported for non-CAP apps).
36
36
  | `editors.cardGenerator.path` | `string` | optional | `test/flpGeneratorSandbox.html` | The mount point of the local SAP Fiori launchpad which will be considered for card generation.
37
37
  | `test` | `array` | optional | `undefined` | List of configurations for automated testing. |
38
38
  | `debug` | `boolean` | optional | `false` | Enables the debug output |
@@ -127,10 +127,11 @@ server:
127
127
  - name: preview-middleware
128
128
  afterMiddleware: compression
129
129
  configuration:
130
- rta:
131
- layer: CUSTOMER_BASE
132
- editors:
133
- - path: /test/variant-editor.html
130
+ editors:
131
+ rta:
132
+ layer: CUSTOMER_BASE
133
+ endpoints:
134
+ - path: /test/variant-editor.html
134
135
  ```
135
136
  This mount path can be used with a run script that looks as follows.
136
137
  ```Json
package/dist/base/flp.js CHANGED
@@ -395,7 +395,13 @@ class FlpSandbox {
395
395
  const previewGeneratorPath = this.cardGenerator?.path ?? config_1.CARD_GENERATOR_DEFAULT.previewGeneratorSandbox;
396
396
  this.logger.debug(`Add route for ${previewGeneratorPath}`);
397
397
  this.router.get(previewGeneratorPath, async (req, res, next) => {
398
- this.templateConfig.enableCardGenerator = !!this.cardGenerator?.path;
398
+ if (this.projectType === 'EDMXBackend') {
399
+ this.templateConfig.enableCardGenerator = !!this.cardGenerator?.path;
400
+ }
401
+ else {
402
+ this.logger.warn(`The Card Generator is not available for CAP projects.`);
403
+ this.templateConfig.enableCardGenerator = false;
404
+ }
399
405
  await this.flpGetHandler(req, res, next);
400
406
  });
401
407
  }
@@ -813,6 +819,9 @@ class FlpSandbox {
813
819
  * @returns {Promise<void>} A promise that resolves when the route is added.
814
820
  */
815
821
  async addStoreCardManifestRoute() {
822
+ if (this.projectType !== 'EDMXBackend') {
823
+ return;
824
+ }
816
825
  this.router.use(config_1.CARD_GENERATOR_DEFAULT.cardsStore, (0, express_1.json)());
817
826
  this.logger.debug(`Add route for ${config_1.CARD_GENERATOR_DEFAULT.cardsStore}`);
818
827
  this.router.post(config_1.CARD_GENERATOR_DEFAULT.cardsStore, async (req, res) => {
@@ -853,6 +862,9 @@ class FlpSandbox {
853
862
  * @returns {Promise<void>} A promise that resolves when the route is added.
854
863
  */
855
864
  async addStoreI18nKeysRoute() {
865
+ if (this.projectType !== 'EDMXBackend') {
866
+ return;
867
+ }
856
868
  this.router.use(config_1.CARD_GENERATOR_DEFAULT.i18nStore, (0, express_1.json)());
857
869
  this.logger.debug(`Add route for ${config_1.CARD_GENERATOR_DEFAULT.i18nStore}`);
858
870
  this.router.post(config_1.CARD_GENERATOR_DEFAULT.i18nStore, async (req, res) => {
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.20.30",
12
+ "version": "0.20.32",
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.14.20",
28
+ "@sap-ux/adp-tooling": "0.14.21",
29
29
  "@sap-ux/btp-utils": "1.1.0",
30
30
  "@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.6.6",
31
31
  "@sap-ux/feature-toggle": "0.3.0",
@@ -53,7 +53,7 @@
53
53
  "@sap-ux/axios-extension": "1.21.4",
54
54
  "@sap-ux/i18n": "0.3.0",
55
55
  "@sap-ux/store": "1.1.0",
56
- "@sap-ux/ui5-info": "0.11.0"
56
+ "@sap-ux/ui5-info": "0.11.1"
57
57
  },
58
58
  "peerDependencies": {
59
59
  "express": "4"