@sap-ux/fiori-generator-shared 0.3.21 → 0.4.0

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/helpers.d.ts CHANGED
@@ -10,4 +10,11 @@ export declare function getBootstrapResourceUrls(isEdmxProjectType: boolean, fra
10
10
  uShellBootstrapResourceUrl: string;
11
11
  uiBootstrapResourceUrl: string;
12
12
  };
13
+ /**
14
+ * Generates a variant management script in preview mode.
15
+ *
16
+ * @param {string} sapClient - The SAP client parameter to include in the URL. If not provided, the URL will not include the `sap-client` parameter.
17
+ * @returns {string} A variant management script to run the application in preview mode.
18
+ */
19
+ export declare function getVariantPreviewAppScript(sapClient?: string): string;
13
20
  //# sourceMappingURL=helpers.d.ts.map
package/dist/helpers.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getBootstrapResourceUrls = void 0;
3
+ exports.getVariantPreviewAppScript = exports.getBootstrapResourceUrls = void 0;
4
4
  /**
5
5
  * Get the resource URLs for the UShell bootstrap and UI5 bootstrap based on project type and UI5 framework details.
6
6
  *
@@ -24,4 +24,25 @@ function getBootstrapResourceUrls(isEdmxProjectType, frameworkUrl, version) {
24
24
  return { uShellBootstrapResourceUrl, uiBootstrapResourceUrl };
25
25
  }
26
26
  exports.getBootstrapResourceUrls = getBootstrapResourceUrls;
27
+ /**
28
+ * Generates a variant management script in preview mode.
29
+ *
30
+ * @param {string} sapClient - The SAP client parameter to include in the URL. If not provided, the URL will not include the `sap-client` parameter.
31
+ * @returns {string} A variant management script to run the application in preview mode.
32
+ */
33
+ function getVariantPreviewAppScript(sapClient) {
34
+ const previewAppAnchor = '#preview-app';
35
+ const disableCacheParam = 'sap-ui-xx-viewCache=false';
36
+ const sapClientParam = sapClient ? `&sap-client=${sapClient}` : '';
37
+ const urlParam = `?${[
38
+ sapClientParam,
39
+ disableCacheParam,
40
+ 'fiori-tools-rta-mode=true',
41
+ 'sap-ui-rta-skip-flex-validation=true'
42
+ ]
43
+ .filter(Boolean)
44
+ .join('&')}`;
45
+ return `fiori run --open \"preview.html${urlParam}${previewAppAnchor}\"`;
46
+ }
47
+ exports.getVariantPreviewAppScript = getVariantPreviewAppScript;
27
48
  //# sourceMappingURL=helpers.js.map
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export * from './cap';
2
2
  export * from './environment';
3
- export { getBootstrapResourceUrls } from './helpers';
3
+ export { getBootstrapResourceUrls, getVariantPreviewAppScript } from './helpers';
4
4
  export { generateReadMe } from './read-me';
5
5
  export * from './system-utils';
6
6
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -14,11 +14,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.generateReadMe = exports.getBootstrapResourceUrls = void 0;
17
+ exports.generateReadMe = exports.getVariantPreviewAppScript = exports.getBootstrapResourceUrls = void 0;
18
18
  __exportStar(require("./cap"), exports);
19
19
  __exportStar(require("./environment"), exports);
20
20
  var helpers_1 = require("./helpers");
21
21
  Object.defineProperty(exports, "getBootstrapResourceUrls", { enumerable: true, get: function () { return helpers_1.getBootstrapResourceUrls; } });
22
+ Object.defineProperty(exports, "getVariantPreviewAppScript", { enumerable: true, get: function () { return helpers_1.getVariantPreviewAppScript; } });
22
23
  var read_me_1 = require("./read-me");
23
24
  Object.defineProperty(exports, "generateReadMe", { enumerable: true, get: function () { return read_me_1.generateReadMe; } });
24
25
  __exportStar(require("./system-utils"), exports);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sap-ux/fiori-generator-shared",
3
3
  "description": "Commonly used shared functionality and types to support the fiori generator.",
4
- "version": "0.3.21",
4
+ "version": "0.4.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/SAP/open-ux-tools.git",
@@ -20,7 +20,7 @@
20
20
  "mem-fs": "2.1.0",
21
21
  "mem-fs-editor": "9.4.0",
22
22
  "@sap-ux/btp-utils": "0.15.2",
23
- "@sap-ux/project-access": "1.27.3"
23
+ "@sap-ux/project-access": "1.27.4"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@types/mem-fs-editor": "7.0.1",