@sap-ux/preview-middleware 0.13.25 → 0.13.26

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/dist/base/flp.js CHANGED
@@ -18,6 +18,7 @@ const path_1 = require("path");
18
18
  const express_1 = require("express");
19
19
  const adp_tooling_1 = require("@sap-ux/adp-tooling");
20
20
  const project_access_1 = require("@sap-ux/project-access");
21
+ const btp_utils_1 = require("@sap-ux/btp-utils");
21
22
  const flex_1 = require("./flex");
22
23
  const test_1 = require("./test");
23
24
  const DEVELOPER_MODE_CONFIG = new Map([
@@ -214,9 +215,9 @@ class FlpSandbox {
214
215
  if (editor.developerMode) {
215
216
  previewUrl = `${previewUrl}.inner.html`;
216
217
  (_a = editor.pluginScript) !== null && _a !== void 0 ? _a : (editor.pluginScript = 'open/ux/preview/client/cpe/init');
217
- this.router.get(editor.path, (_req, res) => {
218
- var _a, _b, _c, _d;
219
- const scenario = (_a = rta.options) === null || _a === void 0 ? void 0 : _a.scenario;
218
+ this.router.get(editor.path, (_req, res) => __awaiter(this, void 0, void 0, function* () {
219
+ var _b, _c, _d, _e;
220
+ const scenario = (_b = rta.options) === null || _b === void 0 ? void 0 : _b.scenario;
220
221
  let templatePreviewUrl = `${previewUrl}?sap-ui-xx-viewCache=false&fiori-tools-rta-mode=forAdaptation&sap-ui-rta-skip-flex-validation=true&sap-ui-xx-condense-changes=true#${this.config.intent.object}-${this.config.intent.action}`;
221
222
  if (scenario === 'ADAPTATION_PROJECT') {
222
223
  templatePreviewUrl = templatePreviewUrl.replace('?', `?sap-ui-layer=${rta.layer}&`);
@@ -225,15 +226,17 @@ class FlpSandbox {
225
226
  const envPort = process.env.FIORI_TOOLS_LIVERELOAD_PORT;
226
227
  let livereloadPort = envPort ? parseInt(envPort, 10) : DEFAULT_LIVERELOAD_PORT;
227
228
  livereloadPort = isNaN(livereloadPort) ? DEFAULT_LIVERELOAD_PORT : livereloadPort;
229
+ const envLivereloadUrl = (0, btp_utils_1.isAppStudio)() ? yield (0, btp_utils_1.exposePort)(livereloadPort) : undefined;
228
230
  const html = (0, ejs_1.render)(template, {
229
231
  previewUrl: templatePreviewUrl,
230
- telemetry: (_c = (_b = rta.options) === null || _b === void 0 ? void 0 : _b.telemetry) !== null && _c !== void 0 ? _c : false,
231
- appName: (_d = rta.options) === null || _d === void 0 ? void 0 : _d.appName,
232
+ telemetry: (_d = (_c = rta.options) === null || _c === void 0 ? void 0 : _c.telemetry) !== null && _d !== void 0 ? _d : false,
233
+ appName: (_e = rta.options) === null || _e === void 0 ? void 0 : _e.appName,
232
234
  scenario,
233
- livereloadPort
235
+ livereloadPort,
236
+ livereloadUrl: envLivereloadUrl
234
237
  });
235
238
  this.sendResponse(res, 'text/html', 200, html);
236
- });
239
+ }));
237
240
  let path = (0, path_1.dirname)(editor.path);
238
241
  if (!path.endsWith('/')) {
239
242
  path = `${path}/`;
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.13.25",
12
+ "version": "0.13.26",
13
13
  "license": "Apache-2.0",
14
14
  "author": "@SAP/ux-tools-team",
15
15
  "main": "dist/index.js",
@@ -26,8 +26,9 @@
26
26
  "mem-fs": "2.1.0",
27
27
  "mem-fs-editor": "9.4.0",
28
28
  "@sap-ux/logger": "0.5.1",
29
- "@sap-ux/adp-tooling": "0.9.24",
30
- "@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.4.17",
29
+ "@sap-ux/btp-utils": "0.14.4",
30
+ "@sap-ux/adp-tooling": "0.9.25",
31
+ "@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.4.18",
31
32
  "@sap-ux/project-access": "1.19.14"
32
33
  },
33
34
  "devDependencies": {
@@ -45,7 +46,7 @@
45
46
  "@sap-ux-private/playwright": "0.0.3",
46
47
  "dotenv": "16.3.1",
47
48
  "@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.9.8",
48
- "@sap-ux/axios-extension": "1.11.8",
49
+ "@sap-ux/axios-extension": "1.11.9",
49
50
  "@sap-ux/store": "0.5.0",
50
51
  "@sap-ux/i18n": "0.0.6"
51
52
  },
@@ -18,7 +18,8 @@
18
18
  telemetry: <%- telemetry %>,
19
19
  rootElementId: 'root',
20
20
  scenario: '<%- scenario %>',
21
- livereloadPort: <%- livereloadPort %>
21
+ livereloadPort: <%- livereloadPort %>,
22
+ livereloadUrl: '<%- livereloadUrl %>',
22
23
  });
23
24
  </script>
24
25
  </body>