@sap-ux/fiori-elements-writer 1.1.7 → 1.1.8
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/data/defaults.d.ts
CHANGED
|
@@ -19,6 +19,15 @@ export declare function setDefaultTemplateSettings<T extends {}>(template: Templ
|
|
|
19
19
|
* @returns The UI5 libs required by the specified template type and OData version and UI5 annotation libs
|
|
20
20
|
*/
|
|
21
21
|
export declare function getUi5Libs(type: TemplateType, version: OdataVersion, ui5Libs?: string | string[]): string[];
|
|
22
|
+
/**
|
|
23
|
+
* Gets the required manifest libs for the specified template type and OData version.
|
|
24
|
+
*
|
|
25
|
+
* @param type - The template type of the required base component
|
|
26
|
+
* @param version - The odata service version determines the appropriate base component to use
|
|
27
|
+
* @param libs - manifest libs
|
|
28
|
+
* @returns The manifest libs required by the specified template type and OData version and UI5 annotation libs
|
|
29
|
+
*/
|
|
30
|
+
export declare function getManifestLibs(type: TemplateType, version: OdataVersion, libs?: string | string[]): string[];
|
|
22
31
|
/**
|
|
23
32
|
* Sets defaults for the specified Fiori elements application.
|
|
24
33
|
*
|
package/dist/data/defaults.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getTemplateOptions = exports.setAppDefaults = exports.getUi5Libs = exports.setDefaultTemplateSettings = void 0;
|
|
6
|
+
exports.getTemplateOptions = exports.setAppDefaults = exports.getManifestLibs = exports.getUi5Libs = exports.setDefaultTemplateSettings = void 0;
|
|
7
7
|
const odata_service_writer_1 = require("@sap-ux/odata-service-writer");
|
|
8
8
|
const read_pkg_up_1 = __importDefault(require("read-pkg-up"));
|
|
9
9
|
const types_1 = require("../types");
|
|
@@ -68,6 +68,19 @@ function getUi5Libs(type, version, ui5Libs) {
|
|
|
68
68
|
return [...templateLibs].concat(ui5Libs ?? []);
|
|
69
69
|
}
|
|
70
70
|
exports.getUi5Libs = getUi5Libs;
|
|
71
|
+
/**
|
|
72
|
+
* Gets the required manifest libs for the specified template type and OData version.
|
|
73
|
+
*
|
|
74
|
+
* @param type - The template type of the required base component
|
|
75
|
+
* @param version - The odata service version determines the appropriate base component to use
|
|
76
|
+
* @param libs - manifest libs
|
|
77
|
+
* @returns The manifest libs required by the specified template type and OData version and UI5 annotation libs
|
|
78
|
+
*/
|
|
79
|
+
function getManifestLibs(type, version, libs) {
|
|
80
|
+
const templateLibs = (0, templateAttributes_1.getTemplateManifestLibs)(type, version);
|
|
81
|
+
return [...templateLibs].concat(libs ?? []);
|
|
82
|
+
}
|
|
83
|
+
exports.getManifestLibs = getManifestLibs;
|
|
71
84
|
/**
|
|
72
85
|
* Sets defaults for the specified Fiori elements application.
|
|
73
86
|
*
|
|
@@ -95,6 +108,7 @@ function setAppDefaults(feApp) {
|
|
|
95
108
|
feApp.ui5 = {
|
|
96
109
|
...feApp.ui5,
|
|
97
110
|
ui5Libs: getUi5Libs(feApp.template.type, feApp.service.version, feApp.ui5?.ui5Libs),
|
|
111
|
+
manifestLibs: getManifestLibs(feApp.template.type, feApp.service.version, feApp.ui5?.manifestLibs),
|
|
98
112
|
customUi5Libs: customUi5Libs
|
|
99
113
|
};
|
|
100
114
|
// Assign a default annotation name if the service type is EDMX and no local annotation name is provided
|
|
@@ -23,6 +23,14 @@ export declare function getBaseComponent(type: TemplateType, version: OdataVersi
|
|
|
23
23
|
* @returns The Ui5 libs required by the specified template type and OData version
|
|
24
24
|
*/
|
|
25
25
|
export declare function getTemplateUi5Libs(type: TemplateType, version: OdataVersion): string[];
|
|
26
|
+
/**
|
|
27
|
+
* Gets the required manifest libs for the specified template type and OData version.
|
|
28
|
+
*
|
|
29
|
+
* @param type - The template type of the required base component
|
|
30
|
+
* @param version - The odata service version determines the appropriate base component to use
|
|
31
|
+
* @returns The manifest libs required by the specified template type and OData version
|
|
32
|
+
*/
|
|
33
|
+
export declare function getTemplateManifestLibs(type: TemplateType, version: OdataVersion): string[];
|
|
26
34
|
type TemplateAttributes = {
|
|
27
35
|
[K in TemplateType]: {
|
|
28
36
|
supportedODataVersions: OdataVersion[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TemplateTypeAttributes = exports.getTemplateUi5Libs = exports.getBaseComponent = exports.escapeFLPText = exports.changesPreviewToVersion = exports.minSupportedUI5VersionV4 = exports.minSupportedUI5Version = void 0;
|
|
3
|
+
exports.TemplateTypeAttributes = exports.getTemplateManifestLibs = exports.getTemplateUi5Libs = exports.getBaseComponent = exports.escapeFLPText = exports.changesPreviewToVersion = exports.minSupportedUI5VersionV4 = exports.minSupportedUI5Version = void 0;
|
|
4
4
|
const types_1 = require("../types");
|
|
5
5
|
// first version with SAP Fiori 3 theme
|
|
6
6
|
exports.minSupportedUI5Version = '1.65.0';
|
|
@@ -23,7 +23,7 @@ const commonUi5Libs = {
|
|
|
23
23
|
'sap.ui.generic.app',
|
|
24
24
|
'sap.suite.ui.generic.template'
|
|
25
25
|
],
|
|
26
|
-
[types_1.OdataVersion.v4]: ['sap.m']
|
|
26
|
+
[types_1.OdataVersion.v4]: ['sap.m', 'sap.fe.templates']
|
|
27
27
|
};
|
|
28
28
|
const templateLibs = {
|
|
29
29
|
[types_1.OdataVersion.v2]: {
|
|
@@ -47,27 +47,33 @@ const templateLibs = {
|
|
|
47
47
|
[types_1.OdataVersion.v4]: {
|
|
48
48
|
[types_1.TemplateType.ListReportObjectPage]: {
|
|
49
49
|
baseComponent: appComponentLibFioriElements,
|
|
50
|
-
ui5Libs: [...commonUi5Libs[types_1.OdataVersion.v4], 'sap.
|
|
50
|
+
ui5Libs: [...commonUi5Libs[types_1.OdataVersion.v4], 'sap.ushell'],
|
|
51
|
+
manifestLibs: [...commonUi5Libs[types_1.OdataVersion.v4]]
|
|
51
52
|
},
|
|
52
53
|
[types_1.TemplateType.FormEntryObjectPage]: {
|
|
53
54
|
baseComponent: appComponentLibFioriElements,
|
|
54
|
-
ui5Libs: [...commonUi5Libs[types_1.OdataVersion.v4], 'sap.
|
|
55
|
+
ui5Libs: [...commonUi5Libs[types_1.OdataVersion.v4], 'sap.ushell'],
|
|
56
|
+
manifestLibs: [...commonUi5Libs[types_1.OdataVersion.v4]]
|
|
55
57
|
},
|
|
56
58
|
[types_1.TemplateType.AnalyticalListPage]: {
|
|
57
59
|
baseComponent: appComponentLibFioriElements,
|
|
58
|
-
ui5Libs: [...commonUi5Libs[types_1.OdataVersion.v4], 'sap.
|
|
60
|
+
ui5Libs: [...commonUi5Libs[types_1.OdataVersion.v4], 'sap.ushell'],
|
|
61
|
+
manifestLibs: [...commonUi5Libs[types_1.OdataVersion.v4]]
|
|
59
62
|
},
|
|
60
63
|
[types_1.TemplateType.Worklist]: {
|
|
61
64
|
baseComponent: appComponentLibFioriElements,
|
|
62
|
-
ui5Libs: [...commonUi5Libs[types_1.OdataVersion.v4], 'sap.
|
|
65
|
+
ui5Libs: [...commonUi5Libs[types_1.OdataVersion.v4], 'sap.ushell'],
|
|
66
|
+
manifestLibs: [...commonUi5Libs[types_1.OdataVersion.v4]]
|
|
63
67
|
},
|
|
64
68
|
[types_1.TemplateType.OverviewPage]: {
|
|
65
69
|
baseComponent: appComponentLibOVP,
|
|
66
|
-
ui5Libs: [...commonUi5Libs[types_1.OdataVersion.v4], 'sap.
|
|
70
|
+
ui5Libs: [...commonUi5Libs[types_1.OdataVersion.v4], 'sap.ushell', 'sap.ovp', 'sap.ui.rta', 'sap.ui.layout'],
|
|
71
|
+
manifestLibs: [...commonUi5Libs[types_1.OdataVersion.v4], 'sap.ovp', 'sap.ui.rta', 'sap.ui.layout']
|
|
67
72
|
},
|
|
68
73
|
[types_1.TemplateType.FlexibleProgrammingModel]: {
|
|
69
74
|
baseComponent: appComponentLibFioriElements,
|
|
70
|
-
ui5Libs: [...commonUi5Libs[types_1.OdataVersion.v4], 'sap.fe.core']
|
|
75
|
+
ui5Libs: [...commonUi5Libs[types_1.OdataVersion.v4], 'sap.fe.core', 'sap.ushell'],
|
|
76
|
+
manifestLibs: ['sap.m', 'sap.fe.core']
|
|
71
77
|
}
|
|
72
78
|
}
|
|
73
79
|
};
|
|
@@ -93,6 +99,17 @@ function getTemplateUi5Libs(type, version) {
|
|
|
93
99
|
return templateLibs[version][type]?.ui5Libs ?? [];
|
|
94
100
|
}
|
|
95
101
|
exports.getTemplateUi5Libs = getTemplateUi5Libs;
|
|
102
|
+
/**
|
|
103
|
+
* Gets the required manifest libs for the specified template type and OData version.
|
|
104
|
+
*
|
|
105
|
+
* @param type - The template type of the required base component
|
|
106
|
+
* @param version - The odata service version determines the appropriate base component to use
|
|
107
|
+
* @returns The manifest libs required by the specified template type and OData version
|
|
108
|
+
*/
|
|
109
|
+
function getTemplateManifestLibs(type, version) {
|
|
110
|
+
return templateLibs[version][type]?.manifestLibs ?? [];
|
|
111
|
+
}
|
|
112
|
+
exports.getTemplateManifestLibs = getTemplateManifestLibs;
|
|
96
113
|
exports.TemplateTypeAttributes = {
|
|
97
114
|
[types_1.TemplateType.Worklist]: {
|
|
98
115
|
supportedODataVersions: [types_1.OdataVersion.v2, types_1.OdataVersion.v4],
|
package/dist/fpmConfig.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.generateFpmConfig = void 0;
|
|
4
|
-
const path_1 = require("path");
|
|
5
4
|
const fe_fpm_writer_1 = require("@sap-ux/fe-fpm-writer");
|
|
6
|
-
const ui5_config_1 = require("@sap-ux/ui5-config");
|
|
7
5
|
/**
|
|
8
6
|
* Processes the template for the Flexible Programming Model (FPM).
|
|
9
7
|
* Generates a custom page and updates the UI5 local yaml.
|
|
@@ -21,10 +19,6 @@ async function generateFpmConfig(feApp, basePath, fs) {
|
|
|
21
19
|
minUI5Version: feApp.ui5?.minUI5Version,
|
|
22
20
|
typescript: feApp.appOptions?.typescript
|
|
23
21
|
}, fs);
|
|
24
|
-
const ui5LocalConfigPath = (0, path_1.join)(basePath, 'ui5-local.yaml');
|
|
25
|
-
const ui5LocalConfig = await ui5_config_1.UI5Config.newInstance(fs.read(ui5LocalConfigPath));
|
|
26
|
-
ui5LocalConfig.addUI5Libs(['sap.fe.templates']);
|
|
27
|
-
fs.write(ui5LocalConfigPath, ui5LocalConfig.toString());
|
|
28
22
|
}
|
|
29
23
|
exports.generateFpmConfig = generateFpmConfig;
|
|
30
24
|
//# sourceMappingURL=fpmConfig.js.map
|
package/dist/index.js
CHANGED
|
@@ -66,24 +66,6 @@ function getTypeScriptIgnoreGlob(feApp, coercedUI5Version) {
|
|
|
66
66
|
}
|
|
67
67
|
return ignore;
|
|
68
68
|
}
|
|
69
|
-
/**
|
|
70
|
-
* Configures the UI5 libraries based on the project type and template type.
|
|
71
|
-
*
|
|
72
|
-
* @param feApp - The FE app config.
|
|
73
|
-
* @param isEdmxProjectType - Whether the project is of EDMX type.
|
|
74
|
-
* @returns The configured UI5 libraries, or undefined if not applicable.
|
|
75
|
-
*/
|
|
76
|
-
function configureUi5Libs(feApp, isEdmxProjectType) {
|
|
77
|
-
let ui5Libs;
|
|
78
|
-
if (isEdmxProjectType) {
|
|
79
|
-
ui5Libs = feApp.ui5?.ui5Libs;
|
|
80
|
-
// FPM to preload sap.fe.templates for FLP template
|
|
81
|
-
if (feApp.template.type === types_1.TemplateType.FlexibleProgrammingModel) {
|
|
82
|
-
ui5Libs.push('sap.fe.templates');
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
return ui5Libs;
|
|
86
|
-
}
|
|
87
69
|
/**
|
|
88
70
|
* Generate a UI5 application based on the specified Fiori Elements floorplan template.
|
|
89
71
|
*
|
|
@@ -119,7 +101,7 @@ async function generate(basePath, data, fs) {
|
|
|
119
101
|
const isEdmxProjectType = feApp.app.projectType === 'EDMXBackend';
|
|
120
102
|
// Get resource bootstrap URLs based on the project type
|
|
121
103
|
const { uShellBootstrapResourceUrl, uiBootstrapResourceUrl } = (0, fiori_generator_shared_1.getBootstrapResourceUrls)(isEdmxProjectType, feApp.ui5?.frameworkUrl, feApp.ui5?.version);
|
|
122
|
-
const ui5Libs =
|
|
104
|
+
const ui5Libs = isEdmxProjectType ? feApp.ui5?.ui5Libs : undefined;
|
|
123
105
|
// Define template options with changes preview and loader settings based on project type
|
|
124
106
|
const templateOptions = (0, defaults_1.getTemplateOptions)(isEdmxProjectType, feApp.service.version, feApp.ui5?.version);
|
|
125
107
|
const appConfig = {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-ux/fiori-elements-writer",
|
|
3
3
|
"description": "SAP Fiori elements application writer",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.8",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/SAP/open-ux-tools.git",
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
"mem-fs-editor": "9.4.0",
|
|
28
28
|
"read-pkg-up": "7.0.1",
|
|
29
29
|
"semver": "7.5.4",
|
|
30
|
-
"@sap-ux/odata-service-writer": "0.22.
|
|
31
|
-
"@sap-ux/ui5-application-writer": "1.1.
|
|
32
|
-
"@sap-ux/fe-fpm-writer": "0.27.
|
|
33
|
-
"@sap-ux/ui5-config": "0.24.
|
|
30
|
+
"@sap-ux/odata-service-writer": "0.22.4",
|
|
31
|
+
"@sap-ux/ui5-application-writer": "1.1.5",
|
|
32
|
+
"@sap-ux/fe-fpm-writer": "0.27.7",
|
|
33
|
+
"@sap-ux/ui5-config": "0.24.1",
|
|
34
34
|
"@sap-ux/ui5-test-writer": "0.4.1",
|
|
35
|
-
"@sap-ux/fiori-generator-shared": "0.3.
|
|
35
|
+
"@sap-ux/fiori-generator-shared": "0.3.17"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/ejs": "3.1.2",
|