@ui5/builder 3.0.6 → 3.0.8

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,20 @@
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.0.6...HEAD).
5
+ A list of unreleased changes can be found [here](https://github.com/SAP/ui5-builder/compare/v3.0.8...HEAD).
6
+
7
+ <a name="v3.0.8"></a>
8
+ ## [v3.0.8] - 2023-07-18
9
+ ### Bug Fixes
10
+ - Revert "[INTERNAL] Remove implicit dependencies concept ([#913](https://github.com/SAP/ui5-builder/issues/913))" [`1043714`](https://github.com/SAP/ui5-builder/commit/1043714e3b952a8280f1ff7909f79db3b750eb0c)
11
+ - **generateJsdoc:** Also process resources created by preceeding tasks [`04447bd`](https://github.com/SAP/ui5-builder/commit/04447bdec28b8bf18c24bd53e3fe8be9bdeed6c2)
12
+
13
+
14
+ <a name="v3.0.7"></a>
15
+ ## [v3.0.7] - 2023-07-13
16
+ ### Bug Fixes
17
+ - Don't report a missing module that's contained in another bundle ([#915](https://github.com/SAP/ui5-builder/issues/915)) [`8f23f38`](https://github.com/SAP/ui5-builder/commit/8f23f388f6d64f313ae8a89d0fcaf39ba905a70b)
18
+
6
19
 
7
20
  <a name="v3.0.6"></a>
8
21
  ## [v3.0.6] - 2023-06-21
@@ -803,6 +816,8 @@ to load the custom bundle file instead.
803
816
 
804
817
  ### Features
805
818
  - Add ability to configure component preloads and custom bundles [`2241e5f`](https://github.com/SAP/ui5-builder/commit/2241e5ff98fd95f1f80cc74959655ae7a9c660e7)
819
+ [v3.0.8]: https://github.com/SAP/ui5-builder/compare/v3.0.7...v3.0.8
820
+ [v3.0.7]: https://github.com/SAP/ui5-builder/compare/v3.0.6...v3.0.7
806
821
  [v3.0.6]: https://github.com/SAP/ui5-builder/compare/v3.0.5...v3.0.6
807
822
  [v3.0.5]: https://github.com/SAP/ui5-builder/compare/v3.0.4...v3.0.5
808
823
  [v3.0.4]: https://github.com/SAP/ui5-builder/compare/v3.0.3...v3.0.4
@@ -51,6 +51,16 @@ class BundleResolver {
51
51
  let selectedResources = Object.create(null);
52
52
  let selectedResourcesSequence = [];
53
53
  const pool = this.pool;
54
+ /**
55
+ * Names of modules that are required in some way but could not be found
56
+ * in the resource pool.
57
+ */
58
+ const missingModules = Object.create(null);
59
+ /**
60
+ * Names of modules that are included in non-decomposable bundles.
61
+ * If they occur in the missingModules, then this is not an error.
62
+ */
63
+ const includedModules = new Set();
54
64
 
55
65
  /**
56
66
  * @param {JSModuleSectionDefinition} section
@@ -71,11 +81,16 @@ class BundleResolver {
71
81
  }
72
82
 
73
83
  function checkForDecomposableBundle(resource) {
74
- if ( resource == null ||
75
- resource.info == null ||
76
- resource.info.subModules.length === 0 ||
77
- /(?:^|\/)library.js$/.test(resource.info.name) ) {
78
- return {resource, decomposable: false};
84
+ const isBundle =
85
+ resource?.info?.subModules.length > 0 &&
86
+ !/(?:^|\/)library.js$/.test(resource.info.name);
87
+
88
+ if (!isBundle) {
89
+ return {
90
+ resource,
91
+ isBundle,
92
+ decomposable: false
93
+ };
79
94
  }
80
95
 
81
96
  return Promise.all(
@@ -83,7 +98,11 @@ class BundleResolver {
83
98
  ).then((modules) => {
84
99
  // it might look more natural to expect 'all' embedded modules to exist in the pool,
85
100
  // but expecting only 'some' module to exist is a more conservative approach
86
- return ({resource, decomposable: modules.some(($) => ($))});
101
+ return {
102
+ resource,
103
+ isBundle,
104
+ decomposable: modules.some(($) => ($))
105
+ };
87
106
  });
88
107
  }
89
108
 
@@ -105,20 +124,29 @@ class BundleResolver {
105
124
  .catch( (err) => {
106
125
  // if the caller provided an error message, log it
107
126
  if ( msg ) {
108
- log.error(msg);
127
+ missingModules[resourceName] ??= [];
128
+ missingModules[resourceName].push(msg);
109
129
  }
110
130
  // return undefined
111
131
  })
112
132
  .then( (resource) => checkForDecomposableBundle(resource) )
113
- .then( ({resource, decomposable}) => {
133
+ .then( ({resource, isBundle, decomposable}) => {
114
134
  const dependencyInfo = resource && resource.info;
115
135
  let promises = [];
116
136
 
137
+ if ( isBundle && !decomposable ) {
138
+ resource.info.subModules.forEach(
139
+ (included) => {
140
+ includedModules.add(included);
141
+ }
142
+ );
143
+ }
144
+
117
145
  if ( decomposable ) {
118
146
  // bundles are not added, only their embedded modules
119
147
  promises = dependencyInfo.subModules.map( (included) => {
120
148
  return checkAndAddResource(included, depth + 1,
121
- "**** error: missing submodule " + included + ", included by " + resourceName);
149
+ `**** error: missing submodule ${included}, included by ${resourceName}`);
122
150
  });
123
151
  } else if ( resource != null ) {
124
152
  // trace.trace(" checking dependencies of " + resource.name );
@@ -136,8 +164,8 @@ class BundleResolver {
136
164
  return;
137
165
  }
138
166
 
139
- return checkAndAddResource( required, depth + 1,
140
- "**** error: missing module " + required + ", required by " + resourceName);
167
+ return checkAndAddResource(required, depth + 1,
168
+ `**** error: missing module ${required}, required by ${resourceName}`);
141
169
  });
142
170
  }
143
171
 
@@ -317,6 +345,17 @@ class BundleResolver {
317
345
  // NODE-TODO if ( PerfMeasurement.ACTIVE ) PerfMeasurement.stop(PerfKeys.RESOLVE_MODULE);
318
346
 
319
347
  return previous.then( function() {
348
+ // ignore missing modules that have been found in non-decomposable bundles
349
+ includedModules.forEach((included) => delete missingModules[included]);
350
+
351
+ // report the remaining missing modules
352
+ Object.keys(missingModules).sort().forEach((missing) => {
353
+ const messages = missingModules[missing];
354
+ messages.sort().forEach((msg) => {
355
+ log.error(msg);
356
+ });
357
+ });
358
+
320
359
  log.verbose(" Resolving bundle done");
321
360
 
322
361
  return resolved;