@sap-ux/preview-middleware 0.13.39 → 0.13.41

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.
Files changed (2) hide show
  1. package/dist/base/flp.js +9 -6
  2. package/package.json +7 -7
package/dist/base/flp.js CHANGED
@@ -256,15 +256,18 @@ class FlpSandbox {
256
256
  // register static client sources
257
257
  this.router.use(PREVIEW_URL.client.url, (0, express_1.static)(PREVIEW_URL.client.local));
258
258
  // add route for the sandbox.html
259
- this.router.get(this.config.path, ((_req, res) => __awaiter(this, void 0, void 0, function* () {
260
- // warn the user if a file with the same name exists in the filesystem
259
+ this.router.get(this.config.path, ((_req, res, next) => __awaiter(this, void 0, void 0, function* () {
260
+ // inform the user if a html file exists on the filesystem
261
261
  const file = yield this.project.byPath(this.config.path);
262
262
  if (file) {
263
- this.logger.warn(`HTML file returned at ${this.config.path} is NOT loaded from the file system.`);
263
+ this.logger.info(`HTML file returned at ${this.config.path} is loaded from the file system.`);
264
+ next();
265
+ }
266
+ else {
267
+ const template = (0, fs_1.readFileSync)((0, path_1.join)(__dirname, '../../templates/flp/sandbox.html'), 'utf-8');
268
+ const html = (0, ejs_1.render)(template, this.templateConfig);
269
+ this.sendResponse(res, 'text/html', 200, html);
264
270
  }
265
- const template = (0, fs_1.readFileSync)((0, path_1.join)(__dirname, '../../templates/flp/sandbox.html'), 'utf-8');
266
- const html = (0, ejs_1.render)(template, this.templateConfig);
267
- this.sendResponse(res, 'text/html', 200, html);
268
271
  })));
269
272
  }
270
273
  /**
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.39",
12
+ "version": "0.13.41",
13
13
  "license": "Apache-2.0",
14
14
  "author": "@SAP/ux-tools-team",
15
15
  "main": "dist/index.js",
@@ -26,10 +26,10 @@
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.10.5",
29
+ "@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.4.20",
30
30
  "@sap-ux/btp-utils": "0.14.4",
31
- "@sap-ux/project-access": "1.20.0",
32
- "@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.4.20"
31
+ "@sap-ux/adp-tooling": "0.10.6",
32
+ "@sap-ux/project-access": "1.20.0"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/ejs": "3.1.2",
@@ -45,11 +45,11 @@
45
45
  "supertest": "6.3.3",
46
46
  "@sap-ux-private/playwright": "0.0.3",
47
47
  "dotenv": "16.3.1",
48
- "@sap-ux/axios-extension": "1.12.3",
49
48
  "@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.9.12",
50
- "@sap-ux/i18n": "0.0.6",
49
+ "@sap-ux/axios-extension": "1.12.3",
50
+ "@sap-ux/store": "0.5.0",
51
51
  "@sap-ux/ui5-info": "0.5.0",
52
- "@sap-ux/store": "0.5.0"
52
+ "@sap-ux/i18n": "0.0.6"
53
53
  },
54
54
  "peerDependencies": {
55
55
  "express": "4"