@sap-ux/project-access 1.26.5 → 1.26.7

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.
@@ -236,26 +236,23 @@ exports.findAllApps = findAllApps;
236
236
  * @returns - results as path to apps plus files already parsed, e.g. manifest.json
237
237
  */
238
238
  async function filterApplications(pathMap) {
239
- const result = [];
240
- const manifestPaths = Object.keys(pathMap).filter((path) => (0, path_1.basename)(path) === constants_1.FileName.Manifest);
241
- for (const manifestPath of manifestPaths) {
242
- try {
243
- // All UI5 apps have at least sap.app: { id: <ID>, type: "application" } in manifest.json
244
- pathMap[manifestPath] ??= await (0, file_1.readJSON)(manifestPath);
245
- const manifest = pathMap[manifestPath];
246
- if (!manifest['sap.app']?.id || manifest['sap.app'].type !== 'application') {
247
- continue;
248
- }
249
- const roots = await findRootsForPath(manifestPath);
239
+ const filterApplicationByManifest = async (manifestPath) => {
240
+ pathMap[manifestPath] ??= await (0, file_1.readJSON)(manifestPath);
241
+ const manifest = pathMap[manifestPath]; // cast needed as pathMap also allows strings and any other objects
242
+ // cast allowed, as this is the only place pathMap is filled for manifests
243
+ if (manifest['sap.app'].id && manifest['sap.app'].type === 'application') {
244
+ const roots = await findRootsForPath((0, path_1.dirname)(manifestPath));
250
245
  if (roots && !(await (0, file_1.fileExists)((0, path_1.join)(roots.appRoot, '.adp', constants_1.FileName.AdaptationConfig)))) {
251
- result.push({ appRoot: roots.appRoot, projectRoot: roots.projectRoot, manifest, manifestPath });
246
+ return { appRoot: roots.appRoot, projectRoot: roots.projectRoot, manifest: manifest, manifestPath };
252
247
  }
253
248
  }
254
- catch {
255
- // ignore exceptions for invalid manifests
256
- }
257
- }
258
- return result;
249
+ throw new Error('Not relevant');
250
+ };
251
+ const isFulFilled = (input) => input.status === 'fulfilled';
252
+ const manifestPaths = Object.keys(pathMap).filter((path) => (0, path_1.basename)(path) === constants_1.FileName.Manifest);
253
+ return (await Promise.allSettled(manifestPaths.map(filterApplicationByManifest)))
254
+ .filter(isFulFilled) // returning only valid applications
255
+ .map(({ value }) => value);
259
256
  }
260
257
  /**
261
258
  * Filter adaptation projects from a list of files.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sap-ux/project-access",
3
- "version": "1.26.5",
3
+ "version": "1.26.7",
4
4
  "description": "Library to access SAP Fiori tools projects",
5
5
  "repository": {
6
6
  "type": "git",
@@ -30,7 +30,7 @@
30
30
  "mem-fs-editor": "9.4.0",
31
31
  "semver": "7.5.4",
32
32
  "@sap-ux/i18n": "0.1.1",
33
- "@sap-ux/ui5-config": "0.23.1"
33
+ "@sap-ux/ui5-config": "0.24.0"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/mem-fs": "1.1.2",