@sap-ux/project-access 1.10.1 → 1.11.0

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,6 +3,7 @@ export declare const FileName: {
3
3
  readonly ExtConfigJson: ".extconfig.json";
4
4
  readonly Manifest: "manifest.json";
5
5
  readonly ManifestAppDescrVar: "manifest.appdescr_variant";
6
+ readonly MtaYaml: "mta.yaml";
6
7
  readonly Package: "package.json";
7
8
  readonly Tsconfig: "tsconfig.json";
8
9
  readonly Ui5Yaml: "ui5.yaml";
package/dist/constants.js CHANGED
@@ -6,6 +6,7 @@ exports.FileName = {
6
6
  ExtConfigJson: '.extconfig.json',
7
7
  Manifest: 'manifest.json',
8
8
  ManifestAppDescrVar: 'manifest.appdescr_variant',
9
+ MtaYaml: 'mta.yaml',
9
10
  Package: 'package.json',
10
11
  Tsconfig: 'tsconfig.json',
11
12
  Ui5Yaml: 'ui5.yaml',
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { FileName } from './constants';
2
- export { findAllApps, findFioriArtifacts, findProjectRoot, getAppRootFromWebappPath, getAppProgrammingLanguage, getCapCustomPaths, getCapEnvironment, getCapModelAndServices, getCapProjectType, getWebappPath, isCapJavaProject, isCapNodeJsProject, loadModuleFromProject, readCapServiceMetadataEdmx, readUi5Yaml } from './project';
2
+ export { findAllApps, findFioriArtifacts, findProjectRoot, getAppRootFromWebappPath, getAppProgrammingLanguage, getCapCustomPaths, getCapEnvironment, getCapModelAndServices, getCapProjectType, getMtaPath, getWebappPath, isCapJavaProject, isCapNodeJsProject, loadModuleFromProject, readCapServiceMetadataEdmx, readUi5Yaml } from './project';
3
3
  export { getFilePaths } from './file';
4
4
  export * from './types';
5
5
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.getFilePaths = exports.readUi5Yaml = exports.readCapServiceMetadataEdmx = exports.loadModuleFromProject = exports.isCapNodeJsProject = exports.isCapJavaProject = exports.getWebappPath = exports.getCapProjectType = exports.getCapModelAndServices = exports.getCapEnvironment = exports.getCapCustomPaths = exports.getAppProgrammingLanguage = exports.getAppRootFromWebappPath = exports.findProjectRoot = exports.findFioriArtifacts = exports.findAllApps = exports.FileName = void 0;
17
+ exports.getFilePaths = exports.readUi5Yaml = exports.readCapServiceMetadataEdmx = exports.loadModuleFromProject = exports.isCapNodeJsProject = exports.isCapJavaProject = exports.getWebappPath = exports.getMtaPath = exports.getCapProjectType = exports.getCapModelAndServices = exports.getCapEnvironment = exports.getCapCustomPaths = exports.getAppProgrammingLanguage = exports.getAppRootFromWebappPath = exports.findProjectRoot = exports.findFioriArtifacts = exports.findAllApps = exports.FileName = void 0;
18
18
  var constants_1 = require("./constants");
19
19
  Object.defineProperty(exports, "FileName", { enumerable: true, get: function () { return constants_1.FileName; } });
20
20
  var project_1 = require("./project");
@@ -27,6 +27,7 @@ Object.defineProperty(exports, "getCapCustomPaths", { enumerable: true, get: fun
27
27
  Object.defineProperty(exports, "getCapEnvironment", { enumerable: true, get: function () { return project_1.getCapEnvironment; } });
28
28
  Object.defineProperty(exports, "getCapModelAndServices", { enumerable: true, get: function () { return project_1.getCapModelAndServices; } });
29
29
  Object.defineProperty(exports, "getCapProjectType", { enumerable: true, get: function () { return project_1.getCapProjectType; } });
30
+ Object.defineProperty(exports, "getMtaPath", { enumerable: true, get: function () { return project_1.getMtaPath; } });
30
31
  Object.defineProperty(exports, "getWebappPath", { enumerable: true, get: function () { return project_1.getWebappPath; } });
31
32
  Object.defineProperty(exports, "isCapJavaProject", { enumerable: true, get: function () { return project_1.isCapJavaProject; } });
32
33
  Object.defineProperty(exports, "isCapNodeJsProject", { enumerable: true, get: function () { return project_1.isCapNodeJsProject; } });
@@ -3,4 +3,5 @@ export { getAppProgrammingLanguage } from './info';
3
3
  export { loadModuleFromProject } from './module-loader';
4
4
  export { findAllApps, findFioriArtifacts, findProjectRoot, getAppRootFromWebappPath } from './search';
5
5
  export { getWebappPath, readUi5Yaml } from './ui5-config';
6
+ export { getMtaPath } from './mta';
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.readUi5Yaml = exports.getWebappPath = exports.getAppRootFromWebappPath = exports.findProjectRoot = exports.findFioriArtifacts = exports.findAllApps = exports.loadModuleFromProject = exports.getAppProgrammingLanguage = exports.readCapServiceMetadataEdmx = exports.getCapEnvironment = exports.isCapNodeJsProject = exports.isCapJavaProject = exports.getCapProjectType = exports.getCapModelAndServices = exports.getCapCustomPaths = void 0;
3
+ exports.getMtaPath = exports.readUi5Yaml = exports.getWebappPath = exports.getAppRootFromWebappPath = exports.findProjectRoot = exports.findFioriArtifacts = exports.findAllApps = exports.loadModuleFromProject = exports.getAppProgrammingLanguage = exports.readCapServiceMetadataEdmx = exports.getCapEnvironment = exports.isCapNodeJsProject = exports.isCapJavaProject = exports.getCapProjectType = exports.getCapModelAndServices = exports.getCapCustomPaths = void 0;
4
4
  var cap_1 = require("./cap");
5
5
  Object.defineProperty(exports, "getCapCustomPaths", { enumerable: true, get: function () { return cap_1.getCapCustomPaths; } });
6
6
  Object.defineProperty(exports, "getCapModelAndServices", { enumerable: true, get: function () { return cap_1.getCapModelAndServices; } });
@@ -21,4 +21,6 @@ Object.defineProperty(exports, "getAppRootFromWebappPath", { enumerable: true, g
21
21
  var ui5_config_1 = require("./ui5-config");
22
22
  Object.defineProperty(exports, "getWebappPath", { enumerable: true, get: function () { return ui5_config_1.getWebappPath; } });
23
23
  Object.defineProperty(exports, "readUi5Yaml", { enumerable: true, get: function () { return ui5_config_1.readUi5Yaml; } });
24
+ var mta_1 = require("./mta");
25
+ Object.defineProperty(exports, "getMtaPath", { enumerable: true, get: function () { return mta_1.getMtaPath; } });
24
26
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,15 @@
1
+ import type { Editor } from 'mem-fs-editor';
2
+ import type { MtaPath } from '../types/mta';
3
+ /**
4
+ * Searches `projectPath` and parent folders.
5
+ * If mta.yaml file is inside projectPath, this is a special type of MTA project
6
+ * that created in Fiori generator (Standalone App Router). E.g. Creating a new project that doesn't have
7
+ * a parent root folder for MTA project, and this project itself is configured
8
+ * to have deploy target CF and user answered yes to "add to Managed App Router" question.
9
+ *
10
+ * @param projectPath Fiori app root folder
11
+ * @param fs
12
+ * @returns MtaPath
13
+ */
14
+ export declare function getMtaPath(projectPath: string, fs?: Editor): Promise<MtaPath | undefined>;
15
+ //# sourceMappingURL=mta.d.ts.map
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.getMtaPath = void 0;
13
+ const file_search_1 = require("../file/file-search");
14
+ const constants_1 = require("../constants");
15
+ const path_1 = require("path");
16
+ /**
17
+ * Searches `projectPath` and parent folders.
18
+ * If mta.yaml file is inside projectPath, this is a special type of MTA project
19
+ * that created in Fiori generator (Standalone App Router). E.g. Creating a new project that doesn't have
20
+ * a parent root folder for MTA project, and this project itself is configured
21
+ * to have deploy target CF and user answered yes to "add to Managed App Router" question.
22
+ *
23
+ * @param projectPath Fiori app root folder
24
+ * @param fs
25
+ * @returns MtaPath
26
+ */
27
+ function getMtaPath(projectPath, fs) {
28
+ return __awaiter(this, void 0, void 0, function* () {
29
+ const mtaPath = yield (0, file_search_1.findFileUp)(constants_1.FileName.MtaYaml, projectPath, fs);
30
+ if (!mtaPath) {
31
+ return undefined;
32
+ }
33
+ else {
34
+ const mtaFolderPath = (0, path_1.dirname)(mtaPath);
35
+ return {
36
+ mtaPath,
37
+ hasRoot: mtaFolderPath !== projectPath
38
+ };
39
+ }
40
+ });
41
+ }
42
+ exports.getMtaPath = getMtaPath;
43
+ //# sourceMappingURL=mta.js.map
@@ -23,7 +23,7 @@ export declare function getAppRootFromWebappPath(webappPath: string): Promise<st
23
23
  * @param wsFolders - list of roots, either as vscode WorkspaceFolder[] or array of paths
24
24
  * @returns - results as path to apps plus files already parsed, e.g. manifest.json
25
25
  */
26
- export declare function findAllApps(wsFolders: WorkspaceFolder[] | string[] | undefined): Promise<AllAppResults[]>;
26
+ export declare function findAllApps(wsFolders: readonly WorkspaceFolder[] | string[] | undefined): Promise<AllAppResults[]>;
27
27
  /**
28
28
  * Find all requested Fiori artifacts like apps, adaptations, extensions, that are supported by Fiori tools, for a given list of roots (workspace folders).
29
29
  *
@@ -33,7 +33,7 @@ export declare function findAllApps(wsFolders: WorkspaceFolder[] | string[] | un
33
33
  * @returns - data structure containing the search results, for app e.g. as path to app plus files already parsed, e.g. manifest.json
34
34
  */
35
35
  export declare function findFioriArtifacts(options: {
36
- wsFolders?: WorkspaceFolder[] | string[];
36
+ wsFolders?: readonly WorkspaceFolder[] | string[];
37
37
  artifacts: FioriArtifactTypes[];
38
38
  }): Promise<FoundFioriArtifacts>;
39
39
  //# sourceMappingURL=search.d.ts.map
@@ -59,7 +59,7 @@ function wsFoldersToRootPaths(wsFolders) {
59
59
  });
60
60
  }
61
61
  else {
62
- wsRoots = wsFolders || [];
62
+ wsRoots = (wsFolders !== null && wsFolders !== void 0 ? wsFolders : []);
63
63
  }
64
64
  return wsRoots;
65
65
  }
@@ -0,0 +1,5 @@
1
+ export interface MtaPath {
2
+ mtaPath: string;
3
+ hasRoot: boolean;
4
+ }
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sap-ux/project-access",
3
- "version": "1.10.1",
3
+ "version": "1.11.0",
4
4
  "description": "Library to access SAP Fiori tools projects",
5
5
  "repository": {
6
6
  "type": "git",