@sap-ux/project-access 1.0.6 → 1.1.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.
@@ -4,8 +4,9 @@ import type { AllAppResults, WorkspaceFolder } from '../types';
4
4
  *
5
5
  * @param path path of a project file
6
6
  * @param sapuxRequired if true, only find sapux projects
7
+ * @param silent if true, then does not throw an error but returns an empty path
7
8
  */
8
- export declare function findProjectRoot(path: string, sapuxRequired?: boolean): Promise<string>;
9
+ export declare function findProjectRoot(path: string, sapuxRequired?: boolean, silent?: boolean): Promise<string>;
9
10
  /**
10
11
  * Get the application root for a given webapp path.
11
12
  *
@@ -65,11 +65,15 @@ function findAllManifest(wsFolders) {
65
65
  *
66
66
  * @param path path of a project file
67
67
  * @param sapuxRequired if true, only find sapux projects
68
+ * @param silent if true, then does not throw an error but returns an empty path
68
69
  */
69
- function findProjectRoot(path, sapuxRequired = true) {
70
+ function findProjectRoot(path, sapuxRequired = true, silent = false) {
70
71
  return __awaiter(this, void 0, void 0, function* () {
71
72
  const packageJson = yield file_1.findFileUp(constants_1.FileName.Package, path);
72
73
  if (!packageJson) {
74
+ if (silent) {
75
+ return '';
76
+ }
73
77
  throw new Error(`Could not find any project root for '${path}'. Search was done for ${sapuxRequired ? 'Fiori elements' : 'All'} projects.`);
74
78
  }
75
79
  let root = path_1.dirname(packageJson);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sap-ux/project-access",
3
- "version": "1.0.6",
3
+ "version": "1.1.1",
4
4
  "description": "Library to access SAP Fiori tools projects",
5
5
  "repository": {
6
6
  "type": "git",
@@ -24,7 +24,7 @@
24
24
  "node": ">= 14.16.0 < 15.0.0 || >=16.1.0 < 17.0.0 || >=18.0.0 < 19.0.0"
25
25
  },
26
26
  "dependencies": {
27
- "@sap-ux/ui5-config": "0.16.2",
27
+ "@sap-ux/ui5-config": "0.16.3",
28
28
  "findit2": "2.2.3",
29
29
  "mem-fs": "2.1.0",
30
30
  "mem-fs-editor": "9.4.0"