@sap-ux/project-access 1.28.0 → 1.28.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.
- package/dist/project/cap.d.ts +1 -0
- package/dist/project/cap.js +8 -5
- package/package.json +1 -1
package/dist/project/cap.d.ts
CHANGED
|
@@ -46,6 +46,7 @@ export declare function getCapCustomPaths(capProjectPath: string): Promise<CapCu
|
|
|
46
46
|
export declare function getCapModelAndServices(projectRoot: string | {
|
|
47
47
|
projectRoot: string;
|
|
48
48
|
logger?: Logger;
|
|
49
|
+
pathSelection?: Set<'app' | 'srv' | 'db'>;
|
|
49
50
|
}): Promise<{
|
|
50
51
|
model: csn;
|
|
51
52
|
services: ServiceInfo[];
|
package/dist/project/cap.js
CHANGED
|
@@ -111,20 +111,23 @@ async function getCapCustomPaths(capProjectPath) {
|
|
|
111
111
|
async function getCapModelAndServices(projectRoot) {
|
|
112
112
|
let _projectRoot;
|
|
113
113
|
let _logger;
|
|
114
|
+
let _pathSelection;
|
|
115
|
+
const defaultPathSelection = new Set(['app', 'srv', 'db']);
|
|
114
116
|
if (typeof projectRoot === 'object') {
|
|
115
117
|
_projectRoot = projectRoot.projectRoot;
|
|
116
118
|
_logger = projectRoot.logger;
|
|
119
|
+
_pathSelection = projectRoot.pathSelection ? projectRoot.pathSelection : defaultPathSelection;
|
|
117
120
|
}
|
|
118
121
|
else {
|
|
122
|
+
_pathSelection = defaultPathSelection;
|
|
119
123
|
_projectRoot = projectRoot;
|
|
120
124
|
}
|
|
121
125
|
const cds = await loadCdsModuleFromProject(_projectRoot, true);
|
|
122
126
|
const capProjectPaths = await getCapCustomPaths(_projectRoot);
|
|
123
|
-
const modelPaths = [
|
|
124
|
-
|
|
125
|
-
(0, path_1.join)(_projectRoot, capProjectPaths
|
|
126
|
-
|
|
127
|
-
];
|
|
127
|
+
const modelPaths = [];
|
|
128
|
+
_pathSelection?.forEach((path) => {
|
|
129
|
+
modelPaths.push((0, path_1.join)(_projectRoot, capProjectPaths[path]));
|
|
130
|
+
});
|
|
128
131
|
const model = await cds.load(modelPaths, { root: _projectRoot });
|
|
129
132
|
_logger?.info(`@sap-ux/project-access:getCapModelAndServices - Using 'cds.home': ${cds.home}`);
|
|
130
133
|
_logger?.info(`@sap-ux/project-access:getCapModelAndServices - Using 'cds.version': ${cds.version}`);
|