@ui5/builder 3.4.0 → 3.5.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/v3.4.0...HEAD).
5
+ A list of unreleased changes can be found [here](https://github.com/SAP/ui5-builder/compare/v3.5.0...HEAD).
6
+
7
+ <a name="v3.5.0"></a>
8
+ ## [v3.5.0] - 2024-06-21
9
+ ### Features
10
+ - ES2023 Support [`097049d`](https://github.com/SAP/ui5-builder/commit/097049daeec5c54c2d5e858b12e0c54c826ff663)
11
+
12
+
13
+ <a name="v3.4.1"></a>
14
+ ## [v3.4.1] - 2024-05-13
15
+ ### Bug Fixes
16
+ - **bundle/Builder:** Correct bundling of resources with empty source map [`1228db7`](https://github.com/SAP/ui5-builder/commit/1228db78e7e655cea58c20517662b08dd09db87b)
17
+
6
18
 
7
19
  <a name="v3.4.0"></a>
8
20
  ## [v3.4.0] - 2024-04-24
@@ -866,6 +878,8 @@ to load the custom bundle file instead.
866
878
 
867
879
  ### Features
868
880
  - Add ability to configure component preloads and custom bundles [`2241e5f`](https://github.com/SAP/ui5-builder/commit/2241e5ff98fd95f1f80cc74959655ae7a9c660e7)
881
+ [v3.5.0]: https://github.com/SAP/ui5-builder/compare/v3.4.1...v3.5.0
882
+ [v3.4.1]: https://github.com/SAP/ui5-builder/compare/v3.4.0...v3.4.1
869
883
  [v3.4.0]: https://github.com/SAP/ui5-builder/compare/v3.3.1...v3.4.0
870
884
  [v3.3.1]: https://github.com/SAP/ui5-builder/compare/v3.3.0...v3.3.1
871
885
  [v3.3.0]: https://github.com/SAP/ui5-builder/compare/v3.2.0...v3.3.0
@@ -36,6 +36,10 @@ function makeStringLiteral(str) {
36
36
  }) + "'";
37
37
  }
38
38
 
39
+ function removeHashbang(str) {
40
+ return str.replace(/^#!(.*)/, "");
41
+ }
42
+
39
43
  function isEmptyBundle(resolvedBundle) {
40
44
  return resolvedBundle.sections.every((section) => section.modules.length === 0);
41
45
  }
@@ -278,6 +282,7 @@ class BundleBuilder {
278
282
  async writeRawModule(moduleName, resource) {
279
283
  this.outW.ensureNewLine();
280
284
  let moduleContent = (await resource.buffer()).toString();
285
+ moduleContent = removeHashbang(moduleContent);
281
286
  if (this.options.sourceMap) {
282
287
  let moduleSourceMap;
283
288
  ({moduleContent, moduleSourceMap} =
@@ -353,7 +358,13 @@ class BundleBuilder {
353
358
  // If first column of the first line is not already mapped, add a mapping for the same reason as above.
354
359
  // This is typical for transpiled code, where there is a bunch of generated code at the beginning that
355
360
  // can't be mapped to the original source
356
- map.mappings = "AAAA," + map.mappings;
361
+ if (map.mappings) {
362
+ map.mappings = "AAAA," + map.mappings;
363
+ } else {
364
+ // If there are no existing mappings (e.g. if the file is empty or only comments),
365
+ // make sure to still define a single mapping
366
+ map.mappings = "AAAA";
367
+ }
357
368
  }
358
369
 
359
370
  map.sourceRoot = path.posix.relative(
@@ -378,6 +389,7 @@ class BundleBuilder {
378
389
  // console.log("Processing " + moduleName);
379
390
  const resource = await this.pool.findResourceWithInfo(moduleName);
380
391
  let moduleContent = (await resource.buffer()).toString();
392
+ moduleContent = removeHashbang(moduleContent);
381
393
  let moduleSourceMap;
382
394
  if (this.options.sourceMap) {
383
395
  ({moduleContent, moduleSourceMap} =
@@ -438,6 +450,7 @@ class BundleBuilder {
438
450
  // The module should be written to a new line in order for dev-tools to map breakpoints to it
439
451
  outW.ensureNewLine();
440
452
  let moduleContent = (await resource.buffer()).toString();
453
+ moduleContent = removeHashbang(moduleContent);
441
454
  if (this.options.sourceMap) {
442
455
  let moduleSourceMap;
443
456
  ({moduleContent, moduleSourceMap} =
@@ -457,6 +470,7 @@ class BundleBuilder {
457
470
  log.warn(
458
471
  `Module ${moduleName} requires top level scope and can only be embedded as a string (requires 'eval')`);
459
472
  let moduleContent = (await resource.buffer()).toString();
473
+ moduleContent = removeHashbang(moduleContent);
460
474
  if (this.options.sourceMap) {
461
475
  // We are actually not interested in the source map this module might contain,
462
476
  // but we should make sure to remove any "sourceMappingURL" from the module content before
@@ -9,7 +9,7 @@ const hasOwn = Function.prototype.call.bind(Object.prototype.hasOwnProperty);
9
9
  * - Adjust the JSModuleAnalyzer test "Check for consistency between VisitorKeys and EnrichedVisitorKeys"
10
10
  * (See comments in test for details)
11
11
  */
12
- export const ecmaVersion = 2022;
12
+ export const ecmaVersion = 2023;
13
13
 
14
14
  export function parseJS(code, userOptions = {}) {
15
15
  // allowed options and their defaults
@@ -36,6 +36,12 @@ function normalizeToUI5GlobalNotation(sModuleName){
36
36
  return sModuleName.replace(/\//g, ".");
37
37
  }
38
38
 
39
+ function fnCreateTypesArr(sTypes) {
40
+ return sTypes.split("|").map(function (sType) {
41
+ return { value: sType }
42
+ });
43
+ }
44
+
39
45
  /*
40
46
  * Transforms the api.json as created by the JSDoc build into a pre-processed api.json file suitable for the SDK.
41
47
  *
@@ -439,6 +445,11 @@ function transformer(sInputFile, sOutputFile, sLibraryFile, vDependencyAPIFiles,
439
445
  // Name
440
446
  oProperty.name = formatters.formatEntityName(oProperty.name, oSymbol.name, oProperty.static);
441
447
 
448
+ // Type
449
+ if (oProperty.type) {
450
+ oProperty.types = fnCreateTypesArr(oProperty.type);
451
+ }
452
+
442
453
  // Description
443
454
  oProperty.description = formatters.formatDescriptionSince(oProperty.description, oProperty.since);
444
455
 
@@ -2061,11 +2072,6 @@ function transformer(sInputFile, sOutputFile, sLibraryFile, vDependencyAPIFiles,
2061
2072
  * @param aMethods - the methods array initially coming from the server
2062
2073
  */
2063
2074
  buildMethodsModel: function (aMethods) {
2064
- var fnCreateTypesArr = function (sTypes) {
2065
- return sTypes.split("|").map(function (sType) {
2066
- return {value: sType}
2067
- });
2068
- };
2069
2075
  var fnExtractParameterProperties = function (oParameter, aParameters, iDepth, aPhoneName) {
2070
2076
  if (oParameter.parameterProperties) {
2071
2077
  Object.keys(oParameter.parameterProperties).forEach(function (sProperty) {
@@ -1138,6 +1138,38 @@ function convertDragDropValue(node, cardinality) {
1138
1138
  return Object.assign(mDefaults, mDragDropValue);
1139
1139
  }
1140
1140
 
1141
+ function collectVisibilityInfo(settings, doclet, className, n) {
1142
+ const validVisibilities = new Set(['public', 'hidden']);
1143
+ const validAccesses = new Set(['public', 'protected', 'restricted', 'private']);
1144
+
1145
+ let visibility = (settings.visibility && settings.visibility.value.value) || "public";
1146
+
1147
+ if (!validVisibilities.has(visibility)) {
1148
+ future(`${className}: Invalid visibility '${visibility}' in runtime metadata defined for managed setting '${n}. Valid options are ${Array.from(validVisibilities).join(', ')}.`);
1149
+ }
1150
+
1151
+ if (doclet?.access) {
1152
+ const access = doclet.access;
1153
+
1154
+ if (!validAccesses.has(access)) {
1155
+ future(`${className}: Invalid JSDoc visibility '${access}' defined for managed setting '${n}'. Valid options are ${Array.from(validAccesses).join(', ')}.`);
1156
+ }
1157
+
1158
+ if (visibility === 'hidden' && (access === 'public' || access === 'protected' || access === 'restricted')) {
1159
+ future(`${className}: Inconsistent visibility settings detected. Runtime metadata sets visibility to '${visibility}', while JSDoc defines it as '${access}' for the managed setting '${n}'.`);
1160
+ }
1161
+ if (visibility === 'public' && access === 'private') {
1162
+ future(`${className}: Inconsistent visibility settings detected. Runtime metadata sets visibility to '${visibility}', while JSDoc defines it as '${access}' for the managed setting '${n}'.`);
1163
+ }
1164
+
1165
+ if (visibility == "public" && (access === "restricted" || access === "protected")) {
1166
+ visibility = access;
1167
+ }
1168
+ }
1169
+
1170
+ return visibility;
1171
+ }
1172
+
1141
1173
  function collectClassInfo(extendCall, classDoclet) {
1142
1174
 
1143
1175
  let baseType;
@@ -1238,7 +1270,8 @@ function collectClassInfo(extendCall, classDoclet) {
1238
1270
  since : doclet && doclet.since,
1239
1271
  deprecation : doclet && doclet.deprecated,
1240
1272
  experimental : doclet && doclet.experimental,
1241
- visibility : (settings.visibility && settings.visibility.value.value) || "public",
1273
+ visibility: collectVisibilityInfo(settings, doclet, oClassInfo.name, n),
1274
+ stakeholders: doclet && doclet.__ui5 && doclet.__ui5.stakeholders,
1242
1275
  type : settings.type ? settings.type.value.value : "any"
1243
1276
  };
1244
1277
  });
@@ -1246,32 +1279,38 @@ function collectClassInfo(extendCall, classDoclet) {
1246
1279
  oClassInfo.defaultProperty = (metadata.defaultProperty && metadata.defaultProperty.value.value) || undefined;
1247
1280
 
1248
1281
  each(metadata.properties, "type", (n, settings, doclet) => {
1249
- let type;
1250
1282
  const N = upper(n);
1251
1283
  let methods;
1284
+ const dataType = settings.type ? settings.type.value.value : "string";
1252
1285
  oClassInfo.properties[n] = {
1253
- name : n,
1254
- doc : doclet && doclet.description,
1255
- since : doclet && doclet.since,
1256
- deprecation : doclet && doclet.deprecated,
1257
- experimental : doclet && doclet.experimental,
1258
- visibility : (settings.visibility && settings.visibility.value.value) || "public",
1259
- type : (type = settings.type ? settings.type.value.value : "string"),
1260
- defaultValue : settings.defaultValue ? convertValueWithRaw(settings.defaultValue.value, type, n) : null,
1261
- group : settings.group ? settings.group.value.value : 'Misc',
1262
- bindable : settings.bindable ? !!convertValue(settings.bindable.value) : false,
1286
+ name: n,
1287
+ doc: doclet && doclet.description,
1288
+ since: doclet && doclet.since,
1289
+ deprecation: doclet && doclet.deprecated,
1290
+ experimental: doclet && doclet.experimental,
1291
+ visibility: collectVisibilityInfo(settings, doclet, oClassInfo.name, n),
1292
+ stakeholders: doclet && doclet.__ui5 && doclet.__ui5.stakeholders,
1293
+ type: dataType,
1294
+ defaultValue: settings.defaultValue ? convertValueWithRaw(settings.defaultValue.value, dataType, n) : null,
1295
+ group: settings.group ? settings.group.value.value : 'Misc',
1296
+ bindable: settings.bindable ? !!convertValue(settings.bindable.value) : false,
1263
1297
  methods: (methods = {
1264
1298
  "get": "get" + N,
1265
1299
  "set": "set" + N
1266
1300
  })
1267
1301
  };
1268
- if ( oClassInfo.properties[n].bindable ) {
1302
+ if (oClassInfo.properties[n].bindable) {
1269
1303
  methods["bind"] = "bind" + N;
1270
1304
  methods["unbind"] = "unbind" + N;
1271
1305
  }
1272
- // if ( !settings.defaultValue ) {
1273
- // console.log("property without defaultValue: " + oClassInfo.name + "." + n);
1274
- //}
1306
+ // Check for @type definition
1307
+ if (doclet?.type?.names) {
1308
+ oClassInfo.properties[n].type = doclet?.type?.names.join('|');
1309
+
1310
+ if (oClassInfo.properties[n].type !== dataType) {
1311
+ oClassInfo.properties[n].dataType = dataType;
1312
+ }
1313
+ }
1275
1314
  });
1276
1315
 
1277
1316
  oClassInfo.defaultAggregation = (metadata.defaultAggregation && metadata.defaultAggregation.value.value) || undefined;
@@ -1279,13 +1318,15 @@ function collectClassInfo(extendCall, classDoclet) {
1279
1318
  each(metadata.aggregations, "type", (n, settings, doclet) => {
1280
1319
  const N = upper(n);
1281
1320
  let methods;
1321
+
1282
1322
  const aggr = oClassInfo.aggregations[n] = {
1283
1323
  name: n,
1284
1324
  doc : doclet && doclet.description,
1285
1325
  deprecation : doclet && doclet.deprecated,
1286
1326
  since : doclet && doclet.since,
1287
1327
  experimental : doclet && doclet.experimental,
1288
- visibility : (settings.visibility && settings.visibility.value.value) || "public",
1328
+ visibility: collectVisibilityInfo(settings, doclet, oClassInfo.name, n),
1329
+ stakeholders: doclet && doclet.__ui5 && doclet.__ui5.stakeholders,
1289
1330
  type : settings.type ? settings.type.value.value : "sap.ui.core.Control",
1290
1331
  altTypes: settings.altTypes ? convertStringArray(settings.altTypes.value) : undefined,
1291
1332
  singularName : settings.singularName ? settings.singularName.value.value : guessSingularName(n),
@@ -1318,13 +1359,15 @@ function collectClassInfo(extendCall, classDoclet) {
1318
1359
  each(metadata.associations, "type", (n, settings, doclet) => {
1319
1360
  const N = upper(n);
1320
1361
  let methods;
1362
+
1321
1363
  oClassInfo.associations[n] = {
1322
1364
  name: n,
1323
1365
  doc : doclet && doclet.description,
1324
1366
  deprecation : doclet && doclet.deprecated,
1325
1367
  since : doclet && doclet.since,
1326
1368
  experimental : doclet && doclet.experimental,
1327
- visibility : (settings.visibility && settings.visibility.value.value) || "public",
1369
+ visibility: collectVisibilityInfo(settings, doclet, oClassInfo.name, n),
1370
+ stakeholders: doclet && doclet.__ui5 && doclet.__ui5.stakeholders,
1328
1371
  type : settings.type ? settings.type.value.value : "sap.ui.core.Control",
1329
1372
  singularName : settings.singularName ? settings.singularName.value.value : guessSingularName(n),
1330
1373
  cardinality : (settings.multiple && settings.multiple.value.value) ? "0..n" : "0..1",
@@ -1344,13 +1387,15 @@ function collectClassInfo(extendCall, classDoclet) {
1344
1387
 
1345
1388
  each(metadata.events, null, (n, settings, doclet) => {
1346
1389
  const N = upper(n);
1390
+
1347
1391
  const info = oClassInfo.events[n] = {
1348
1392
  name: n,
1349
1393
  doc : doclet && doclet.description,
1350
1394
  deprecation : doclet && doclet.deprecated,
1351
1395
  since : doclet && doclet.since,
1352
1396
  experimental : doclet && doclet.experimental,
1353
- visibility : /* (settings.visibility && settings.visibility.value.value) || */ "public",
1397
+ visibility: collectVisibilityInfo(settings, doclet, oClassInfo.name, n),
1398
+ stakeholders: doclet && doclet.__ui5 && doclet.__ui5.stakeholders,
1354
1399
  allowPreventDefault : !!(settings.allowPreventDefault && settings.allowPreventDefault.value.value),
1355
1400
  enableEventBubbling : !!(settings.enableEventBubbling && settings.enableEventBubbling.value.value),
1356
1401
  parameters : {},
@@ -1710,17 +1755,24 @@ function createAutoDoc(oClassInfo, classComment, doclet, node, parser, filename,
1710
1755
  // return s.slice(s.lastIndexOf('.') + 1);
1711
1756
  // }
1712
1757
 
1713
- function createVisibilityTags(doclet) {
1714
- const access = (doclet && doclet.access) || "public";
1758
+ function createVisibilityTags(access, stakeholders) {
1715
1759
  if ( access === "restricted" ) {
1716
1760
  return [
1717
1761
  "@private",
1718
- "@ui5-restricted" + (doclet.__ui5 && Array.isArray(doclet.__ui5.stakeholders) ? " " + doclet.__ui5.stakeholders.join(", ") : "")
1762
+ "@ui5-restricted" + (Array.isArray(stakeholders) ? " " + stakeholders.join(", ") : "")
1719
1763
  ];
1720
1764
  }
1721
1765
  return "@" + access;
1722
1766
  }
1723
1767
 
1768
+ function createVisibilityTagsForSetting(settingInfo, classAccess) {
1769
+ let access = settingInfo.visibility ?? "public";
1770
+ if ( classAccess === "restricted" && (access === "public" || access === "protected")) {
1771
+ access = "restricted";
1772
+ }
1773
+ return createVisibilityTags(access, settingInfo.stakeholders);
1774
+ }
1775
+
1724
1776
  const HUNGARIAN_PREFIXES = {
1725
1777
  'int' : 'i',
1726
1778
  'boolean' : 'b',
@@ -1761,7 +1813,8 @@ function createAutoDoc(oClassInfo, classComment, doclet, node, parser, filename,
1761
1813
  const m = /(?:^|\r\n|\n|\r)[ \t]*\**[ \t]*@[a-zA-Z]/.exec(rawClassComment);
1762
1814
  const p = m ? m.index : -1;
1763
1815
  const hasSettingsDocs = rawClassComment.indexOf("The supported settings are:") >= 0;
1764
- const visibility = createVisibilityTags(doclet);
1816
+ const classAccess = doclet?.access ?? "public";
1817
+ const visibility = createVisibilityTags(classAccess, doclet?.__ui5?.stakeholders);
1765
1818
  const thisClass = 'this'; // oClassInfo.name
1766
1819
 
1767
1820
  // heuristic to recognize a ManagedObject
@@ -1916,6 +1969,8 @@ function createAutoDoc(oClassInfo, classComment, doclet, node, parser, filename,
1916
1969
  if ( info.visibility === 'hidden' ) {
1917
1970
  continue;
1918
1971
  }
1972
+ const visibilityTags = createVisibilityTagsForSetting(info, classAccess);
1973
+
1919
1974
  // link = newStyle ? "{@link #setting:" + n + " " + n + "}" : "<code>" + n + "</code>";
1920
1975
  link = "{@link " + (newStyle ? "#setting:" + n : rname("get", n)) + " " + n + "}";
1921
1976
  newJSDoc([
@@ -1930,7 +1985,7 @@ function createAutoDoc(oClassInfo, classComment, doclet, node, parser, filename,
1930
1985
  info.since ? "@since " + info.since : "",
1931
1986
  info.deprecation ? "@deprecated " + info.deprecation : "",
1932
1987
  info.experimental ? "@experimental " + info.experimental : "",
1933
- visibility,
1988
+ visibilityTags,
1934
1989
  "@name " + name("get", n),
1935
1990
  "@function"
1936
1991
  ]);
@@ -1949,7 +2004,7 @@ function createAutoDoc(oClassInfo, classComment, doclet, node, parser, filename,
1949
2004
  info.since ? "@since " + info.since : "",
1950
2005
  info.deprecation ? "@deprecated " + info.deprecation : "",
1951
2006
  info.experimental ? "@experimental " + info.experimental : "",
1952
- visibility,
2007
+ visibilityTags,
1953
2008
  "@name " + name("set", n),
1954
2009
  "@function"
1955
2010
  ]);
@@ -1964,7 +2019,7 @@ function createAutoDoc(oClassInfo, classComment, doclet, node, parser, filename,
1964
2019
  info.since ? "@since " + info.since : "",
1965
2020
  info.deprecation ? "@deprecated " + info.deprecation : "",
1966
2021
  info.experimental ? "@experimental " + info.experimental : "",
1967
- visibility,
2022
+ visibilityTags,
1968
2023
  "@name " + name("bind", n),
1969
2024
  "@function"
1970
2025
  ]);
@@ -1974,7 +2029,7 @@ function createAutoDoc(oClassInfo, classComment, doclet, node, parser, filename,
1974
2029
  info.since ? "@since " + info.since : "",
1975
2030
  info.deprecation ? "@deprecated " + info.deprecation : "",
1976
2031
  info.experimental ? "@experimental " + info.experimental : "",
1977
- visibility,
2032
+ visibilityTags,
1978
2033
  "@name " + name("unbind", n),
1979
2034
  "@function"
1980
2035
  ]);
@@ -1986,6 +2041,8 @@ function createAutoDoc(oClassInfo, classComment, doclet, node, parser, filename,
1986
2041
  if ( info.visibility === 'hidden' ) {
1987
2042
  continue;
1988
2043
  }
2044
+ const visibilityTags = createVisibilityTagsForSetting(info, classAccess);
2045
+
1989
2046
  // link = newStyle ? "{@link #setting:" + n + " " + n + "}" : "<code>" + n + "</code>";
1990
2047
  link = "{@link " + (newStyle ? "#setting:" + n : rname("get", n)) + " " + n + "}";
1991
2048
  newJSDoc([
@@ -1998,7 +2055,7 @@ function createAutoDoc(oClassInfo, classComment, doclet, node, parser, filename,
1998
2055
  info.since ? "@since " + info.since : "",
1999
2056
  info.deprecation ? "@deprecated " + info.deprecation : "",
2000
2057
  info.experimental ? "@experimental " + info.experimental : "",
2001
- visibility,
2058
+ visibilityTags,
2002
2059
  "@name " + name("get", n),
2003
2060
  "@function"
2004
2061
  ]);
@@ -2018,7 +2075,7 @@ function createAutoDoc(oClassInfo, classComment, doclet, node, parser, filename,
2018
2075
  info.since ? "@since " + info.since : "",
2019
2076
  info.deprecation ? "@deprecated " + info.deprecation : "",
2020
2077
  info.experimental ? "@experimental " + info.experimental : "",
2021
- visibility,
2078
+ visibilityTags,
2022
2079
  "@name " + name("insert", n1),
2023
2080
  "@function"
2024
2081
  ]);
@@ -2031,7 +2088,7 @@ function createAutoDoc(oClassInfo, classComment, doclet, node, parser, filename,
2031
2088
  info.since ? "@since " + info.since : "",
2032
2089
  info.deprecation ? "@deprecated " + info.deprecation : "",
2033
2090
  info.experimental ? "@experimental " + info.experimental : "",
2034
- visibility,
2091
+ visibilityTags,
2035
2092
  "@name " + name("add", n1),
2036
2093
  "@function"
2037
2094
  ]);
@@ -2043,7 +2100,7 @@ function createAutoDoc(oClassInfo, classComment, doclet, node, parser, filename,
2043
2100
  info.since ? "@since " + info.since : "",
2044
2101
  info.deprecation ? "@deprecated " + info.deprecation : "",
2045
2102
  info.experimental ? "@experimental " + info.experimental : "",
2046
- visibility,
2103
+ visibilityTags,
2047
2104
  "@name " + name("remove", n1),
2048
2105
  "@function"
2049
2106
  ]);
@@ -2055,7 +2112,7 @@ function createAutoDoc(oClassInfo, classComment, doclet, node, parser, filename,
2055
2112
  info.since ? "@since " + info.since : "",
2056
2113
  info.deprecation ? "@deprecated " + info.deprecation : "",
2057
2114
  info.experimental ? "@experimental " + info.experimental : "",
2058
- visibility,
2115
+ visibilityTags,
2059
2116
  "@name " + name("removeAll", n),
2060
2117
  "@function"
2061
2118
  ]);
@@ -2068,7 +2125,7 @@ function createAutoDoc(oClassInfo, classComment, doclet, node, parser, filename,
2068
2125
  info.since ? "@since " + info.since : "",
2069
2126
  info.deprecation ? "@deprecated " + info.deprecation : "",
2070
2127
  info.experimental ? "@experimental " + info.experimental : "",
2071
- visibility,
2128
+ visibilityTags,
2072
2129
  "@name " + name("indexOf", n1),
2073
2130
  "@function"
2074
2131
  ]);
@@ -2080,7 +2137,7 @@ function createAutoDoc(oClassInfo, classComment, doclet, node, parser, filename,
2080
2137
  info.since ? "@since " + info.since : "",
2081
2138
  info.deprecation ? "@deprecated " + info.deprecation : "",
2082
2139
  info.experimental ? "@experimental " + info.experimental : "",
2083
- visibility,
2140
+ visibilityTags,
2084
2141
  "@name " + name("set", n),
2085
2142
  "@function"
2086
2143
  ]);
@@ -2091,7 +2148,7 @@ function createAutoDoc(oClassInfo, classComment, doclet, node, parser, filename,
2091
2148
  info.since ? "@since " + info.since : "",
2092
2149
  info.deprecation ? "@deprecated " + info.deprecation : "",
2093
2150
  info.experimental ? "@experimental " + info.experimental : "",
2094
- visibility,
2151
+ visibilityTags,
2095
2152
  "@name " + name("destroy", n),
2096
2153
  "@function"
2097
2154
  ]);
@@ -2106,7 +2163,7 @@ function createAutoDoc(oClassInfo, classComment, doclet, node, parser, filename,
2106
2163
  info.since ? "@since " + info.since : "",
2107
2164
  info.deprecation ? "@deprecated " + info.deprecation : "",
2108
2165
  info.experimental ? "@experimental " + info.experimental : "",
2109
- visibility,
2166
+ visibilityTags,
2110
2167
  "@name " + name("bind", n),
2111
2168
  "@function"
2112
2169
  ]);
@@ -2116,7 +2173,7 @@ function createAutoDoc(oClassInfo, classComment, doclet, node, parser, filename,
2116
2173
  info.since ? "@since " + info.since : "",
2117
2174
  info.deprecation ? "@deprecated " + info.deprecation : "",
2118
2175
  info.experimental ? "@experimental " + info.experimental : "",
2119
- visibility,
2176
+ visibilityTags,
2120
2177
  "@name " + name("unbind", n),
2121
2178
  "@function"
2122
2179
  ]);
@@ -2128,6 +2185,8 @@ function createAutoDoc(oClassInfo, classComment, doclet, node, parser, filename,
2128
2185
  if ( info.visibility === 'hidden' ) {
2129
2186
  continue;
2130
2187
  }
2188
+ const visibilityTags = createVisibilityTagsForSetting(info, classAccess);
2189
+
2131
2190
  // link = newStyle ? "{@link #setting:" + n + " " + n + "}" : "<code>" + n + "</code>";
2132
2191
  link = "{@link " + (newStyle ? "#setting:" + n : rname("get", n)) + " " + n + "}";
2133
2192
  newJSDoc([
@@ -2141,7 +2200,7 @@ function createAutoDoc(oClassInfo, classComment, doclet, node, parser, filename,
2141
2200
  info.since ? "@since " + info.since : "",
2142
2201
  info.deprecation ? "@deprecated " + info.deprecation : "",
2143
2202
  info.experimental ? "@experimental " + info.experimental : "",
2144
- visibility,
2203
+ visibilityTags,
2145
2204
  "@name " + name("get", n),
2146
2205
  "@function"
2147
2206
  ]);
@@ -2155,7 +2214,7 @@ function createAutoDoc(oClassInfo, classComment, doclet, node, parser, filename,
2155
2214
  info.since ? "@since " + info.since : "",
2156
2215
  info.deprecation ? "@deprecated " + info.deprecation : "",
2157
2216
  info.experimental ? "@experimental " + info.experimental : "",
2158
- visibility,
2217
+ visibilityTags,
2159
2218
  "@name " + name("add", n1),
2160
2219
  "@function"
2161
2220
  ]);
@@ -2166,7 +2225,7 @@ function createAutoDoc(oClassInfo, classComment, doclet, node, parser, filename,
2166
2225
  info.since ? "@since " + info.since : "",
2167
2226
  info.deprecation ? "@deprecated " + info.deprecation : "",
2168
2227
  info.experimental ? "@experimental " + info.experimental : "",
2169
- visibility,
2228
+ visibilityTags,
2170
2229
  "@name " + name("remove", n1),
2171
2230
  "@function"
2172
2231
  ]);
@@ -2176,7 +2235,7 @@ function createAutoDoc(oClassInfo, classComment, doclet, node, parser, filename,
2176
2235
  info.since ? "@since " + info.since : "",
2177
2236
  info.deprecation ? "@deprecated " + info.deprecation : "",
2178
2237
  info.experimental ? "@experimental " + info.experimental : "",
2179
- visibility,
2238
+ visibilityTags,
2180
2239
  "@name " + name("removeAll", n),
2181
2240
  "@function"
2182
2241
  ]);
@@ -2188,7 +2247,7 @@ function createAutoDoc(oClassInfo, classComment, doclet, node, parser, filename,
2188
2247
  info.since ? "@since " + info.since : "",
2189
2248
  info.deprecation ? "@deprecated " + info.deprecation : "",
2190
2249
  info.experimental ? "@experimental " + info.experimental : "",
2191
- visibility,
2250
+ visibilityTags,
2192
2251
  "@name " + name("set", n),
2193
2252
  "@function"
2194
2253
  ]);
@@ -2197,6 +2256,8 @@ function createAutoDoc(oClassInfo, classComment, doclet, node, parser, filename,
2197
2256
 
2198
2257
  for (let n in oClassInfo.events ) {
2199
2258
  const info = oClassInfo.events[n];
2259
+ const visibilityTags = createVisibilityTagsForSetting(info, classAccess);
2260
+
2200
2261
  //link = newStyle ? "{@link #event:" + n + " " + n + "}" : "<code>" + n + "</code>";
2201
2262
  link = "{@link #event:" + n + " " + n + "}";
2202
2263
 
@@ -2221,7 +2282,8 @@ function createAutoDoc(oClassInfo, classComment, doclet, node, parser, filename,
2221
2282
  "@param {" + (info.parameters[pName].type || "") + "} oControlEvent.getParameters." + pName + " " + (info.parameters[pName].doc || "")
2222
2283
  );
2223
2284
  }
2224
- lines.push(visibility);
2285
+ lines.push(visibilityTags);
2286
+
2225
2287
  newJSDoc(lines);
2226
2288
 
2227
2289
  newJSDoc([
@@ -2240,7 +2302,7 @@ function createAutoDoc(oClassInfo, classComment, doclet, node, parser, filename,
2240
2302
  " [oListener] Context object to call the event handler with. Defaults to this <code>" + oClassInfo.name + "</code> itself",
2241
2303
  "",
2242
2304
  "@returns {" + thisClass + "} Reference to <code>this</code> in order to allow method chaining",
2243
- visibility,
2305
+ visibilityTags,
2244
2306
  info.since ? "@since " + info.since : "",
2245
2307
  info.deprecation ? "@deprecated " + info.deprecation : "",
2246
2308
  info.experimental ? "@experimental " + info.experimental : "",
@@ -2260,7 +2322,7 @@ function createAutoDoc(oClassInfo, classComment, doclet, node, parser, filename,
2260
2322
  info.since ? "@since " + info.since : "",
2261
2323
  info.deprecation ? "@deprecated " + info.deprecation : "",
2262
2324
  info.experimental ? "@experimental " + info.experimental : "",
2263
- visibility,
2325
+ visibilityTags,
2264
2326
  "@name " + name("detach", n),
2265
2327
  "@function"
2266
2328
  ]);
@@ -2293,8 +2355,17 @@ function createAutoDoc(oClassInfo, classComment, doclet, node, parser, filename,
2293
2355
  } else {
2294
2356
  lines.push("@returns {" + thisClass + "} Reference to <code>this</code> in order to allow method chaining");
2295
2357
  }
2358
+
2359
+ let vis = "protected"; // default, when event and class are public
2360
+ if (info.visibility !== "public") {
2361
+ vis = info.visibility; // reduced JSDoc visibility of event
2362
+ }
2363
+ if (classAccess === "restricted") {
2364
+ vis = "restricted"; // reduced visibility of class
2365
+ }
2366
+
2296
2367
  lines.push(
2297
- visibility === "@public" ? "@protected" : visibility,
2368
+ createVisibilityTags(vis, info.stakeholders),
2298
2369
  info.since ? "@since " + info.since : "",
2299
2370
  info.deprecation ? "@deprecated " + info.deprecation : "",
2300
2371
  info.experimental ? "@experimental " + info.experimental : "",
@@ -1610,6 +1610,9 @@ function createAPIJSON4Symbol(symbol, omitDefaults) {
1610
1610
  attrib("name", special.name);
1611
1611
  attrib("type", special.type);
1612
1612
  attrib("visibility", special.visibility, 'public');
1613
+ if (special.stakeholders) {
1614
+ stakeholderList("allowedFor", special.stakeholders);
1615
+ }
1613
1616
  attribSince(special.since);
1614
1617
  tag("description", normalizeWS(special.doc), true);
1615
1618
  tagWithSince("experimental", special.experimental);
@@ -1632,9 +1635,18 @@ function createAPIJSON4Symbol(symbol, omitDefaults) {
1632
1635
  tag("property");
1633
1636
  attrib("name", prop.name);
1634
1637
  attrib("type", prop.type, 'string');
1638
+
1639
+ if (prop.dataType) {
1640
+ attrib("dataType", prop.dataType, 'string');
1641
+ }
1642
+
1635
1643
  attrib("defaultValue", defaultValue, null, /* raw = */true);
1636
1644
  attrib("group", prop.group, 'Misc');
1637
1645
  attrib("visibility", prop.visibility, 'public');
1646
+ if (prop.stakeholders) {
1647
+ stakeholderList("allowedFor", prop.stakeholders);
1648
+ }
1649
+
1638
1650
  attribSince(prop.since);
1639
1651
  if ( prop.bindable ) {
1640
1652
  attrib("bindable", prop.bindable, false, /* raw = */true);
@@ -1669,6 +1681,10 @@ function createAPIJSON4Symbol(symbol, omitDefaults) {
1669
1681
  }
1670
1682
  attrib("cardinality", aggr.cardinality, '0..n');
1671
1683
  attrib("visibility", aggr.visibility, 'public');
1684
+ if (aggr.stakeholders) {
1685
+ stakeholderList("allowedFor", aggr.stakeholders);
1686
+ }
1687
+
1672
1688
  attribSince(aggr.since);
1673
1689
  if ( aggr.bindable ) {
1674
1690
  attrib("bindable", aggr.bindable, false, /* raw = */true);
@@ -1699,6 +1715,10 @@ function createAPIJSON4Symbol(symbol, omitDefaults) {
1699
1715
  attrib("type", assoc.type, 'sap.ui.core.Control');
1700
1716
  attrib("cardinality", assoc.cardinality, '0..1');
1701
1717
  attrib("visibility", assoc.visibility, 'public');
1718
+ if (assoc.stakeholders) {
1719
+ stakeholderList("allowedFor", assoc.stakeholders);
1720
+ }
1721
+
1702
1722
  attribSince(assoc.since);
1703
1723
  tag("description", normalizeWS(assoc.doc), true);
1704
1724
  tagWithSince("experimental", assoc.experimental);
@@ -1716,6 +1736,9 @@ function createAPIJSON4Symbol(symbol, omitDefaults) {
1716
1736
  tag("event");
1717
1737
  attrib("name", event.name);
1718
1738
  attrib("visibility", event.visibility, 'public');
1739
+ if (event.stakeholders) {
1740
+ stakeholderList("allowedFor", event.stakeholders);
1741
+ }
1719
1742
  if ( event.allowPreventDefault ) {
1720
1743
  attrib("allowPreventDefault", event.allowPreventDefault, false, /* raw = */true);
1721
1744
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ui5/builder",
3
- "version": "3.4.0",
3
+ "version": "3.5.0",
4
4
  "description": "UI5 Tooling - Builder",
5
5
  "author": {
6
6
  "name": "SAP SE",
@@ -126,12 +126,12 @@
126
126
  "escope": "^4.0.0",
127
127
  "espree": "^9.6.1",
128
128
  "graceful-fs": "^4.2.11",
129
- "jsdoc": "^4.0.2",
129
+ "jsdoc": "^4.0.3",
130
130
  "less-openui5": "^0.11.6",
131
131
  "pretty-data": "^0.40.0",
132
- "rimraf": "^5.0.5",
133
- "semver": "^7.6.0",
134
- "terser": "^5.30.3",
132
+ "rimraf": "^5.0.7",
133
+ "semver": "^7.6.2",
134
+ "terser": "^5.31.1",
135
135
  "workerpool": "^6.5.1",
136
136
  "xml2js": "^0.6.2"
137
137
  },
@@ -150,7 +150,7 @@
150
150
  "eslint-config-google": "^0.14.0",
151
151
  "eslint-plugin-ava": "^14.0.0",
152
152
  "eslint-plugin-jsdoc": "^46.10.1",
153
- "esmock": "^2.6.4",
153
+ "esmock": "^2.6.6",
154
154
  "line-column": "^1.0.2",
155
155
  "nyc": "^15.1.0",
156
156
  "open-cli": "^7.2.0",