@sap-ux/project-access 1.15.0 → 1.15.2

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.
@@ -22,8 +22,8 @@ const module_loader_1 = require("./module-loader");
22
22
  * @returns - true if the project is a CAP Node.js project
23
23
  */
24
24
  function isCapNodeJsProject(packageJson) {
25
- var _a;
26
- return !!(packageJson.cds || ((_a = packageJson.dependencies) === null || _a === void 0 ? void 0 : _a['@sap/cds']));
25
+ var _a, _b;
26
+ return !!((_a = packageJson.cds) !== null && _a !== void 0 ? _a : (_b = packageJson.dependencies) === null || _b === void 0 ? void 0 : _b['@sap/cds']);
27
27
  }
28
28
  exports.isCapNodeJsProject = isCapNodeJsProject;
29
29
  /**
@@ -11,7 +11,7 @@ const constants_1 = require("../constants");
11
11
  * @param dependency - name of the dependency
12
12
  * @returns - true: has dependency; false: no dependency
13
13
  */
14
- const hasDependency = (packageJson, dependency) => { var _a, _b; return !!(((_a = packageJson.dependencies) === null || _a === void 0 ? void 0 : _a[dependency]) || ((_b = packageJson.devDependencies) === null || _b === void 0 ? void 0 : _b[dependency])); };
14
+ const hasDependency = (packageJson, dependency) => { var _a, _b, _c; return !!((_b = (_a = packageJson.dependencies) === null || _a === void 0 ? void 0 : _a[dependency]) !== null && _b !== void 0 ? _b : (_c = packageJson.devDependencies) === null || _c === void 0 ? void 0 : _c[dependency]); };
15
15
  exports.hasDependency = hasDependency;
16
16
  /**
17
17
  * Returns path to folder that hosts 'node_modules' used by project.
@@ -235,7 +235,7 @@ exports.findAllApps = findAllApps;
235
235
  * @returns - results as path to apps plus files already parsed, e.g. manifest.json
236
236
  */
237
237
  function filterApplications(pathMap) {
238
- var _a;
238
+ var _a, _b;
239
239
  return __awaiter(this, void 0, void 0, function* () {
240
240
  const result = [];
241
241
  const manifestPaths = Object.keys(pathMap).filter((path) => (0, path_1.basename)(path) === constants_1.FileName.Manifest);
@@ -244,7 +244,7 @@ function filterApplications(pathMap) {
244
244
  // All UI5 apps have at least sap.app: { id: <ID>, type: "application" } in manifest.json
245
245
  (_a = pathMap[manifestPath]) !== null && _a !== void 0 ? _a : (pathMap[manifestPath] = yield (0, file_1.readJSON)(manifestPath));
246
246
  const manifest = pathMap[manifestPath];
247
- if (!manifest['sap.app'] || !manifest['sap.app'].id || manifest['sap.app'].type !== 'application') {
247
+ if (!((_b = manifest['sap.app']) === null || _b === void 0 ? void 0 : _b.id) || manifest['sap.app'].type !== 'application') {
248
248
  continue;
249
249
  }
250
250
  const roots = yield findRootsForPath(manifestPath);
@@ -252,7 +252,7 @@ function filterApplications(pathMap) {
252
252
  result.push({ appRoot: roots.appRoot, projectRoot: roots.projectRoot, manifest, manifestPath });
253
253
  }
254
254
  }
255
- catch (_b) {
255
+ catch (_c) {
256
256
  // ignore exceptions for invalid manifests
257
257
  }
258
258
  }
@@ -270,9 +270,10 @@ function filterAdaptations(pathMap) {
270
270
  const results = [];
271
271
  const manifestAppDescrVars = Object.keys(pathMap).filter((path) => path.endsWith(constants_1.FileName.ManifestAppDescrVar));
272
272
  for (const manifestAppDescrVar of manifestAppDescrVars) {
273
- const adpPath = yield (0, file_1.findFileUp)('.adp', (0, path_1.dirname)(manifestAppDescrVar));
274
- if (adpPath && (yield (0, file_1.fileExists)((0, path_1.join)(adpPath, constants_1.FileName.AdaptationConfig)))) {
275
- results.push({ appRoot: (0, path_1.dirname)(adpPath), manifestAppdescrVariantPath: manifestAppDescrVar });
273
+ const packageJsonPath = yield (0, file_1.findFileUp)(constants_1.FileName.Package, (0, path_1.dirname)(manifestAppDescrVar));
274
+ const projectRoot = packageJsonPath ? (0, path_1.dirname)(packageJsonPath) : null;
275
+ if (projectRoot && (yield (0, file_1.fileExists)((0, path_1.join)(projectRoot, 'webapp', constants_1.FileName.ManifestAppDescrVar)))) {
276
+ results.push({ appRoot: projectRoot, manifestAppdescrVariantPath: manifestAppDescrVar });
276
277
  }
277
278
  }
278
279
  return results;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sap-ux/project-access",
3
- "version": "1.15.0",
3
+ "version": "1.15.2",
4
4
  "description": "Library to access SAP Fiori tools projects",
5
5
  "repository": {
6
6
  "type": "git",