@ui5/builder 2.11.9 → 2.11.11

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/v2.11.9...HEAD).
5
+ A list of unreleased changes can be found [here](https://github.com/SAP/ui5-builder/compare/v2.11.11...HEAD).
6
+
7
+ <a name="v2.11.11"></a>
8
+ ## [v2.11.11] - 2024-01-18
9
+ ### Bug Fixes
10
+ - **flexChangesBundler:** Merge existing with new flexibility-bundle.json [`b9e372d`](https://github.com/SAP/ui5-builder/commit/b9e372dfec2abb83f7779112c93480f86a4a4fbb)
11
+
12
+
13
+ <a name="v2.11.10"></a>
14
+ ## [v2.11.10] - 2023-04-12
15
+ ### Dependency Updates
16
+ - Bump xml2js from 0.4.23 to 0.5.0 [`3058c45`](https://github.com/SAP/ui5-builder/commit/3058c459f9514a5ac3526f85c77f26aab311b03e)
17
+
6
18
 
7
19
  <a name="v2.11.9"></a>
8
20
  ## [v2.11.9] - 2022-11-30
@@ -679,6 +691,8 @@ to load the custom bundle file instead.
679
691
  - Add ability to configure component preloads and custom bundles [`2241e5f`](https://github.com/SAP/ui5-builder/commit/2241e5ff98fd95f1f80cc74959655ae7a9c660e7)
680
692
 
681
693
 
694
+ [v2.11.11]: https://github.com/SAP/ui5-builder/compare/v2.11.10...v2.11.11
695
+ [v2.11.10]: https://github.com/SAP/ui5-builder/compare/v2.11.9...v2.11.10
682
696
  [v2.11.9]: https://github.com/SAP/ui5-builder/compare/v2.11.8...v2.11.9
683
697
  [v2.11.8]: https://github.com/SAP/ui5-builder/compare/v2.11.7...v2.11.8
684
698
  [v2.11.7]: https://github.com/SAP/ui5-builder/compare/v2.11.6...v2.11.7
package/README.md CHANGED
@@ -9,6 +9,12 @@
9
9
  [![npm Package Version](https://badge.fury.io/js/%40ui5%2Fbuilder.svg)](https://www.npmjs.com/package/@ui5/builder)
10
10
  [![Coverage Status](https://coveralls.io/repos/github/SAP/ui5-builder/badge.svg)](https://coveralls.io/github/SAP/ui5-builder)
11
11
 
12
+ > [UI5 Tooling v3](https://sap.github.io/ui5-tooling/v3) is the latest and stable version 🎉
13
+ >
14
+ > [UI5 Tooling v2](https://sap.github.io/ui5-tooling/v2) has been deprecated 🚫
15
+ >
16
+ > Please migrate your projects to [UI5 Tooling v3](https://sap.github.io/ui5-tooling/v3/updates/migrate-v3/)!
17
+
12
18
  ## Documentation
13
19
  Can be found here: [sap.github.io/ui5-tooling](https://sap.github.io/ui5-tooling/pages/Builder/)
14
20
 
package/jsdoc.json CHANGED
@@ -29,7 +29,7 @@
29
29
  "openGraph": {
30
30
  "title": "UI5 Tooling - API Reference",
31
31
  "type": "website",
32
- "image": "https://sap.github.io/ui5-tooling/docs/images/UI5_logo_wide.png",
32
+ "image": "https://sap.github.io/ui5-tooling/v2/images/UI5_logo_wide.png",
33
33
  "site_name": "UI5 Tooling - API Reference",
34
34
  "url": "https://sap.github.io/ui5-tooling/"
35
35
  },
@@ -12,9 +12,11 @@ const resourceFactory = require("@ui5/fs").resourceFactory;
12
12
  * @param {string} parameters.options.pathPrefix Prefix for bundle path
13
13
  * @param {string} parameters.options.hasFlexBundleVersion true if minUI5Version >= 1.73 than
14
14
  * create flexibility-bundle.json
15
+ * @param {object} [parameters.existingFlexBundle={}] Object with existing flexibility-bundle.json
16
+ * to merge with new changes
15
17
  * @returns {Promise<module:@ui5/fs.Resource[]>} Promise resolving with flex changes bundle resources
16
18
  */
17
- module.exports = function({resources, options: {pathPrefix, hasFlexBundleVersion}}) {
19
+ module.exports = function({resources, options: {pathPrefix, hasFlexBundleVersion}, existingFlexBundle = {}}) {
18
20
  let bundleName = "changes-bundle.json";
19
21
 
20
22
  function sortByTimeStamp(a, b) {
@@ -78,7 +80,7 @@ module.exports = function({resources, options: {pathPrefix, hasFlexBundleVersion
78
80
  return JSON.stringify(changes);
79
81
  } else {
80
82
  bundleName = "flexibility-bundle.json";
81
- const newChangeFormat = {
83
+ let newChangeFormat = {
82
84
  changes,
83
85
  compVariants,
84
86
  variants,
@@ -86,11 +88,33 @@ module.exports = function({resources, options: {pathPrefix, hasFlexBundleVersion
86
88
  variantDependentControlChanges,
87
89
  variantManagementChanges
88
90
  };
89
-
91
+ if (Object.keys(existingFlexBundle).length > 0) {
92
+ newChangeFormat = mergeFlexChangeBundles(newChangeFormat);
93
+ }
90
94
  return JSON.stringify(newChangeFormat);
91
95
  }
92
96
  }
93
97
 
98
+ /**
99
+ * Merge new and existing bundles
100
+ *
101
+ * @param {object} newFlexBundle Object with new content of flexibility-bundle.json
102
+ * @returns {object} Object with merged content of new and existing flexibility-bundle.json
103
+ */
104
+ function mergeFlexChangeBundles(newFlexBundle) {
105
+ const result = {};
106
+
107
+ Object.keys(newFlexBundle).forEach((key) => {
108
+ if (existingFlexBundle[key] && Array.isArray(existingFlexBundle[key])) {
109
+ result[key] = existingFlexBundle[key].concat(newFlexBundle[key]);
110
+ } else {
111
+ result[key] = newFlexBundle[key];
112
+ }
113
+ });
114
+
115
+ return result;
116
+ }
117
+
94
118
  return Promise.all(resources.map((resource) => {
95
119
  return resource.getBuffer().then((buffer) => {
96
120
  return JSON.parse(buffer.toString());
@@ -71,15 +71,21 @@ module.exports = async function({workspace, taskUtil, options: {namespace}}) {
71
71
  if (allResources.length > 0) {
72
72
  const version = semver.coerce(await readManifestMinUI5Version());
73
73
  let hasFlexBundleVersion = false;
74
+ let flexBundle = {};
74
75
  if (semver.compare(version, "1.73.0") >= 0) {
75
76
  hasFlexBundleVersion = true;
77
+ const flexBundleResource = await workspace.byPath(`${pathPrefix}/changes/flexibility-bundle.json`);
78
+ if (flexBundleResource) {
79
+ flexBundle = JSON.parse(await flexBundleResource.getString());
80
+ }
76
81
  }
77
82
  const processedResources = await flexChangesBundler({
78
83
  resources: allResources,
79
84
  options: {
80
85
  pathPrefix,
81
86
  hasFlexBundleVersion
82
- }
87
+ },
88
+ existingFlexBundle: flexBundle
83
89
  });
84
90
  await Promise.all(processedResources.map((resource) => {
85
91
  log.verbose("Writing flexibility changes bundle");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ui5/builder",
3
- "version": "2.11.9",
3
+ "version": "2.11.11",
4
4
  "description": "UI5 Tooling - Builder",
5
5
  "author": {
6
6
  "name": "SAP SE",
@@ -38,7 +38,7 @@
38
38
  "jsdoc-watch": "npm run jsdoc && chokidar \"./lib/**/*.js\" -c \"npm run jsdoc-generate\"",
39
39
  "preversion": "npm test",
40
40
  "version": "git-chglog --next-tag v$npm_package_version -o CHANGELOG.md && git add CHANGELOG.md",
41
- "postversion": "git push --follow-tags",
41
+ "prepublishOnly": "git push --follow-tags",
42
42
  "release-note": "git-chglog -c .chglog/release-config.yml v$npm_package_version",
43
43
  "depcheck": "depcheck --ignores docdash --ignore-patterns lib/processors/jsdoc/lib/ui5"
44
44
  },
@@ -111,26 +111,26 @@
111
111
  "escope": "^4.0.0",
112
112
  "espree": "^6.2.1",
113
113
  "globby": "^11.1.0",
114
- "graceful-fs": "^4.2.10",
114
+ "graceful-fs": "^4.2.11",
115
115
  "jsdoc": "^3.6.11",
116
- "less-openui5": "^0.11.3",
116
+ "less-openui5": "^0.11.6",
117
117
  "make-dir": "^3.1.0",
118
118
  "pretty-data": "^0.40.0",
119
119
  "pretty-hrtime": "^1.0.3",
120
120
  "replacestream": "^4.0.3",
121
121
  "rimraf": "^3.0.2",
122
- "semver": "^7.3.8",
123
- "terser": "^5.15.1",
124
- "xml2js": "^0.4.23",
122
+ "semver": "^7.5.4",
123
+ "terser": "^5.27.0",
124
+ "xml2js": "^0.5.0",
125
125
  "yazl": "^2.5.1"
126
126
  },
127
127
  "devDependencies": {
128
128
  "ava": "^3.15.0",
129
- "chai": "^4.3.6",
129
+ "chai": "^4.4.1",
130
130
  "chai-fs": "^2.0.0",
131
131
  "chokidar-cli": "^3.0.0",
132
132
  "cross-env": "^7.0.3",
133
- "depcheck": "^1.4.3",
133
+ "depcheck": "^1.4.7",
134
134
  "docdash": "^1.2.0",
135
135
  "eslint": "^7.32.0",
136
136
  "eslint-config-google": "^0.14.0",