@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.
@@ -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[];
@@ -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
- (0, path_1.join)(_projectRoot, capProjectPaths.app),
125
- (0, path_1.join)(_projectRoot, capProjectPaths.srv),
126
- (0, path_1.join)(_projectRoot, capProjectPaths.db)
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}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sap-ux/project-access",
3
- "version": "1.28.0",
3
+ "version": "1.28.2",
4
4
  "description": "Library to access SAP Fiori tools projects",
5
5
  "repository": {
6
6
  "type": "git",