@sap-ux/project-access 1.29.0 → 1.29.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.
|
@@ -3,11 +3,11 @@ import { UI5Config } from '@sap-ux/ui5-config';
|
|
|
3
3
|
/**
|
|
4
4
|
* Get path to webapp.
|
|
5
5
|
*
|
|
6
|
-
* @param
|
|
6
|
+
* @param appRoot - root to the application
|
|
7
7
|
* @param [memFs] - optional mem-fs editor instance
|
|
8
8
|
* @returns - path to webapp folder
|
|
9
9
|
*/
|
|
10
|
-
export declare function getWebappPath(
|
|
10
|
+
export declare function getWebappPath(appRoot: string, memFs?: Editor): Promise<string>;
|
|
11
11
|
/**
|
|
12
12
|
* Checks if UI5 config yaml file exists and returns its content.
|
|
13
13
|
*
|
|
@@ -10,19 +10,24 @@ const file_1 = require("../file");
|
|
|
10
10
|
/**
|
|
11
11
|
* Get path to webapp.
|
|
12
12
|
*
|
|
13
|
-
* @param
|
|
13
|
+
* @param appRoot - root to the application
|
|
14
14
|
* @param [memFs] - optional mem-fs editor instance
|
|
15
15
|
* @returns - path to webapp folder
|
|
16
16
|
*/
|
|
17
|
-
async function getWebappPath(
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
async function getWebappPath(appRoot, memFs) {
|
|
18
|
+
const ui5YamlPath = (0, path_1.join)(appRoot, constants_1.FileName.Ui5Yaml);
|
|
19
|
+
let webappPath = (0, path_1.join)(appRoot, constants_1.DirName.Webapp);
|
|
20
20
|
if (await (0, file_1.fileExists)(ui5YamlPath, memFs)) {
|
|
21
21
|
const yamlString = await (0, file_1.readFile)(ui5YamlPath, memFs);
|
|
22
22
|
const ui5Config = await ui5_config_1.UI5Config.newInstance(yamlString);
|
|
23
23
|
const relativeWebappPath = ui5Config.getConfiguration()?.paths?.webapp;
|
|
24
24
|
if (relativeWebappPath) {
|
|
25
|
-
|
|
25
|
+
// Search for folder with package.json inside
|
|
26
|
+
const packageJsonPath = await (0, file_1.findFileUp)(constants_1.FileName.Package, appRoot, memFs);
|
|
27
|
+
if (packageJsonPath) {
|
|
28
|
+
const packageJsonDirPath = (0, path_1.dirname)(packageJsonPath);
|
|
29
|
+
webappPath = (0, path_1.join)(packageJsonDirPath, relativeWebappPath);
|
|
30
|
+
}
|
|
26
31
|
}
|
|
27
32
|
}
|
|
28
33
|
return webappPath;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-ux/project-access",
|
|
3
|
-
"version": "1.29.
|
|
3
|
+
"version": "1.29.2",
|
|
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.2.0",
|
|
33
|
-
"@sap-ux/ui5-config": "0.26.
|
|
33
|
+
"@sap-ux/ui5-config": "0.26.1"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/mem-fs": "1.1.2",
|