@sap-ux/fiori-elements-writer 0.5.2 → 0.5.3
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 +12 -8
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -45,7 +45,7 @@ const semver_1 = __importDefault(require("semver"));
|
|
|
45
45
|
* @returns Reference to a mem-fs-editor
|
|
46
46
|
*/
|
|
47
47
|
function generate(basePath, data, fs) {
|
|
48
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
48
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
49
49
|
return __awaiter(this, void 0, void 0, function* () {
|
|
50
50
|
// Clone rather than modifying callers refs
|
|
51
51
|
const feApp = cloneDeep_1.default(data);
|
|
@@ -78,14 +78,18 @@ function generate(basePath, data, fs) {
|
|
|
78
78
|
// Special handling for FPM because it is not based on template files but used the fpm writer
|
|
79
79
|
if (feApp.template.type === types_1.TemplateType.FlexibleProgrammingModel) {
|
|
80
80
|
const config = feApp.template.settings;
|
|
81
|
+
// Convert string version to float for FPM writer
|
|
82
|
+
const minUI5VerSemVer = semver_1.default.coerce((_d = feApp.ui5) === null || _d === void 0 ? void 0 : _d.minUI5Version);
|
|
83
|
+
const minUI5Version = parseFloat(`${minUI5VerSemVer.major}.${minUI5VerSemVer.minor}`);
|
|
81
84
|
fe_fpm_writer_1.generateCustomPage(basePath, {
|
|
82
85
|
entity: config.entityConfig.mainEntityName,
|
|
83
|
-
name: config.pageName
|
|
86
|
+
name: config.pageName,
|
|
87
|
+
ui5Version: minUI5Version
|
|
84
88
|
}, fs);
|
|
85
89
|
}
|
|
86
90
|
else {
|
|
87
91
|
// Copy version specific common templates and version specific, floorplan specific templates
|
|
88
|
-
const templateVersionPath = path_1.join(rootTemplatesPath, `v${(
|
|
92
|
+
const templateVersionPath = path_1.join(rootTemplatesPath, `v${(_e = feApp.service) === null || _e === void 0 ? void 0 : _e.version}`);
|
|
89
93
|
[path_1.join(templateVersionPath, 'common', 'add'), path_1.join(templateVersionPath, feApp.template.type, 'add')].forEach((templatePath) => {
|
|
90
94
|
fs.copyTpl(path_1.join(templatePath, '**/*.*'), basePath, feApp, {}, { ignoreNoMatch: true });
|
|
91
95
|
});
|
|
@@ -94,12 +98,12 @@ function generate(basePath, data, fs) {
|
|
|
94
98
|
manifestSettings_1.extendManifestJson(fs, basePath, rootTemplatesPath, feApp);
|
|
95
99
|
const packageJson = JSON.parse(fs.read(packagePath));
|
|
96
100
|
packageJson.scripts = Object.assign(packageJson.scripts, Object.assign({}, packageConfig_1.getPackageJsonTasks({
|
|
97
|
-
localOnly: !((
|
|
98
|
-
addMock: !!((
|
|
99
|
-
sapClient: (
|
|
101
|
+
localOnly: !((_f = feApp.service) === null || _f === void 0 ? void 0 : _f.url),
|
|
102
|
+
addMock: !!((_g = feApp.service) === null || _g === void 0 ? void 0 : _g.metadata),
|
|
103
|
+
sapClient: (_h = feApp.service) === null || _h === void 0 ? void 0 : _h.client,
|
|
100
104
|
flpAppId: feApp.app.flpAppId,
|
|
101
|
-
startFile: (
|
|
102
|
-
localStartFile: (
|
|
105
|
+
startFile: (_j = data === null || data === void 0 ? void 0 : data.app) === null || _j === void 0 ? void 0 : _j.startFile,
|
|
106
|
+
localStartFile: (_k = data === null || data === void 0 ? void 0 : data.app) === null || _k === void 0 ? void 0 : _k.localStartFile
|
|
103
107
|
})));
|
|
104
108
|
fs.writeJSON(packagePath, packageJson);
|
|
105
109
|
return fs;
|
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": "0.5.
|
|
4
|
+
"version": "0.5.3",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/SAP/open-ux-tools.git",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@sap-ux/odata-service-writer": "0.14.6",
|
|
24
24
|
"@sap-ux/ui5-application-writer": "0.15.1",
|
|
25
|
-
"@sap-ux/fe-fpm-writer": "0.14.
|
|
25
|
+
"@sap-ux/fe-fpm-writer": "0.14.3",
|
|
26
26
|
"@sap-ux/ui5-config": "0.14.5",
|
|
27
27
|
"ejs": "3.1.7",
|
|
28
28
|
"i18next": "20.3.2",
|