@sap-ux/preview-middleware 0.6.2 → 0.6.3

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.
@@ -47,6 +47,23 @@ function initAdp(rootProject, config, flp, util, logger) {
47
47
  }
48
48
  });
49
49
  }
50
+ /**
51
+ * The developer mode is only supported for adaptation projects, therefore, notify the user if it is wrongly configured and then disable it.
52
+ *
53
+ * @param config configurations from the ui5.yaml
54
+ * @param logger logger instance
55
+ */
56
+ function sanitizeConfig(config, logger) {
57
+ if (config.rta && config.adp === undefined) {
58
+ config.rta.editors = config.rta.editors.filter((editor) => {
59
+ if (editor.developerMode) {
60
+ logger.error('developerMode is ONLY supported for SAP UI5 adaptation projects.');
61
+ logger.warn(`developerMode for ${editor.path} disabled`);
62
+ }
63
+ return !editor.developerMode;
64
+ });
65
+ }
66
+ }
50
67
  /**
51
68
  * Create the router that is to be exposed as UI5 middleware.
52
69
  *
@@ -63,6 +80,7 @@ function createRouter({ resources, options, middlewareUtil }, logger) {
63
80
  // setting defaults
64
81
  const config = (_a = options.configuration) !== null && _a !== void 0 ? _a : {};
65
82
  (_b = config.flp) !== null && _b !== void 0 ? _b : (config.flp = {});
83
+ sanitizeConfig(config, logger);
66
84
  // configure the FLP sandbox based on information from the manifest
67
85
  const flp = new flp_1.FlpSandbox(config, resources.rootProject, middlewareUtil, logger);
68
86
  if (config.adp) {
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.6.2",
12
+ "version": "0.6.3",
13
13
  "license": "Apache-2.0",
14
14
  "author": "@SAP/ux-tools-team",
15
15
  "main": "dist/index.js",