@sap-ux/preview-middleware 0.16.143 → 0.16.145

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
@@ -182,6 +182,38 @@ flp.init(JSON.parse(await files[0].getString()));
182
182
  return flp.router
183
183
  ```
184
184
  - `flpConfig` - the middleware configuration
185
- - `rootProject` - [Reader](https://sap.github.io/ui5-tooling/stable/api/@ui5_fs_AbstractReader.html) to access resources of the root project
185
+ - `rootProject` - [Reader](https://sap.github.io/ui5-tooling/stable/api/@ui5_fs_AbstractReader.html) to access the resources of the root project
186
186
  - `middlewareUtil` - [MiddlewareUtil](https://sap.github.io/ui5-tooling/v3/api/@ui5_server_middleware_MiddlewareUtil.html) of the UI5 server
187
- - `logger` - Logger instance for use in the middleware.
187
+ - `logger` - Logger instance to be used in the middleware.
188
+
189
+
190
+ ## [Migration](#migration)
191
+ 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.
192
+
193
+ 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.
194
+
195
+ Sample:
196
+
197
+ from custom modification in `flpSandbox.html`:
198
+ ```HTML
199
+ <script type="text/javascript">
200
+ sap.ui.getCore().attachInit(function () {
201
+ console.log('my custom code');
202
+ });
203
+ </script>
204
+ ```
205
+ to custom `test/init.ts`:
206
+ ```ts
207
+ console.log('my custom code');
208
+ ```
209
+ integrated via `ui5.yaml`:
210
+
211
+ ```YAML
212
+ server:
213
+ customMiddleware:
214
+ - name: preview-middleware
215
+ afterMiddleware: compression
216
+ configuration:
217
+ flp:
218
+ init: /test/init # <-- path to your custom init script
219
+ ```
@@ -1,5 +1,5 @@
1
1
  import { ToolsLogger, type Logger } from '@sap-ux/logger';
2
- import type { App, FlpConfig, Intent, InternalTestConfig, MiddlewareConfig, TestConfig } from '../types';
2
+ import type { App, DefaultFlpPath, DefaultIntent, FlpConfig, Intent, InternalTestConfig, MiddlewareConfig, TestConfig } from '../types';
3
3
  import { type Manifest, type UI5FlexLayer } from '@sap-ux/project-access';
4
4
  import { type Editor } from 'mem-fs-editor';
5
5
  import type { MergedAppDescriptor } from '@sap-ux/axios-extension';
@@ -76,11 +76,11 @@ export declare const DEFAULT_THEME = "sap_horizon";
76
76
  /**
77
77
  * Default path for mounting the local FLP.
78
78
  */
79
- export declare const DEFAULT_PATH = "/test/flp.html";
79
+ export declare const DEFAULT_PATH: DefaultFlpPath;
80
80
  /**
81
81
  * Default intent
82
82
  */
83
- export declare const DEFAULT_INTENT: Readonly<Intent>;
83
+ export declare const DEFAULT_INTENT: Readonly<DefaultIntent>;
84
84
  /**
85
85
  * Default configuration for the FLP.
86
86
  *
package/dist/base/flp.js CHANGED
@@ -221,6 +221,7 @@ class FlpSandbox {
221
221
  params['sap-ui-xx-viewCache'] = 'false';
222
222
  params['fiori-tools-rta-mode'] = 'true';
223
223
  params['sap-ui-rta-skip-flex-validation'] = 'true';
224
+ params['sap-ui-xx-condense-changes'] = 'true';
224
225
  res.redirect(302, `${previewUrl}?${new URLSearchParams(params)}`);
225
226
  return;
226
227
  }
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export * from './ui5/middleware';
2
2
  export { FlpSandbox, initAdp, generatePreviewFiles, getPreviewPaths } from './base';
3
- export { FlpConfig, RtaConfig, TestConfig, MiddlewareConfig } from './types';
3
+ export { FlpConfig, RtaConfig, TestConfig, MiddlewareConfig, DefaultFlpPath, DefaultIntent } from './types';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -81,5 +81,10 @@ export interface MiddlewareConfig {
81
81
  adp?: AdpPreviewConfig;
82
82
  debug?: boolean;
83
83
  }
84
+ export type DefaultFlpPath = '/test/flp.html';
85
+ export type DefaultIntent = {
86
+ object: 'app';
87
+ action: 'preview';
88
+ };
84
89
  export {};
85
90
  //# sourceMappingURL=index.d.ts.map
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.16.143",
12
+ "version": "0.16.145",
13
13
  "license": "Apache-2.0",
14
14
  "author": "@SAP/ux-tools-team",
15
15
  "main": "dist/index.js",
@@ -28,9 +28,9 @@
28
28
  "@sap-ux/logger": "0.6.0",
29
29
  "@sap-ux/feature-toggle": "0.2.3",
30
30
  "@sap-ux/btp-utils": "0.17.1",
31
- "@sap-ux/adp-tooling": "0.12.91",
31
+ "@sap-ux/adp-tooling": "0.12.93",
32
32
  "@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.5.28",
33
- "@sap-ux/project-access": "1.28.8"
33
+ "@sap-ux/project-access": "1.28.9"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/ejs": "3.1.2",
@@ -47,8 +47,8 @@
47
47
  "@sap-ux-private/playwright": "0.1.0",
48
48
  "dotenv": "16.3.1",
49
49
  "@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.11.42",
50
+ "@sap-ux/axios-extension": "1.17.7",
50
51
  "@sap-ux/store": "0.9.3",
51
- "@sap-ux/axios-extension": "1.17.6",
52
52
  "@sap-ux/ui5-info": "0.8.3",
53
53
  "@sap-ux/i18n": "0.2.0"
54
54
  },