@sap-ux/fiori-elements-writer 0.21.3 → 0.21.4
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/templateAttributes.js +7 -7
- package/dist/index.js +15 -35
- package/package.json +5 -5
|
@@ -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.ushell', 'sap.fe.templates']
|
|
27
27
|
};
|
|
28
28
|
const templateLibs = {
|
|
29
29
|
[types_1.OdataVersion.v2]: {
|
|
@@ -47,27 +47,27 @@ const templateLibs = {
|
|
|
47
47
|
[types_1.OdataVersion.v4]: {
|
|
48
48
|
[types_1.TemplateType.ListReportObjectPage]: {
|
|
49
49
|
baseComponent: appComponentLibFioriElements,
|
|
50
|
-
ui5Libs:
|
|
50
|
+
ui5Libs: commonUi5Libs[types_1.OdataVersion.v4]
|
|
51
51
|
},
|
|
52
52
|
[types_1.TemplateType.FormEntryObjectPage]: {
|
|
53
53
|
baseComponent: appComponentLibFioriElements,
|
|
54
|
-
ui5Libs:
|
|
54
|
+
ui5Libs: commonUi5Libs[types_1.OdataVersion.v4]
|
|
55
55
|
},
|
|
56
56
|
[types_1.TemplateType.AnalyticalListPage]: {
|
|
57
57
|
baseComponent: appComponentLibFioriElements,
|
|
58
|
-
ui5Libs:
|
|
58
|
+
ui5Libs: commonUi5Libs[types_1.OdataVersion.v4]
|
|
59
59
|
},
|
|
60
60
|
[types_1.TemplateType.Worklist]: {
|
|
61
61
|
baseComponent: appComponentLibFioriElements,
|
|
62
|
-
ui5Libs:
|
|
62
|
+
ui5Libs: commonUi5Libs[types_1.OdataVersion.v4]
|
|
63
63
|
},
|
|
64
64
|
[types_1.TemplateType.OverviewPage]: {
|
|
65
65
|
baseComponent: appComponentLibOVP,
|
|
66
|
-
ui5Libs: [...commonUi5Libs[types_1.OdataVersion.v4], 'sap.
|
|
66
|
+
ui5Libs: [...commonUi5Libs[types_1.OdataVersion.v4], 'sap.ovp', 'sap.ui.rta', 'sap.ui.layout']
|
|
67
67
|
},
|
|
68
68
|
[types_1.TemplateType.FlexibleProgrammingModel]: {
|
|
69
69
|
baseComponent: appComponentLibFioriElements,
|
|
70
|
-
ui5Libs: [...commonUi5Libs[types_1.OdataVersion.v4], 'sap.fe.
|
|
70
|
+
ui5Libs: [...commonUi5Libs[types_1.OdataVersion.v4], 'sap.fe.templates']
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
};
|
package/dist/index.js
CHANGED
|
@@ -45,7 +45,6 @@ Object.defineProperty(exports, "minSupportedUI5VersionV4", { enumerable: true, g
|
|
|
45
45
|
const templateAttributes_2 = require("./data/templateAttributes");
|
|
46
46
|
const manifestSettings_1 = require("./data/manifestSettings");
|
|
47
47
|
const semver_1 = __importDefault(require("semver"));
|
|
48
|
-
const ui5_config_1 = require("@sap-ux/ui5-config");
|
|
49
48
|
const i18n_1 = require("./i18n");
|
|
50
49
|
exports.V2_FE_TYPES_AVAILABLE = '1.108.0';
|
|
51
50
|
/**
|
|
@@ -86,7 +85,7 @@ function getTypeScriptIgnoreGlob(feApp, coercedUI5Version) {
|
|
|
86
85
|
* @returns Reference to a mem-fs-editor
|
|
87
86
|
*/
|
|
88
87
|
function generate(basePath, data, fs) {
|
|
89
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r
|
|
88
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
90
89
|
return __awaiter(this, void 0, void 0, function* () {
|
|
91
90
|
// Load i18n translations asynchronously to ensure proper initialization.
|
|
92
91
|
// This addresses occasional issues where i18n is not initialized in time, causing tests to fail.
|
|
@@ -114,21 +113,10 @@ function generate(basePath, data, fs) {
|
|
|
114
113
|
if (((_c = feApp.appOptions) === null || _c === void 0 ? void 0 : _c.typescript) === true) {
|
|
115
114
|
ignore = getTypeScriptIgnoreGlob(feApp, coercedUI5Version);
|
|
116
115
|
}
|
|
117
|
-
|
|
118
|
-
const ushellLib = 'sap.ushell';
|
|
119
|
-
const ui5Libs = Array.isArray((_d = feApp.ui5) === null || _d === void 0 ? void 0 : _d.ui5Libs) ? feApp.ui5.ui5Libs : [(_e = feApp.ui5) === null || _e === void 0 ? void 0 : _e.ui5Libs];
|
|
120
|
-
if (!ui5Libs.includes(ushellLib)) {
|
|
121
|
-
ui5Libs.push(ushellLib);
|
|
122
|
-
}
|
|
123
|
-
fs.copyTpl((0, path_1.join)(rootTemplatesPath, 'common', 'add', '**/*.*'), basePath, Object.assign(Object.assign({}, feApp), { ui5: Object.assign(Object.assign({}, feApp.ui5), { ui5Libs }), templateOptions,
|
|
116
|
+
fs.copyTpl((0, path_1.join)(rootTemplatesPath, 'common', 'add', '**/*.*'), basePath, Object.assign(Object.assign({}, feApp), { templateOptions,
|
|
124
117
|
escapeFLPText: templateAttributes_2.escapeFLPText }), undefined, {
|
|
125
118
|
globOptions: { ignore, dot: true }
|
|
126
119
|
});
|
|
127
|
-
// Extend ui5-local.yaml
|
|
128
|
-
const ui5LocalConfigPath = (0, path_1.join)(basePath, 'ui5-local.yaml');
|
|
129
|
-
const ui5LocalConfig = yield ui5_config_1.UI5Config.newInstance(fs.read(ui5LocalConfigPath));
|
|
130
|
-
ui5LocalConfig.addUI5Libs([ushellLib]);
|
|
131
|
-
fs.write(ui5LocalConfigPath, ui5LocalConfig.toString());
|
|
132
120
|
// Extend common files
|
|
133
121
|
const packagePath = (0, path_1.join)(basePath, 'package.json');
|
|
134
122
|
// Extend package.json
|
|
@@ -139,21 +127,13 @@ function generate(basePath, data, fs) {
|
|
|
139
127
|
(0, fe_fpm_writer_1.generateCustomPage)(basePath, {
|
|
140
128
|
entity: config.entityConfig.mainEntityName,
|
|
141
129
|
name: config.pageName,
|
|
142
|
-
minUI5Version: (
|
|
143
|
-
typescript: (
|
|
130
|
+
minUI5Version: (_d = feApp.ui5) === null || _d === void 0 ? void 0 : _d.minUI5Version,
|
|
131
|
+
typescript: (_e = feApp.appOptions) === null || _e === void 0 ? void 0 : _e.typescript
|
|
144
132
|
}, fs);
|
|
145
|
-
// Updating ui5-local for V4 FPM specific libs
|
|
146
|
-
if (feApp.service.version === odata_service_writer_1.OdataVersion.v4) {
|
|
147
|
-
const ui5LocalConfigPath = (0, path_1.join)(basePath, 'ui5-local.yaml');
|
|
148
|
-
const ui5LocalConfig = yield ui5_config_1.UI5Config.newInstance(fs.read(ui5LocalConfigPath));
|
|
149
|
-
const ui5Libs = ['sap.fe.templates'];
|
|
150
|
-
ui5LocalConfig.addUI5Libs(ui5Libs);
|
|
151
|
-
fs.write(ui5LocalConfigPath, ui5LocalConfig.toString());
|
|
152
|
-
}
|
|
153
133
|
}
|
|
154
134
|
else {
|
|
155
135
|
// Copy odata version specific common templates and version specific, floorplan specific templates
|
|
156
|
-
const templateVersionPath = (0, path_1.join)(rootTemplatesPath, `v${(
|
|
136
|
+
const templateVersionPath = (0, path_1.join)(rootTemplatesPath, `v${(_f = feApp.service) === null || _f === void 0 ? void 0 : _f.version}`);
|
|
157
137
|
[(0, path_1.join)(templateVersionPath, 'common', 'add'), (0, path_1.join)(templateVersionPath, feApp.template.type, 'add')].forEach((templatePath) => {
|
|
158
138
|
fs.copyTpl((0, path_1.join)(templatePath, '**/*.*'), basePath, feApp, {}, { ignoreNoMatch: true, globOptions: { ignore, dot: true } });
|
|
159
139
|
});
|
|
@@ -163,22 +143,22 @@ function generate(basePath, data, fs) {
|
|
|
163
143
|
const packageJson = JSON.parse(fs.read(packagePath));
|
|
164
144
|
// Add tests only if v4, for now, and we have metadata (and therefore a mock server config) or has a cds service
|
|
165
145
|
const addTest = !!feApp.appOptions.addTests &&
|
|
166
|
-
((
|
|
167
|
-
(!!((
|
|
168
|
-
packageJson.scripts = Object.assign((
|
|
169
|
-
localOnly: !((
|
|
170
|
-
addMock: !!((
|
|
146
|
+
((_g = feApp.service) === null || _g === void 0 ? void 0 : _g.version) === odata_service_writer_1.OdataVersion.v4 &&
|
|
147
|
+
(!!((_h = feApp.service) === null || _h === void 0 ? void 0 : _h.metadata) || feApp.service.type === odata_service_writer_1.ServiceType.CDS);
|
|
148
|
+
packageJson.scripts = Object.assign((_j = packageJson.scripts) !== null && _j !== void 0 ? _j : {}, Object.assign({}, (0, packageConfig_1.getPackageJsonTasks)({
|
|
149
|
+
localOnly: !((_k = feApp.service) === null || _k === void 0 ? void 0 : _k.url),
|
|
150
|
+
addMock: !!((_l = feApp.service) === null || _l === void 0 ? void 0 : _l.metadata),
|
|
171
151
|
addTest,
|
|
172
|
-
sapClient: (
|
|
152
|
+
sapClient: (_m = feApp.service) === null || _m === void 0 ? void 0 : _m.client,
|
|
173
153
|
flpAppId: feApp.app.flpAppId,
|
|
174
|
-
startFile: (
|
|
175
|
-
localStartFile: (
|
|
176
|
-
generateIndex: (
|
|
154
|
+
startFile: (_o = data === null || data === void 0 ? void 0 : data.app) === null || _o === void 0 ? void 0 : _o.startFile,
|
|
155
|
+
localStartFile: (_p = data === null || data === void 0 ? void 0 : data.app) === null || _p === void 0 ? void 0 : _p.localStartFile,
|
|
156
|
+
generateIndex: (_q = feApp.appOptions) === null || _q === void 0 ? void 0 : _q.generateIndex
|
|
177
157
|
})));
|
|
178
158
|
fs.writeJSON(packagePath, packageJson);
|
|
179
159
|
if (addTest) {
|
|
180
160
|
(0, ui5_test_writer_1.generateOPAFiles)(basePath, {
|
|
181
|
-
htmlTarget: ((
|
|
161
|
+
htmlTarget: ((_r = feApp.appOptions) === null || _r === void 0 ? void 0 : _r.generateIndex)
|
|
182
162
|
? 'index.html'
|
|
183
163
|
: `test/flpSandbox.html?sap-ui-xx-viewCache=false#${feApp.app.flpAppId}`
|
|
184
164
|
}, 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.21.
|
|
4
|
+
"version": "0.21.4",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/SAP/open-ux-tools.git",
|
|
@@ -27,10 +27,10 @@
|
|
|
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.20.
|
|
31
|
-
"@sap-ux/ui5-application-writer": "0.26.
|
|
32
|
-
"@sap-ux/fe-fpm-writer": "0.24.
|
|
33
|
-
"@sap-ux/ui5-config": "0.22.
|
|
30
|
+
"@sap-ux/odata-service-writer": "0.20.5",
|
|
31
|
+
"@sap-ux/ui5-application-writer": "0.26.18",
|
|
32
|
+
"@sap-ux/fe-fpm-writer": "0.24.16",
|
|
33
|
+
"@sap-ux/ui5-config": "0.22.10",
|
|
34
34
|
"@sap-ux/ui5-test-writer": "0.3.3"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|