@ui5/builder 3.2.0 → 3.3.1

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,16 @@
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.1...HEAD).
6
+
7
+ <a name="v3.3.1"></a>
8
+ ## [v3.3.1] - 2024-03-27
9
+
10
+ <a name="v3.3.0"></a>
11
+ ## [v3.3.0] - 2024-01-18
12
+ ### Features
13
+ - **flexChangesBundler:** Merge existing with new flexibility-bundle.json [`fd070ab`](https://github.com/SAP/ui5-builder/commit/fd070abaa22680ee70b448fa0ac406a8f2b57cc5)
14
+
6
15
 
7
16
  <a name="v3.2.0"></a>
8
17
  ## [v3.2.0] - 2023-12-12
@@ -851,6 +860,8 @@ to load the custom bundle file instead.
851
860
 
852
861
  ### Features
853
862
  - Add ability to configure component preloads and custom bundles [`2241e5f`](https://github.com/SAP/ui5-builder/commit/2241e5ff98fd95f1f80cc74959655ae7a9c660e7)
863
+ [v3.3.1]: https://github.com/SAP/ui5-builder/compare/v3.3.0...v3.3.1
864
+ [v3.3.0]: https://github.com/SAP/ui5-builder/compare/v3.2.0...v3.3.0
854
865
  [v3.2.0]: https://github.com/SAP/ui5-builder/compare/v3.1.1...v3.2.0
855
866
  [v3.1.1]: https://github.com/SAP/ui5-builder/compare/v3.1.0...v3.1.1
856
867
  [v3.1.0]: https://github.com/SAP/ui5-builder/compare/v3.0.9...v3.1.0
package/CONTRIBUTING.md CHANGED
@@ -1,3 +1,3 @@
1
1
  # Contributing to the UI5 Tooling
2
2
 
3
- See CONTRIBUTING.md in the [SAP/ui5-tooling](https://github.com/SAP/ui5-tooling/blob/main/CONTRIBUTING.md) repository.
3
+ See CONTRIBUTING.md in the [SAP/ui5-tooling](https://github.com/SAP/ui5-tooling/blob/v3/CONTRIBUTING.md) repository.
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.
package/README.md CHANGED
@@ -1,11 +1,11 @@
1
- ![UI5 icon](https://raw.githubusercontent.com/SAP/ui5-tooling/main/docs/images/UI5_logo_wide.png)
1
+ ![UI5 icon](https://raw.githubusercontent.com/SAP/ui5-tooling/v3/docs/images/UI5_logo_wide.png)
2
2
 
3
3
  # ui5-builder
4
4
  > Modules for building UI5 projects
5
5
  > Part of the [UI5 Tooling](https://github.com/SAP/ui5-tooling)
6
6
 
7
7
  [![REUSE status](https://api.reuse.software/badge/github.com/SAP/ui5-builder)](https://api.reuse.software/info/github.com/SAP/ui5-builder)
8
- [![Build Status](https://dev.azure.com/sap/opensource/_apis/build/status/SAP.ui5-builder?branchName=main)](https://dev.azure.com/sap/opensource/_build/latest?definitionId=26&branchName=main)
8
+ [![Build Status](https://dev.azure.com/sap/opensource/_apis/build/status/SAP.ui5-builder?branchName=v3)](https://dev.azure.com/sap/opensource/_build/latest?definitionId=26&branchName=v3)
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
 
@@ -15,10 +15,10 @@ UI5 Builder documentation can be found here: [sap.github.io/ui5-tooling](https:/
15
15
  The UI5 Builder API Reference can be found here: [`@ui5/builder`](https://sap.github.io/ui5-tooling/v3/api/)
16
16
 
17
17
  ## Contributing
18
- Please check our [Contribution Guidelines](https://github.com/SAP/ui5-tooling/blob/main/CONTRIBUTING.md).
18
+ Please check our [Contribution Guidelines](https://github.com/SAP/ui5-tooling/blob/v3/CONTRIBUTING.md).
19
19
 
20
20
  ## Support
21
- Please follow our [Contribution Guidelines](https://github.com/SAP/ui5-tooling/blob/main/CONTRIBUTING.md#report-an-issue) on how to report an issue.
21
+ Please follow our [Contribution Guidelines](https://github.com/SAP/ui5-tooling/blob/v3/CONTRIBUTING.md#report-an-issue) on how to report an issue.
22
22
 
23
23
  Please report issues in the main [UI5 Tooling](https://github.com/SAP/ui5-tooling) repository.
24
24
 
@@ -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
 
@@ -122,6 +122,13 @@ function createIndexFiles(versionInfoFile, unpackedTestresourcesRoot, targetFile
122
122
  if (symbol.deprecated) {
123
123
  oReturn.deprecated = true;
124
124
  }
125
+
126
+ if (symbol.experimental && !symbol.deprecated) {
127
+ oReturn.experimental = true;
128
+ } else {
129
+ oReturn.experimental = false;
130
+ }
131
+
125
132
  collectLists(symbol);
126
133
  return oReturn;
127
134
  });
@@ -230,14 +237,20 @@ function createIndexFiles(versionInfoFile, unpackedTestresourcesRoot, targetFile
230
237
  let parent = symbol.extends && byName.get(symbol.extends);
231
238
  if (parent) {
232
239
  parent.extendedBy = parent.extendedBy ||  [];
233
- parent.extendedBy.push(symbol.name);
240
+ parent.extendedBy.push({
241
+ name: symbol.name,
242
+ visibility: symbol.visibility
243
+ });
234
244
  }
235
245
  if (symbol.implements) {
236
246
  symbol.implements.forEach(intfName => {
237
247
  let intf = byName.get(intfName);
238
248
  if (intf) {
239
249
  intf.implementedBy = intf.implementedBy ||  [];
240
- intf.implementedBy.push(symbol.name);
250
+ intf.implementedBy.push({
251
+ name: symbol.name,
252
+ visibility: symbol.visibility
253
+ });
241
254
  }
242
255
  });
243
256
  }
@@ -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
 
@@ -32,6 +32,10 @@ function replaceLastPathSegment(p, replacement) {
32
32
  return path.join(path.dirname(p), replacement);
33
33
  }
34
34
 
35
+ function normalizeToUI5GlobalNotation(sModuleName){
36
+ return sModuleName.replace(/\//g, ".");
37
+ }
38
+
35
39
  /*
36
40
  * Transforms the api.json as created by the JSDoc build into a pre-processed api.json file suitable for the SDK.
37
41
  *
@@ -146,7 +150,7 @@ function transformer(sInputFile, sOutputFile, sLibraryFile, vDependencyAPIFiles,
146
150
  symbols.forEach(oSymbol => {
147
151
  let sModuleClearName = oSymbol.name.replace(/^module:/, "");
148
152
  oSymbol.displayName = sModuleClearName;
149
- oSymbol.treeName = sModuleClearName.replace(/\//g, ".");
153
+ oSymbol.treeName = normalizeToUI5GlobalNotation(sModuleClearName);
150
154
  });
151
155
 
152
156
  // Create missing - virtual namespaces
@@ -229,7 +233,7 @@ function transformer(sInputFile, sOutputFile, sLibraryFile, vDependencyAPIFiles,
229
233
  oData.symbols.forEach((oSymbol) => {
230
234
 
231
235
  // when the module name starts with the library name, then we apply the default component
232
- if (oSymbol.name.indexOf(oData.library) === 0) {
236
+ if (normalizeToUI5GlobalNotation(oSymbol.displayName).startsWith(oData.library)) {
233
237
  oSymbol.component = oChainObject.defaultComponent;
234
238
  }
235
239
 
@@ -237,7 +241,7 @@ function transformer(sInputFile, sOutputFile, sLibraryFile, vDependencyAPIFiles,
237
241
  // Note: Last hit wins as there may be a more specific component pattern
238
242
  if (oChainObject.customSymbolComponents) {
239
243
  Object.keys(oChainObject.customSymbolComponents).forEach(sComponent => {
240
- if (matchComponent(oSymbol.name, sComponent)) {
244
+ if (matchComponent(normalizeToUI5GlobalNotation(oSymbol.displayName), sComponent)) {
241
245
  oSymbol.component = oChainObject.customSymbolComponents[sComponent];
242
246
  }
243
247
  });
@@ -371,6 +375,21 @@ function transformer(sInputFile, sOutputFile, sLibraryFile, vDependencyAPIFiles,
371
375
  oProperty.description = formatters.formatDescription(oProperty.description);
372
376
  }
373
377
 
378
+ // Examples
379
+ if (oProperty.examples) {
380
+ oProperty.examples.forEach((oExample) => {
381
+ oExample.data = formatters.formatExample(oExample.caption, oExample.text);
382
+
383
+ // Keep file size in check
384
+ if (oExample.caption) {
385
+ delete oExample.caption;
386
+ }
387
+ if (oExample.text) {
388
+ delete oExample.text;
389
+ }
390
+ });
391
+ }
392
+
374
393
  // Type
375
394
  if (oSymbol.kind !== "enum") { // enum properties don't have an own type
376
395
  if (oProperty.type) {
@@ -2016,7 +2035,12 @@ function transformer(sInputFile, sOutputFile, sLibraryFile, vDependencyAPIFiles,
2016
2035
  formatReferencesInDescription: function(oEntity) {
2017
2036
  if (oEntity.references && Array.isArray(oEntity.references)) {
2018
2037
  oEntity.references = oEntity.references.map(sReference => {
2019
- return `<li>${sReference}</li>`;
2038
+ if (/{@link.*}/.test(sReference)) {
2039
+ return "<li>" + sReference + "</li>";
2040
+ } else {
2041
+ return "<li>{@link " + sReference + "}</li>";
2042
+
2043
+ };
2020
2044
  });
2021
2045
  if (!oEntity.description) {
2022
2046
  // If there is no method description - references should be the first line of it
@@ -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
 
@@ -2466,6 +2466,10 @@ function postProcessAPIJSON(api) {
2466
2466
  }
2467
2467
 
2468
2468
  symbols.forEach((symbol) => {
2469
+ // add note for enums which are not exposed by their name
2470
+ if (symbol.kind === "enum" && symbol.export) {
2471
+ symbol.description += `\n\nThis enum is part of the '${symbol.module}' module export and must be accessed by the property '${symbol.export}'.`;
2472
+ }
2469
2473
  if ( !symbol["ui5-metadata"] ) {
2470
2474
  return;
2471
2475
  }
@@ -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.1",
4
4
  "description": "UI5 Tooling - Builder",
5
5
  "author": {
6
6
  "name": "SAP SE",
@@ -130,27 +130,27 @@
130
130
  "less-openui5": "^0.11.6",
131
131
  "pretty-data": "^0.40.0",
132
132
  "rimraf": "^5.0.5",
133
- "semver": "^7.5.4",
134
- "terser": "^5.26.0",
133
+ "semver": "^7.6.0",
134
+ "terser": "^5.29.2",
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.25",
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.57.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.4",
154
154
  "line-column": "^1.0.2",
155
155
  "nyc": "^15.1.0",
156
156
  "open-cli": "^7.2.0",