@sap-ux/fiori-freestyle-writer 1.1.0 → 1.2.1
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 +1 -2
- package/dist/types.d.ts +0 -10
- package/package.json +2 -2
- package/dist/packageConfig.d.ts +0 -24
- package/dist/packageConfig.js +0 -54
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,
|
|
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,14 +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
|
-
'start-variants-management'?: string;
|
|
47
|
-
}
|
|
48
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.1
|
|
4
|
+
"version": "1.2.1",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/SAP/open-ux-tools.git",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@sap-ux/odata-service-writer": "0.23.0",
|
|
30
30
|
"@sap-ux/ui5-application-writer": "1.2.0",
|
|
31
31
|
"@sap-ux/ui5-config": "0.25.0",
|
|
32
|
-
"@sap-ux/fiori-generator-shared": "0.
|
|
32
|
+
"@sap-ux/fiori-generator-shared": "0.5.1"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/ejs": "3.1.2",
|
package/dist/packageConfig.d.ts
DELETED
|
@@ -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
|
package/dist/packageConfig.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getPackageJsonTasks = void 0;
|
|
4
|
-
const i18n_1 = require("./i18n");
|
|
5
|
-
const fiori_generator_shared_1 = require("@sap-ux/fiori-generator-shared");
|
|
6
|
-
/**
|
|
7
|
-
* Get an object reflecting the scripts that need to be added to the package.json.
|
|
8
|
-
*
|
|
9
|
-
* @param options Collection of mostly optional settings.
|
|
10
|
-
* @param options.localOnly no server available
|
|
11
|
-
* @param options.addMock add a script for using the mockserver
|
|
12
|
-
* @param options.sapClient SAP client required for connecting to the backend
|
|
13
|
-
* @param options.flpAppId local FLP id
|
|
14
|
-
* @param options.startFile path that should be opened with the start script
|
|
15
|
-
* @param options.localStartFile path that should be oppend with the start-local script
|
|
16
|
-
* @param options.generateIndex exclude the start-noflp script
|
|
17
|
-
* @returns package.json scripts
|
|
18
|
-
*/
|
|
19
|
-
function getPackageJsonTasks({ localOnly, addMock = true, sapClient, flpAppId = '', startFile, localStartFile, generateIndex = true }) {
|
|
20
|
-
// Build search param part of preview launch url
|
|
21
|
-
const searchParamList = [];
|
|
22
|
-
if (sapClient) {
|
|
23
|
-
searchParamList.push([`sap-client`, `${sapClient}`]);
|
|
24
|
-
}
|
|
25
|
-
searchParamList.push(['sap-ui-xx-viewCache', 'false']);
|
|
26
|
-
let searchParam = new URLSearchParams(searchParamList).toString();
|
|
27
|
-
searchParam = searchParam ? `?${searchParam}` : '';
|
|
28
|
-
// Build fragment identifier part of url
|
|
29
|
-
const hashFragment = flpAppId ? `#${flpAppId}` : '';
|
|
30
|
-
// Full parameter section composed by search param and fragment identifier
|
|
31
|
-
const params = `${searchParam}${hashFragment}`;
|
|
32
|
-
const startCommand = localOnly
|
|
33
|
-
? `echo \\"${(0, i18n_1.t)('info.mockOnlyWarning')}\\"`
|
|
34
|
-
: `fiori run --open "${startFile || 'test/flpSandbox.html'}${params}"`;
|
|
35
|
-
const startLocalCommand = `fiori run --config ./ui5-local.yaml --open "${localStartFile || 'test/flpSandbox.html'}${params}"`;
|
|
36
|
-
const scripts = {
|
|
37
|
-
start: startCommand,
|
|
38
|
-
'start-local': startLocalCommand
|
|
39
|
-
};
|
|
40
|
-
if (generateIndex) {
|
|
41
|
-
scripts['start-noflp'] = localOnly
|
|
42
|
-
? `echo \\"${(0, i18n_1.t)('info.mockOnlyWarning')}\\"`
|
|
43
|
-
: `fiori run --open "${'index.html'}${searchParam}"`;
|
|
44
|
-
}
|
|
45
|
-
if (addMock) {
|
|
46
|
-
scripts['start-mock'] = `fiori run --config ./ui5-mock.yaml --open "test/flpSandbox.html${params}"`;
|
|
47
|
-
}
|
|
48
|
-
scripts['start-variants-management'] = localOnly
|
|
49
|
-
? `echo \\"${(0, i18n_1.t)('info.mockOnlyWarning')}\\"`
|
|
50
|
-
: (0, fiori_generator_shared_1.getVariantPreviewAppScript)(sapClient);
|
|
51
|
-
return scripts;
|
|
52
|
-
}
|
|
53
|
-
exports.getPackageJsonTasks = getPackageJsonTasks;
|
|
54
|
-
//# sourceMappingURL=packageConfig.js.map
|