@sap-ux/project-access 1.29.1 → 1.29.3
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/dist/project/cap.js
CHANGED
|
@@ -169,6 +169,12 @@ async function getCapModelAndServices(projectRoot) {
|
|
|
169
169
|
_logger?.info(`@sap-ux/project-access:getCapModelAndServices - Using 'cds.root': ${cds.root}`);
|
|
170
170
|
_logger?.info(`@sap-ux/project-access:getCapModelAndServices - Using 'projectRoot': ${_projectRoot}`);
|
|
171
171
|
let services = cds.compile.to.serviceinfo(model, { root: _projectRoot }) ?? [];
|
|
172
|
+
// filter services that have ( urlPath defined AND no endpoints) OR have endpoints with kind 'odata'
|
|
173
|
+
// i.e. ignore services for websockets and other unsupported protocols
|
|
174
|
+
if (services.filter) {
|
|
175
|
+
services = services.filter((service) => (service.urlPath && service.endpoints === undefined) ||
|
|
176
|
+
service.endpoints?.find((endpoint) => endpoint.kind === 'odata'));
|
|
177
|
+
}
|
|
172
178
|
if (services.map) {
|
|
173
179
|
services = services.map((value) => {
|
|
174
180
|
const { endpoints, urlPath } = value;
|
|
@@ -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;
|