@ui5/builder 3.2.0 → 3.3.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/.reuse/dep5 CHANGED
@@ -25,9 +25,9 @@ Disclaimer: The code in this project may include calls to APIs (“API Calls”)
25
25
  parties the right to use of access any SAP External Product, through API Calls.
26
26
 
27
27
  Files: *
28
- Copyright: 2018-2023 SAP SE or an SAP affiliate company and UI5 Tooling contributors
28
+ Copyright: 2018-2024 SAP SE or an SAP affiliate company and UI5 Tooling contributors
29
29
  License: Apache-2.0
30
30
 
31
31
  Files: lib/processors/jsdoc/lib/*
32
- Copyright: 2009-2023 SAP SE or an SAP affiliate company and OpenUI5 contributors
32
+ Copyright: 2009-2024 SAP SE or an SAP affiliate company and OpenUI5 contributors
33
33
  License: Apache-2.0
package/CHANGELOG.md CHANGED
@@ -2,7 +2,13 @@
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/v3.2.0...HEAD).
5
+ A list of unreleased changes can be found [here](https://github.com/SAP/ui5-builder/compare/v3.3.0...HEAD).
6
+
7
+ <a name="v3.3.0"></a>
8
+ ## [v3.3.0] - 2024-01-18
9
+ ### Features
10
+ - **flexChangesBundler:** Merge existing with new flexibility-bundle.json [`fd070ab`](https://github.com/SAP/ui5-builder/commit/fd070abaa22680ee70b448fa0ac406a8f2b57cc5)
11
+
6
12
 
7
13
  <a name="v3.2.0"></a>
8
14
  ## [v3.2.0] - 2023-12-12
@@ -851,6 +857,7 @@ to load the custom bundle file instead.
851
857
 
852
858
  ### Features
853
859
  - Add ability to configure component preloads and custom bundles [`2241e5f`](https://github.com/SAP/ui5-builder/commit/2241e5ff98fd95f1f80cc74959655ae7a9c660e7)
860
+ [v3.3.0]: https://github.com/SAP/ui5-builder/compare/v3.2.0...v3.3.0
854
861
  [v3.2.0]: https://github.com/SAP/ui5-builder/compare/v3.1.1...v3.2.0
855
862
  [v3.1.1]: https://github.com/SAP/ui5-builder/compare/v3.1.0...v3.1.1
856
863
  [v3.1.0]: https://github.com/SAP/ui5-builder/compare/v3.0.9...v3.1.0
package/LICENSE.txt CHANGED
@@ -186,7 +186,7 @@
186
186
  same "printed page" as the copyright notice for easier
187
187
  identification within third-party archives.
188
188
 
189
- Copyright 2018-2023 SAP SE or an SAP affiliate company and UI5 Tooling contributors
189
+ Copyright 2018-2024 SAP SE or an SAP affiliate company and UI5 Tooling contributors
190
190
 
191
191
  Licensed under the Apache License, Version 2.0 (the "License");
192
192
  you may not use this file except in compliance with the License.
@@ -20,9 +20,11 @@ import {createResource} from "@ui5/fs/resourceFactory";
20
20
  * @param {string} parameters.options.pathPrefix Prefix for bundle path
21
21
  * @param {string} parameters.options.hasFlexBundleVersion true if minUI5Version >= 1.73 than
22
22
  * create flexibility-bundle.json
23
+ * @param {object} [parameters.existingFlexBundle={}] Object with existing flexibility-bundle.json
24
+ * to merge with new changes
23
25
  * @returns {Promise<@ui5/fs/Resource[]>} Promise resolving with flex changes bundle resources
24
26
  */
25
- export default function({resources, options: {pathPrefix, hasFlexBundleVersion}}) {
27
+ export default function({resources, options: {pathPrefix, hasFlexBundleVersion}, existingFlexBundle = {}}) {
26
28
  let bundleName = "changes-bundle.json";
27
29
 
28
30
  function sortByTimeStamp(a, b) {
@@ -86,7 +88,7 @@ export default function({resources, options: {pathPrefix, hasFlexBundleVersion}}
86
88
  return JSON.stringify(changes);
87
89
  } else {
88
90
  bundleName = "flexibility-bundle.json";
89
- const newChangeFormat = {
91
+ let newChangeFormat = {
90
92
  changes,
91
93
  compVariants,
92
94
  variants,
@@ -94,11 +96,33 @@ export default function({resources, options: {pathPrefix, hasFlexBundleVersion}}
94
96
  variantDependentControlChanges,
95
97
  variantManagementChanges
96
98
  };
97
-
99
+ if (Object.keys(existingFlexBundle).length > 0) {
100
+ newChangeFormat = mergeFlexChangeBundles(newChangeFormat);
101
+ }
98
102
  return JSON.stringify(newChangeFormat);
99
103
  }
100
104
  }
101
105
 
106
+ /**
107
+ * Merge new and existing bundles
108
+ *
109
+ * @param {object} newFlexBundle Object with new content of flexibility-bundle.json
110
+ * @returns {object} Object with merged content of new and existing flexibility-bundle.json
111
+ */
112
+ function mergeFlexChangeBundles(newFlexBundle) {
113
+ const result = {};
114
+
115
+ Object.keys(newFlexBundle).forEach((key) => {
116
+ if (existingFlexBundle[key] && Array.isArray(existingFlexBundle[key])) {
117
+ result[key] = existingFlexBundle[key].concat(newFlexBundle[key]);
118
+ } else {
119
+ result[key] = newFlexBundle[key];
120
+ }
121
+ });
122
+
123
+ return result;
124
+ }
125
+
102
126
  return Promise.all(resources.map((resource) => {
103
127
  return resource.getBuffer().then((buffer) => {
104
128
  return JSON.parse(buffer.toString());
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * Node script to create cross-library API index files for use in the UI5 SDKs.
3
3
  *
4
- * (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
4
+ * (c) Copyright 2009-2024 SAP SE or an SAP affiliate company.
5
5
  * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
6
6
  */
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * Node script to preprocess api.json files for use in the UI5 SDKs.
3
3
  *
4
- * (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
4
+ * (c) Copyright 2009-2024 SAP SE or an SAP affiliate company.
5
5
  * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
6
6
  */
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * JSDoc3 plugin for UI5 documentation generation.
3
3
  *
4
- * (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
4
+ * (c) Copyright 2009-2024 SAP SE or an SAP affiliate company.
5
5
  * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
6
6
  */
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * JSDoc3 template for UI5 documentation generation.
3
3
  *
4
- * (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
4
+ * (c) Copyright 2009-2024 SAP SE or an SAP affiliate company.
5
5
  * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
6
6
  */
7
7
 
@@ -83,15 +83,21 @@ export default async function({workspace, taskUtil, options = {}}) {
83
83
  if (allResources.length > 0) {
84
84
  const version = semver.coerce(await readManifestMinUI5Version());
85
85
  let hasFlexBundleVersion = false;
86
+ let flexBundle = {};
86
87
  if (semver.compare(version, "1.73.0") >= 0) {
87
88
  hasFlexBundleVersion = true;
89
+ const flexBundleResource = await workspace.byPath(`${pathPrefix}/changes/flexibility-bundle.json`);
90
+ if (flexBundleResource) {
91
+ flexBundle = JSON.parse(await flexBundleResource.getString());
92
+ }
88
93
  }
89
94
  const processedResources = await flexChangesBundler({
90
95
  resources: allResources,
91
96
  options: {
92
97
  pathPrefix,
93
98
  hasFlexBundleVersion
94
- }
99
+ },
100
+ existingFlexBundle: flexBundle
95
101
  });
96
102
  await Promise.all(processedResources.map((resource) => {
97
103
  log.verbose("Writing flexibility changes bundle");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ui5/builder",
3
- "version": "3.2.0",
3
+ "version": "3.3.0",
4
4
  "description": "UI5 Tooling - Builder",
5
5
  "author": {
6
6
  "name": "SAP SE",
@@ -131,26 +131,26 @@
131
131
  "pretty-data": "^0.40.0",
132
132
  "rimraf": "^5.0.5",
133
133
  "semver": "^7.5.4",
134
- "terser": "^5.26.0",
134
+ "terser": "^5.27.0",
135
135
  "workerpool": "^6.5.1",
136
136
  "xml2js": "^0.6.2"
137
137
  },
138
138
  "devDependencies": {
139
139
  "@istanbuljs/esm-loader-hook": "^0.2.0",
140
- "@jridgewell/trace-mapping": "^0.3.20",
141
- "@ui5/project": "^3.8.0",
140
+ "@jridgewell/trace-mapping": "^0.3.21",
141
+ "@ui5/project": "^3.9.0",
142
142
  "ava": "^5.3.1",
143
- "chai": "^4.3.10",
143
+ "chai": "^4.4.1",
144
144
  "chai-fs": "^2.0.0",
145
145
  "chokidar-cli": "^3.0.0",
146
146
  "cross-env": "^7.0.3",
147
147
  "depcheck": "^1.4.7",
148
148
  "docdash": "^2.0.2",
149
- "eslint": "^8.55.0",
149
+ "eslint": "^8.56.0",
150
150
  "eslint-config-google": "^0.14.0",
151
151
  "eslint-plugin-ava": "^14.0.0",
152
- "eslint-plugin-jsdoc": "^46.9.0",
153
- "esmock": "^2.6.0",
152
+ "eslint-plugin-jsdoc": "^46.10.1",
153
+ "esmock": "^2.6.2",
154
154
  "line-column": "^1.0.2",
155
155
  "nyc": "^15.1.0",
156
156
  "open-cli": "^7.2.0",