@sap-ux/fiori-freestyle-writer 1.0.24 → 1.2.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/index.js CHANGED
@@ -8,7 +8,6 @@ const path_1 = require("path");
8
8
  const ejs_1 = require("ejs");
9
9
  const ui5_application_writer_1 = require("@sap-ux/ui5-application-writer");
10
10
  const odata_service_writer_1 = require("@sap-ux/odata-service-writer");
11
- const packageConfig_1 = require("./packageConfig");
12
11
  const cloneDeep_1 = __importDefault(require("lodash/cloneDeep"));
13
12
  const types_1 = require("./types");
14
13
  const defaults_1 = require("./defaults");
@@ -77,7 +76,7 @@ async function generate(basePath, data, fs) {
77
76
  // Add scripts for non-CAP applications
78
77
  packageJson.scripts = {
79
78
  ...packageJson.scripts,
80
- ...(0, packageConfig_1.getPackageJsonTasks)({
79
+ ...(0, fiori_generator_shared_1.getPackageScripts)({
81
80
  localOnly: !!ffApp.service && !ffApp.service?.url,
82
81
  addMock: !!ffApp.service?.metadata,
83
82
  sapClient: ffApp.service?.client,
package/dist/types.d.ts CHANGED
@@ -35,13 +35,4 @@ export interface FreestyleApp<T> extends Ui5App {
35
35
  app: FioriApp;
36
36
  }
37
37
  export { OdataVersion } from '@sap-ux/odata-service-writer';
38
- /**
39
- Represents a set of scripts defined in a package.json file.
40
- */
41
- export interface PackageJsonScripts {
42
- start: string;
43
- 'start-local': string;
44
- 'start-noflp'?: string;
45
- 'start-mock'?: string;
46
- }
47
38
  //# sourceMappingURL=types.d.ts.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sap-ux/fiori-freestyle-writer",
3
3
  "description": "SAP Fiori freestyle application writer",
4
- "version": "1.0.24",
4
+ "version": "1.2.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/SAP/open-ux-tools.git",
@@ -26,10 +26,10 @@
26
26
  "mem-fs": "2.1.0",
27
27
  "mem-fs-editor": "9.4.0",
28
28
  "read-pkg-up": "7.0.1",
29
- "@sap-ux/odata-service-writer": "0.22.5",
30
- "@sap-ux/ui5-application-writer": "1.1.6",
31
- "@sap-ux/ui5-config": "0.24.1",
32
- "@sap-ux/fiori-generator-shared": "0.3.21"
29
+ "@sap-ux/odata-service-writer": "0.23.0",
30
+ "@sap-ux/ui5-application-writer": "1.2.0",
31
+ "@sap-ux/ui5-config": "0.25.0",
32
+ "@sap-ux/fiori-generator-shared": "0.5.0"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/ejs": "3.1.2",
@@ -1,24 +0,0 @@
1
- import type { PackageJsonScripts } from './types';
2
- /**
3
- * Get an object reflecting the scripts that need to be added to the package.json.
4
- *
5
- * @param options Collection of mostly optional settings.
6
- * @param options.localOnly no server available
7
- * @param options.addMock add a script for using the mockserver
8
- * @param options.sapClient SAP client required for connecting to the backend
9
- * @param options.flpAppId local FLP id
10
- * @param options.startFile path that should be opened with the start script
11
- * @param options.localStartFile path that should be oppend with the start-local script
12
- * @param options.generateIndex exclude the start-noflp script
13
- * @returns package.json scripts
14
- */
15
- export declare function getPackageJsonTasks({ localOnly, addMock, sapClient, flpAppId, startFile, localStartFile, generateIndex }: {
16
- localOnly: boolean;
17
- addMock: boolean;
18
- sapClient?: string;
19
- flpAppId?: string;
20
- startFile?: string;
21
- localStartFile?: string;
22
- generateIndex?: boolean;
23
- }): PackageJsonScripts;
24
- //# sourceMappingURL=packageConfig.d.ts.map
@@ -1,50 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getPackageJsonTasks = void 0;
4
- const i18n_1 = require("./i18n");
5
- /**
6
- * Get an object reflecting the scripts that need to be added to the package.json.
7
- *
8
- * @param options Collection of mostly optional settings.
9
- * @param options.localOnly no server available
10
- * @param options.addMock add a script for using the mockserver
11
- * @param options.sapClient SAP client required for connecting to the backend
12
- * @param options.flpAppId local FLP id
13
- * @param options.startFile path that should be opened with the start script
14
- * @param options.localStartFile path that should be oppend with the start-local script
15
- * @param options.generateIndex exclude the start-noflp script
16
- * @returns package.json scripts
17
- */
18
- function getPackageJsonTasks({ localOnly, addMock = true, sapClient, flpAppId = '', startFile, localStartFile, generateIndex = true }) {
19
- // Build search param part of preview launch url
20
- const searchParamList = [];
21
- if (sapClient) {
22
- searchParamList.push([`sap-client`, `${sapClient}`]);
23
- }
24
- searchParamList.push(['sap-ui-xx-viewCache', 'false']);
25
- let searchParam = new URLSearchParams(searchParamList).toString();
26
- searchParam = searchParam ? `?${searchParam}` : '';
27
- // Build fragment identifier part of url
28
- const hashFragment = flpAppId ? `#${flpAppId}` : '';
29
- // Full parameter section composed by search param and fragment identifier
30
- const params = `${searchParam}${hashFragment}`;
31
- const startCommand = localOnly
32
- ? `echo \\"${(0, i18n_1.t)('info.mockOnlyWarning')}\\"`
33
- : `fiori run --open "${startFile || 'test/flpSandbox.html'}${params}"`;
34
- const startLocalCommand = `fiori run --config ./ui5-local.yaml --open "${localStartFile || 'test/flpSandbox.html'}${params}"`;
35
- const scripts = {
36
- start: startCommand,
37
- 'start-local': startLocalCommand
38
- };
39
- if (generateIndex) {
40
- scripts['start-noflp'] = localOnly
41
- ? `echo \\"${(0, i18n_1.t)('info.mockOnlyWarning')}\\"`
42
- : `fiori run --open "${'index.html'}${searchParam}"`;
43
- }
44
- if (addMock) {
45
- scripts['start-mock'] = `fiori run --config ./ui5-mock.yaml --open "test/flpSandbox.html${params}"`;
46
- }
47
- return scripts;
48
- }
49
- exports.getPackageJsonTasks = getPackageJsonTasks;
50
- //# sourceMappingURL=packageConfig.js.map