@ui5/builder 4.0.12 → 4.1.0

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/CHANGELOG.md CHANGED
@@ -2,7 +2,19 @@
2
2
  All notable changes to this project will be documented in this file.
3
3
  This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
4
4
 
5
- A list of unreleased changes can be found [here](https://github.com/SAP/ui5-builder/compare/v4.0.11...HEAD).
5
+ A list of unreleased changes can be found [here](https://github.com/SAP/ui5-builder/compare/v4.1.0...HEAD).
6
+
7
+ <a name="v4.1.0"></a>
8
+ ## [v4.1.0] - 2025-10-21
9
+ ### Features
10
+ - Enhance generateFlexChangeBundle task to add new 'flexBundle' property to the manifest.json ([#1164](https://github.com/SAP/ui5-builder/issues/1164)) [`a48e474`](https://github.com/SAP/ui5-builder/commit/a48e474b1bfb9f2f11da44e908341af370711309)
11
+
12
+
13
+ <a name="v4.0.13"></a>
14
+ ## [v4.0.13] - 2025-10-07
15
+ ### Bug Fixes
16
+ - **JSDoc:** avoid errors when symbol has no events [`76a072c`](https://github.com/SAP/ui5-builder/commit/76a072cd0e098c4ad1caea22225c955f117a2a3b)
17
+
6
18
 
7
19
  <a name="v4.0.11"></a>
8
20
  ## [v4.0.11] - 2025-09-11
@@ -986,6 +998,8 @@ to load the custom bundle file instead.
986
998
 
987
999
  ### Features
988
1000
  - Add ability to configure component preloads and custom bundles [`2241e5f`](https://github.com/SAP/ui5-builder/commit/2241e5ff98fd95f1f80cc74959655ae7a9c660e7)
1001
+ [v4.1.0]: https://github.com/SAP/ui5-builder/compare/v4.0.13...v4.1.0
1002
+ [v4.0.13]: https://github.com/SAP/ui5-builder/compare/v4.0.11...v4.0.13
989
1003
  [v4.0.11]: https://github.com/SAP/ui5-builder/compare/v4.0.10...v4.0.11
990
1004
  [v4.0.10]: https://github.com/SAP/ui5-builder/compare/v4.0.9...v4.0.10
991
1005
  [v4.0.9]: https://github.com/SAP/ui5-builder/compare/v4.0.8...v4.0.9
@@ -14,7 +14,7 @@ import semver from "semver";
14
14
  * at runtime.
15
15
  * If a change bundle is created, "sap.ui.fl" is added as a dependency to the manifest.json if not already present -
16
16
  * if the dependency is already listed but lazy-loaded, lazy loading is disabled.
17
- * If minUI5Version >= 1.73 flexibility-bundle.json will be create.
17
+ * If minUI5Version >= 1.73 flexibility-bundle.json is created.
18
18
  * If there are control variants and minUI5Version < 1.73 build will break and throw an error.
19
19
  *
20
20
  * @public
@@ -38,29 +38,34 @@ export default async function({workspace, taskUtil, options = {}}) {
38
38
  pathPrefix = `/resources/${namespace}`;
39
39
  }
40
40
 
41
- function updateJson(data) {
42
- // ensure the existence of the libs section in the dependencies
41
+ function updateJson(data, bBundleCreated) {
43
42
  data["sap.ui5"] = data["sap.ui5"] || {};
44
- data["sap.ui5"].dependencies = data["sap.ui5"].dependencies || {};
45
- const mLibs = data["sap.ui5"].dependencies.libs = data["sap.ui5"].dependencies.libs || {};
46
-
47
- if (mLibs["sap.ui.fl"]) {
48
- log.verbose("sap.ui.fl found in manifest.json");
49
- if (mLibs["sap.ui.fl"].lazy) {
50
- log.verbose("sap.ui.fl 'lazy' attribute found in manifest.json, setting it to false...");
51
- mLibs["sap.ui.fl"].lazy = false;
43
+ // explicit set the flag to inform the runtime if a bundle is present before the preload can be interpreted
44
+ data["sap.ui5"].flexBundle = bBundleCreated;
45
+
46
+ if (bBundleCreated) {
47
+ // ensure the existence of the libs section in the dependencies
48
+ data["sap.ui5"].dependencies = data["sap.ui5"].dependencies || {};
49
+ const mLibs = data["sap.ui5"].dependencies.libs = data["sap.ui5"].dependencies.libs || {};
50
+
51
+ if (mLibs["sap.ui.fl"]) {
52
+ log.verbose("sap.ui.fl found in manifest.json");
53
+ if (mLibs["sap.ui.fl"].lazy) {
54
+ log.verbose("sap.ui.fl 'lazy' attribute found in manifest.json, setting it to false...");
55
+ mLibs["sap.ui.fl"].lazy = false;
56
+ }
57
+ } else {
58
+ log.verbose("sap.ui.fl not found in manifest.json, inserting it...");
59
+ mLibs["sap.ui.fl"] = {};
52
60
  }
53
- } else {
54
- log.verbose("sap.ui.fl not found in manifest.json, inserting it...");
55
- mLibs["sap.ui.fl"] = {};
56
61
  }
57
62
  }
58
63
 
59
- async function updateFLdependency() {
64
+ async function updateManifestWithFlDependencyAndFlexBundleFlag(bBundleCreated) {
60
65
  const manifestResource = await workspace.byPath(`${pathPrefix}/manifest.json`);
61
66
  const manifestContent = JSON.parse(await manifestResource.getString());
62
67
 
63
- updateJson(manifestContent);
68
+ updateJson(manifestContent, bBundleCreated);
64
69
  manifestResource.setString(JSON.stringify(manifestContent, null, "\t"));
65
70
 
66
71
  await workspace.write(manifestResource);
@@ -83,6 +88,9 @@ export default async function({workspace, taskUtil, options = {}}) {
83
88
  log.verbose("Collecting flexibility changes");
84
89
  const allResources = await workspace.byGlob(
85
90
  `${pathPrefix}/changes/*.{change,variant,ctrl_variant,ctrl_variant_change,ctrl_variant_management_change}`);
91
+
92
+ let bBundleCreated = false;
93
+
86
94
  if (allResources.length > 0) {
87
95
  const versionArray = await readManifestMinUI5Version();
88
96
  const versions = versionArray.map((version) => semver.coerce(version));
@@ -109,9 +117,7 @@ export default async function({workspace, taskUtil, options = {}}) {
109
117
  return workspace.write(resource);
110
118
  }));
111
119
  // Add the sap.ui.fl dependency if a bundle has been created
112
- if (processedResources.length > 0) {
113
- await updateFLdependency();
114
- }
120
+ bBundleCreated = processedResources.length > 0;
115
121
 
116
122
  // Do not write bundled source files to build result
117
123
  if (taskUtil) {
@@ -120,4 +126,7 @@ export default async function({workspace, taskUtil, options = {}}) {
120
126
  });
121
127
  }
122
128
  }
129
+
130
+ // Always append the flexBundle flag to the manifest.json, even if no bundle was created
131
+ await updateManifestWithFlDependencyAndFlexBundleFlag(bBundleCreated);
123
132
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ui5/builder",
3
- "version": "4.0.12",
3
+ "version": "4.1.0",
4
4
  "description": "UI5 CLI - Builder",
5
5
  "author": {
6
6
  "name": "SAP SE",
@@ -129,10 +129,10 @@
129
129
  "escope": "^4.0.0",
130
130
  "espree": "^10.4.0",
131
131
  "graceful-fs": "^4.2.11",
132
- "jsdoc": "^4.0.4",
132
+ "jsdoc": "^4.0.5",
133
133
  "less-openui5": "^0.11.6",
134
134
  "pretty-data": "^0.40.0",
135
- "semver": "^7.7.2",
135
+ "semver": "^7.7.3",
136
136
  "terser": "^5.44.0",
137
137
  "workerpool": "^9.3.4",
138
138
  "xml2js": "^0.6.2"
@@ -147,7 +147,7 @@
147
147
  "cross-env": "^7.0.3",
148
148
  "depcheck": "^1.4.7",
149
149
  "docdash": "^2.0.2",
150
- "eslint": "^9.37.0",
150
+ "eslint": "^9.38.0",
151
151
  "eslint-config-google": "^0.14.0",
152
152
  "eslint-plugin-ava": "^15.1.0",
153
153
  "eslint-plugin-jsdoc": "^52.0.4",