@sap-ux/ui5-application-writer 1.1.0 → 1.1.2

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
@@ -5,6 +5,7 @@ const path_1 = require("path");
5
5
  const mem_fs_1 = require("mem-fs");
6
6
  const mem_fs_editor_1 = require("mem-fs-editor");
7
7
  const ui5_config_1 = require("@sap-ux/ui5-config");
8
+ const project_access_1 = require("@sap-ux/project-access");
8
9
  const data_1 = require("./data");
9
10
  const ui5Libs_1 = require("./data/ui5Libs");
10
11
  const options_1 = require("./options");
@@ -117,7 +118,8 @@ async function enableTypescript(basePath, fs) {
117
118
  const manifest = fs.readJSON(manifestPath);
118
119
  const ui5Config = await ui5_config_1.UI5Config.newInstance(fs.read(ui5ConfigPath));
119
120
  const tmplPath = (0, path_1.join)(__dirname, '..', 'templates');
120
- const typesVersion = (0, ui5_config_1.getEsmTypesVersion)(manifest['sap.ui5']?.dependencies?.minUI5Version);
121
+ //By chosing getMinimumUI5Version we assume that the esm type is compatible if there are multiple versions.
122
+ const typesVersion = (0, ui5_config_1.getEsmTypesVersion)((0, project_access_1.getMinimumUI5Version)(manifest));
121
123
  const typesPackage = (0, ui5_config_1.getTypesPackage)(typesVersion);
122
124
  const ui5App = {
123
125
  app: manifest['sap.app'],
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "bugs": {
10
10
  "url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Aui5-application-writer"
11
11
  },
12
- "version": "1.1.0",
12
+ "version": "1.1.2",
13
13
  "license": "Apache-2.0",
14
14
  "main": "dist/index.js",
15
15
  "files": [
@@ -20,7 +20,7 @@
20
20
  "!dist/**/*.map"
21
21
  ],
22
22
  "dependencies": {
23
- "@ui5/manifest": "1.61.0",
23
+ "@ui5/manifest": "1.66.0",
24
24
  "ejs": "3.1.10",
25
25
  "i18next": "21.10.0",
26
26
  "lodash": "4.17.21",
@@ -38,7 +38,7 @@
38
38
  "@types/semver": "7.5.2",
39
39
  "fs-extra": "10.0.0",
40
40
  "@sap-ux/eslint-plugin-fiori-tools": "0.5.0",
41
- "@sap-ux/project-access": "1.25.4"
41
+ "@sap-ux/project-access": "1.25.7"
42
42
  },
43
43
  "engines": {
44
44
  "node": ">=18.x"
@@ -41,6 +41,23 @@
41
41
  });
42
42
  return libOrCompKeysStringTmp;
43
43
  }
44
+ function getComponentUsageNames(compUsages, libOrCompKeysString) {
45
+ var libOrCompKeysStringTmp = libOrCompKeysString;
46
+ var compNames = Object.keys(compUsages).map(function (compUsageKey) {
47
+ return compUsages[compUsageKey].name;
48
+ });
49
+ compNames.forEach(function (compName) {
50
+ // ignore libs or Components that start with SAPUI5 delivered namespaces
51
+ if (!ui5Libs.some(function (substring) { return compName === substring || compName.startsWith(substring + "."); })) {
52
+ if (libOrCompKeysStringTmp.length > 0) {
53
+ libOrCompKeysStringTmp = libOrCompKeysStringTmp + "," + compName;
54
+ } else {
55
+ libOrCompKeysStringTmp = compName;
56
+ }
57
+ }
58
+ });
59
+ return libOrCompKeysStringTmp;
60
+ }
44
61
  return new Promise(function (resolve, reject) {
45
62
  $.ajax(url)
46
63
  .done(function (manifest) {
@@ -60,7 +77,7 @@
60
77
  manifest["sap.ui5"] &&
61
78
  manifest["sap.ui5"].componentUsages
62
79
  ) {
63
- result = getKeys(manifest["sap.ui5"].componentUsages, result);
80
+ result = getComponentUsageNames(manifest["sap.ui5"].componentUsages, result);
64
81
  }
65
82
  }
66
83
  resolve(result);
@@ -211,7 +228,9 @@ sap.registerComponentDependencyPaths(manifestUri)
211
228
  sap.ui.getCore().attachInit(function () {
212
229
  registerSAPFonts();
213
230
  // initialize the ushell sandbox component
214
- sap.ushell.Container.createRenderer().placeAt("content");
231
+ sap.ushell.Container.createRenderer(true).then(function (component) {
232
+ component.placeAt("content");
233
+ });
215
234
  });
216
235
  }
217
236
  });