@sap-ux/ui5-application-writer 1.1.4 → 1.1.5

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.
@@ -90,6 +90,9 @@ function mergeUi5(ui5, options) {
90
90
  ui5.typesVersion ?? (options?.typescript ? ui5_config_1.getEsmTypesVersion : ui5_config_1.getTypesVersion)(merged.minUI5Version);
91
91
  merged.typesPackage = (0, ui5_config_1.getTypesPackage)(merged.typesVersion);
92
92
  merged.ui5Theme = ui5.ui5Theme ?? 'sap_fiori_3';
93
+ if (ui5.manifestLibs && ui5.manifestLibs.length > 0) {
94
+ merged.manifestLibs = (0, ui5Libs_1.getUI5Libs)(ui5.manifestLibs);
95
+ }
93
96
  merged.ui5Libs = (0, ui5Libs_1.getUI5Libs)(ui5.ui5Libs);
94
97
  return Object.assign({}, ui5, merged);
95
98
  }
package/dist/index.js CHANGED
@@ -53,15 +53,10 @@ async function generate(basePath, ui5AppConfig, fs) {
53
53
  }
54
54
  });
55
55
  ui5Config.addFioriToolsAppReloadMiddleware();
56
- // ui5-local.yaml
57
56
  if (isEdmxProjectType) {
58
57
  const ui5LocalConfigPath = (0, path_1.join)(basePath, 'ui5-local.yaml');
59
58
  // write ui5-local.yaml only for non-CAP applications
60
59
  const ui5LocalConfig = await ui5_config_1.UI5Config.newInstance(fs.read(ui5LocalConfigPath));
61
- // default UI5 lib
62
- if (!ui5App.ui5.ui5Libs.includes('sap.ushell')) {
63
- ui5App.ui5.ui5Libs.push('sap.ushell');
64
- }
65
60
  ui5LocalConfig.addUI5Framework(ui5App.ui5.framework, ui5App.ui5.localVersion, ui5App.ui5.ui5Libs, ui5App.ui5.ui5Theme);
66
61
  ui5LocalConfig.addFioriToolsAppReloadMiddleware();
67
62
  // Add optional features
package/dist/types.d.ts CHANGED
@@ -49,17 +49,95 @@ export interface App {
49
49
  };
50
50
  }
51
51
  export type UI5Framework = 'SAPUI5' | 'OpenUI5';
52
+ /**
53
+ * Configuration for a UI5 project.
54
+ */
52
55
  export interface UI5 {
56
+ /**
57
+ * The UI5 framework being used (e.g. OpenUI5, SAPUI5)
58
+ */
53
59
  framework: UI5Framework;
60
+ /**
61
+ * URL for UI5 framework.
62
+ */
54
63
  frameworkUrl: string;
64
+ /**
65
+ * The minimum required UI5 version for the project.
66
+ */
55
67
  minUI5Version: string;
68
+ /**
69
+ * The specific version of the UI5 framework being used in the project.
70
+ */
56
71
  version: string;
72
+ /**
73
+ * Local version of the UI5 application.
74
+ */
57
75
  localVersion: string;
76
+ /**
77
+ * Types version for UI5.
78
+ */
58
79
  typesVersion: string;
80
+ /**
81
+ * UI5 types package name.
82
+ */
59
83
  typesPackage: string;
84
+ /**
85
+ * The manifest descriptor version.
86
+ */
60
87
  descriptorVersion: string;
88
+ /**
89
+ * The UI5 libraries that are added as part of the project. (e.g. manifest.json, ui5-local.yaml, flpSandbox.html)
90
+ *
91
+ * ui5-local.yaml:
92
+ *
93
+ * @example
94
+ * ```yaml
95
+ * libraries:
96
+ * -name: sap.m
97
+ * -name: sap.ui.core
98
+ * -name: sap.ushell
99
+ * -name: sap.fe.templates
100
+ *```
101
+ * flpSandbox.html:
102
+ * @example
103
+ * ```HTML
104
+ * <script id="sap-ui-bootstrap"
105
+ * data-sap-ui-libs="sap.m,sap.ui.core,sap.ushell,sap.fe.templates">
106
+ * </script>
107
+ * ```
108
+ */
61
109
  ui5Libs: string | string[];
110
+ /**
111
+ * (Optional) These libraries will be added to the manifest.json file as sap.ui5 dependencies.
112
+ * If `manifestLibs` not provided, `ui5Libs` libraries added to the manifest.json by default.
113
+ *
114
+ * manifest.json:
115
+ *
116
+ * @example
117
+ * ```json
118
+ * "sap.ui5": {
119
+ * "flexEnabled": true,
120
+ * "dependencies": {
121
+ * "minUI5Version": "1.121.1",
122
+ * "libs": {
123
+ * "sap.m": {},
124
+ * "sap.ui.core": {},
125
+ * "sap.ushell": {},
126
+ * "sap.fe.templates": {}
127
+ * }
128
+ * },
129
+ * }
130
+ * ```
131
+ */
132
+ manifestLibs?: string | string[];
133
+ /**
134
+ * The default UI5 theme to be used in the project (e.g. 'sap_fiori_3').
135
+ */
62
136
  ui5Theme: string;
137
+ /**
138
+ * (Optional) Custom UI5 libraries that are included in the project.
139
+ * Added with ui5 dependencies in the manifest.json.
140
+ */
63
141
  customUi5Libs?: string[];
64
142
  }
65
143
  export interface AppOptions {
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.4",
12
+ "version": "1.1.5",
13
13
  "license": "Apache-2.0",
14
14
  "main": "dist/index.js",
15
15
  "files": [
@@ -27,7 +27,7 @@
27
27
  "mem-fs": "2.1.0",
28
28
  "mem-fs-editor": "9.4.0",
29
29
  "semver": "7.5.4",
30
- "@sap-ux/ui5-config": "0.24.0"
30
+ "@sap-ux/ui5-config": "0.24.1"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@types/ejs": "3.1.2",
@@ -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.26.7"
41
+ "@sap-ux/project-access": "1.26.9"
42
42
  },
43
43
  "engines": {
44
44
  "node": ">=18.x"
@@ -36,7 +36,7 @@
36
36
  "flexEnabled": true,
37
37
  "dependencies": {
38
38
  "minUI5Version": "<%- ui5.minUI5Version %>",
39
- "libs": {<% ui5.ui5Libs.concat(ui5.customUi5Libs ?? []).forEach((ui5Lib, idx, libs) => { %>
39
+ "libs": {<% (ui5.manifestLibs?.length ? ui5.manifestLibs : ui5.ui5Libs).concat(ui5.customUi5Libs ?? []).forEach((ui5Lib, idx, libs) => {%>
40
40
  <%- `"${ui5Lib}": {}${idx+1 < libs.length ? ',' : ''}` %><% }); %>
41
41
  }
42
42
  },