@sap-ux/project-access 1.29.17 → 1.29.18

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.
@@ -57,4 +57,5 @@ export declare const fioriToolsDirectory: string;
57
57
  * Directory where modules are cached
58
58
  */
59
59
  export declare const moduleCacheRoot: string;
60
+ export declare const MinCdsVersionUi5Plugin = "6.8.2";
60
61
  //# sourceMappingURL=constants.d.ts.map
package/dist/constants.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.moduleCacheRoot = exports.fioriToolsDirectory = exports.SchemaName = exports.FioriToolsSettings = exports.DirName = exports.FileName = void 0;
3
+ exports.MinCdsVersionUi5Plugin = exports.moduleCacheRoot = exports.fioriToolsDirectory = exports.SchemaName = exports.FioriToolsSettings = exports.DirName = exports.FileName = void 0;
4
4
  const os_1 = require("os");
5
5
  const path_1 = require("path");
6
6
  exports.FileName = {
@@ -62,4 +62,5 @@ exports.fioriToolsDirectory = (0, path_1.join)((0, os_1.homedir)(), exports.Fior
62
62
  * Directory where modules are cached
63
63
  */
64
64
  exports.moduleCacheRoot = (0, path_1.join)(exports.fioriToolsDirectory, exports.DirName.ModuleCache);
65
+ exports.MinCdsVersionUi5Plugin = '6.8.2';
65
66
  //# sourceMappingURL=constants.js.map
@@ -19,6 +19,14 @@ const fs_1 = require("fs");
19
19
  * @param fileNames - array of file names to search for
20
20
  * @param extensionNames - array of extensions names to search for
21
21
  * @param root - path to root folder
22
+ * @example
23
+ * // returns { deleted: ['src/test.css'], modified: ['src/app.js'] }
24
+ * const changes = {
25
+ * 'src/app.js': { state: 'modified' },
26
+ * 'src/test.css': { state: 'deleted' },
27
+ * 'src/index.ts': { state: 'modified' }
28
+ * };
29
+ * getMemFsChanges(changes, ['app.js'], ['.css'], 'src');
22
30
  * @returns - array of deleted and modified files filtered by query
23
31
  */
24
32
  function getMemFsChanges(changes, fileNames, extensionNames, root) {
package/dist/index.d.ts CHANGED
@@ -1,7 +1,8 @@
1
- export { FileName, DirName, FioriToolsSettings } from './constants';
1
+ export { FileName, DirName, FioriToolsSettings, MinCdsVersionUi5Plugin } from './constants';
2
2
  export { getFilePaths } from './file';
3
- export { addPackageDevDependency, clearCdsModuleCache, createApplicationAccess, createProjectAccess, deleteCapApp, filterDataSourcesByType, findAllApps, findCapProjectRoot, findCapProjects, findFioriArtifacts, findProjectRoot, findRootsForPath, getAllUi5YamlFileNames, getAppRootFromWebappPath, getAppProgrammingLanguage, getAppType, getCapCustomPaths, getCapEnvironment, getCapModelAndServices, getCapServiceName, getCapProjectType, getCdsFiles, getCdsRoots, getCdsServices, getCapI18nFolderNames, getSpecification, getSpecificationPath, getI18nPropertiesPaths, getI18nBundles, getMinUI5VersionFromManifest, getMinUI5VersionAsArray, getMinimumUI5Version, getMtaPath, getNodeModulesPath, getProject, getProjectType, getWebappPath, hasUI5CliV3, isCapProject, isCapJavaProject, isCapNodeJsProject, loadModuleFromProject, readCapServiceMetadataEdmx, readUi5Yaml, refreshSpecificationDistTags, toReferenceUri, updatePackageScript } from './project';
3
+ export { addPackageDevDependency, clearCdsModuleCache, createApplicationAccess, createProjectAccess, deleteCapApp, filterDataSourcesByType, findAllApps, findCapProjectRoot, findCapProjects, findFioriArtifacts, findProjectRoot, findRootsForPath, getAllUi5YamlFileNames, getAppRootFromWebappPath, getAppProgrammingLanguage, getAppType, getCapCustomPaths, getCapEnvironment, getCapModelAndServices, getCapServiceName, getCapProjectType, getCdsFiles, getCdsRoots, getCdsServices, getCapI18nFolderNames, getSpecification, getSpecificationPath, getI18nPropertiesPaths, getI18nBundles, getMinUI5VersionFromManifest, getMinUI5VersionAsArray, getMinimumUI5Version, getMtaPath, getNodeModulesPath, getProject, getProjectType, getWebappPath, hasUI5CliV3, isCapProject, isCapJavaProject, isCapNodeJsProject, loadModuleFromProject, readCapServiceMetadataEdmx, readUi5Yaml, refreshSpecificationDistTags, toReferenceUri, updatePackageScript, getWorkspaceInfo, hasMinCdsVersion, checkCdsUi5PluginEnabled } from './project';
4
4
  export { execNpmCommand } from './command/npm-command';
5
5
  export * from './types';
6
6
  export * from './library';
7
+ export { hasDependency } from './project';
7
8
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -14,12 +14,13 @@ 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.toReferenceUri = exports.refreshSpecificationDistTags = exports.readUi5Yaml = exports.readCapServiceMetadataEdmx = exports.loadModuleFromProject = exports.isCapNodeJsProject = exports.isCapJavaProject = exports.isCapProject = exports.hasUI5CliV3 = exports.getWebappPath = exports.getProjectType = exports.getProject = exports.getNodeModulesPath = exports.getMtaPath = exports.getMinimumUI5Version = exports.getMinUI5VersionAsArray = exports.getMinUI5VersionFromManifest = exports.getI18nBundles = exports.getI18nPropertiesPaths = exports.getSpecificationPath = exports.getSpecification = exports.getCapI18nFolderNames = exports.getCdsServices = exports.getCdsRoots = exports.getCdsFiles = exports.getCapProjectType = exports.getCapServiceName = exports.getCapModelAndServices = exports.getCapEnvironment = exports.getCapCustomPaths = exports.getAppType = exports.getAppProgrammingLanguage = exports.getAppRootFromWebappPath = exports.getAllUi5YamlFileNames = exports.findRootsForPath = exports.findProjectRoot = exports.findFioriArtifacts = exports.findCapProjects = exports.findCapProjectRoot = exports.findAllApps = exports.filterDataSourcesByType = exports.deleteCapApp = exports.createProjectAccess = exports.createApplicationAccess = exports.clearCdsModuleCache = exports.addPackageDevDependency = exports.getFilePaths = exports.FioriToolsSettings = exports.DirName = exports.FileName = void 0;
18
- exports.execNpmCommand = exports.updatePackageScript = void 0;
17
+ exports.refreshSpecificationDistTags = exports.readUi5Yaml = exports.readCapServiceMetadataEdmx = exports.loadModuleFromProject = exports.isCapNodeJsProject = exports.isCapJavaProject = exports.isCapProject = exports.hasUI5CliV3 = exports.getWebappPath = exports.getProjectType = exports.getProject = exports.getNodeModulesPath = exports.getMtaPath = exports.getMinimumUI5Version = exports.getMinUI5VersionAsArray = exports.getMinUI5VersionFromManifest = exports.getI18nBundles = exports.getI18nPropertiesPaths = exports.getSpecificationPath = exports.getSpecification = exports.getCapI18nFolderNames = exports.getCdsServices = exports.getCdsRoots = exports.getCdsFiles = exports.getCapProjectType = exports.getCapServiceName = exports.getCapModelAndServices = exports.getCapEnvironment = exports.getCapCustomPaths = exports.getAppType = exports.getAppProgrammingLanguage = exports.getAppRootFromWebappPath = exports.getAllUi5YamlFileNames = exports.findRootsForPath = exports.findProjectRoot = exports.findFioriArtifacts = exports.findCapProjects = exports.findCapProjectRoot = exports.findAllApps = exports.filterDataSourcesByType = exports.deleteCapApp = exports.createProjectAccess = exports.createApplicationAccess = exports.clearCdsModuleCache = exports.addPackageDevDependency = exports.getFilePaths = exports.MinCdsVersionUi5Plugin = exports.FioriToolsSettings = exports.DirName = exports.FileName = void 0;
18
+ exports.hasDependency = exports.execNpmCommand = exports.checkCdsUi5PluginEnabled = exports.hasMinCdsVersion = exports.getWorkspaceInfo = exports.updatePackageScript = exports.toReferenceUri = void 0;
19
19
  var constants_1 = require("./constants");
20
20
  Object.defineProperty(exports, "FileName", { enumerable: true, get: function () { return constants_1.FileName; } });
21
21
  Object.defineProperty(exports, "DirName", { enumerable: true, get: function () { return constants_1.DirName; } });
22
22
  Object.defineProperty(exports, "FioriToolsSettings", { enumerable: true, get: function () { return constants_1.FioriToolsSettings; } });
23
+ Object.defineProperty(exports, "MinCdsVersionUi5Plugin", { enumerable: true, get: function () { return constants_1.MinCdsVersionUi5Plugin; } });
23
24
  var file_1 = require("./file");
24
25
  Object.defineProperty(exports, "getFilePaths", { enumerable: true, get: function () { return file_1.getFilePaths; } });
25
26
  var project_1 = require("./project");
@@ -70,8 +71,13 @@ Object.defineProperty(exports, "readUi5Yaml", { enumerable: true, get: function
70
71
  Object.defineProperty(exports, "refreshSpecificationDistTags", { enumerable: true, get: function () { return project_1.refreshSpecificationDistTags; } });
71
72
  Object.defineProperty(exports, "toReferenceUri", { enumerable: true, get: function () { return project_1.toReferenceUri; } });
72
73
  Object.defineProperty(exports, "updatePackageScript", { enumerable: true, get: function () { return project_1.updatePackageScript; } });
74
+ Object.defineProperty(exports, "getWorkspaceInfo", { enumerable: true, get: function () { return project_1.getWorkspaceInfo; } });
75
+ Object.defineProperty(exports, "hasMinCdsVersion", { enumerable: true, get: function () { return project_1.hasMinCdsVersion; } });
76
+ Object.defineProperty(exports, "checkCdsUi5PluginEnabled", { enumerable: true, get: function () { return project_1.checkCdsUi5PluginEnabled; } });
73
77
  var npm_command_1 = require("./command/npm-command");
74
78
  Object.defineProperty(exports, "execNpmCommand", { enumerable: true, get: function () { return npm_command_1.execNpmCommand; } });
75
79
  __exportStar(require("./types"), exports);
76
80
  __exportStar(require("./library"), exports);
81
+ var project_2 = require("./project");
82
+ Object.defineProperty(exports, "hasDependency", { enumerable: true, get: function () { return project_2.hasDependency; } });
77
83
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
1
  import type { Logger } from '@sap-ux/logger';
2
2
  import type { Editor } from 'mem-fs-editor';
3
- import type { CapCustomPaths, CapProjectType, CdsEnvironment, csn, Package, ServiceDefinitions, ServiceInfo, CdsVersionInfo } from '../types';
3
+ import type { CapCustomPaths, CapProjectType, CdsEnvironment, csn, Package, ServiceDefinitions, ServiceInfo, CdsVersionInfo, CdsUi5PluginInfo } from '../types';
4
4
  /**
5
5
  * Returns true if the project is a CAP Node.js project.
6
6
  *
@@ -139,4 +139,59 @@ export declare function getCapServiceName(projectRoot: string, datasourceUri: st
139
139
  * @param [logger] - function to log messages (optional)
140
140
  */
141
141
  export declare function deleteCapApp(appPath: string, memFs?: Editor, logger?: Logger): Promise<void>;
142
+ /**
143
+ * Check if cds-plugin-ui5 is enabled on a CAP project. Checks also all prerequisites, like minimum @sap/cds version.
144
+ * Overloaded function that returns detailed CAP plugin info.
145
+ *
146
+ * @param basePath - root path of the CAP project, where package.json is located
147
+ * @param [fs] - optional: the memfs editor instance
148
+ * @returns true: cds-plugin-ui5 and all prerequisites are fulfilled; false: cds-plugin-ui5 is not enabled or not all prerequisites are fulfilled
149
+ */
150
+ export declare function checkCdsUi5PluginEnabled(basePath: string, fs?: Editor): Promise<boolean>;
151
+ /**
152
+ * Check if cds-plugin-ui5 is enabled on a CAP project. Checks also all prerequisites, like minimum @sap/cds version.
153
+ *
154
+ * @param basePath - root path of the CAP project, where package.json is located
155
+ * @param [fs] - optional: the memfs editor instance
156
+ * @param [moreInfo] if true return an object specifying detailed info about the cds and workspace state
157
+ * @returns false if package.json is not found at specified path or {@link CdsUi5PluginInfo} with additional info
158
+ */
159
+ export declare function checkCdsUi5PluginEnabled(basePath: string, fs?: Editor, moreInfo?: boolean): Promise<boolean | CdsUi5PluginInfo>;
160
+ /**
161
+ * Check if cds-plugin-ui5 is enabled on a CAP project. Checks also all prerequisites, like minimum @sap/cds version.
162
+ *
163
+ * @param basePath - root path of the CAP project, where package.json is located
164
+ * @param [fs] - optional: the memfs editor instance
165
+ * @param [moreInfo] if true return an object specifying detailed info about the cds and workspace state
166
+ * @param {CdsVersionInfo} [cdsVersionInfo] - If provided will be used instead of parsing the package.json file to determine the cds version.
167
+ * @returns false if package.json is not found at specified path or {@link CdsUi5PluginInfo} with additional info
168
+ */
169
+ export declare function checkCdsUi5PluginEnabled(basePath: string, fs?: Editor, moreInfo?: boolean, cdsVersionInfo?: CdsVersionInfo): Promise<boolean | CdsUi5PluginInfo>;
170
+ /**
171
+ * Get information about the workspaces in the CAP project.
172
+ *
173
+ * @param basePath - root path of the CAP project, where package.json is located
174
+ * @param packageJson - the parsed package.json
175
+ * @returns - appWorkspace containing the path to the appWorkspace including wildcard; workspaceEnabled: boolean that states whether workspace for apps are enabled
176
+ */
177
+ export declare function getWorkspaceInfo(basePath: string, packageJson: Package): Promise<{
178
+ appWorkspace: string;
179
+ workspaceEnabled: boolean;
180
+ workspacePackages: string[];
181
+ }>;
182
+ /**
183
+ * Check if package.json has version or version range that satisfies the minimum version of @sap/cds.
184
+ *
185
+ * @param packageJson - the parsed package.json
186
+ * @returns - true: cds version satisfies the min cds version; false: cds version does not satisfy min cds version
187
+ */
188
+ export declare function satisfiesMinCdsVersion(packageJson: Package): boolean;
189
+ /**
190
+ * Check if package.json has dependency to the minimum min version of @sap/cds,
191
+ * that is required to enable cds-plugin-ui.
192
+ *
193
+ * @param packageJson - the parsed package.json
194
+ * @returns - true: min cds version is present; false: cds version needs update
195
+ */
196
+ export declare function hasMinCdsVersion(packageJson: Package): boolean;
142
197
  //# sourceMappingURL=cap.d.ts.map
@@ -16,12 +16,20 @@ exports.clearCdsModuleCache = clearCdsModuleCache;
16
16
  exports.clearGlobalCdsModulePromiseCache = clearGlobalCdsModulePromiseCache;
17
17
  exports.getCapServiceName = getCapServiceName;
18
18
  exports.deleteCapApp = deleteCapApp;
19
+ exports.checkCdsUi5PluginEnabled = checkCdsUi5PluginEnabled;
20
+ exports.getWorkspaceInfo = getWorkspaceInfo;
21
+ exports.satisfiesMinCdsVersion = satisfiesMinCdsVersion;
22
+ exports.hasMinCdsVersion = hasMinCdsVersion;
19
23
  const child_process_1 = require("child_process");
20
24
  const path_1 = require("path");
21
25
  const constants_1 = require("../constants");
22
26
  const file_1 = require("../file");
23
27
  const module_loader_1 = require("./module-loader");
24
28
  const search_1 = require("./search");
29
+ const semver_1 = require("semver");
30
+ const mem_fs_1 = require("mem-fs");
31
+ const mem_fs_editor_1 = require("mem-fs-editor");
32
+ const dependencies_1 = require("./dependencies");
25
33
  /**
26
34
  * Returns true if the project is a CAP Node.js project.
27
35
  *
@@ -716,4 +724,91 @@ async function deleteCapApp(appPath, memFs, logger) {
716
724
  await (0, file_1.deleteDirectory)((0, path_1.dirname)(appPath), memFs);
717
725
  }
718
726
  }
727
+ /**
728
+ * Implementation of the overloaded function.
729
+ * Check if cds-plugin-ui5 is enabled on a CAP project. Checks also all prerequisites, like minimum @sap/cds version.
730
+ *
731
+ * @param basePath - root path of the CAP project, where package.json is located
732
+ * @param [fs] - optional: the memfs editor instance
733
+ * @param [moreInfo] if true return an object specifying detailed info about the cds and workspace state
734
+ * @param {CdsVersionInfo} [cdsVersionInfo] - If provided will be used instead of parsing the package.json file to determine the cds version.
735
+ * @returns false if package.json is not found at specified path or {@link CdsUi5PluginInfo} with additional info or true if
736
+ * cds-plugin-ui5 and all prerequisites are fulfilled
737
+ */
738
+ async function checkCdsUi5PluginEnabled(basePath, fs, moreInfo, cdsVersionInfo) {
739
+ if (!fs) {
740
+ fs = (0, mem_fs_editor_1.create)((0, mem_fs_1.create)());
741
+ }
742
+ const packageJsonPath = (0, path_1.join)(basePath, 'package.json');
743
+ if (!fs.exists(packageJsonPath)) {
744
+ return false;
745
+ }
746
+ const packageJson = fs.readJSON(packageJsonPath);
747
+ const { workspaceEnabled } = await getWorkspaceInfo(basePath, packageJson);
748
+ const cdsInfo = {
749
+ // Below line checks if 'cdsVersionInfo' is available and contains version information.
750
+ // If it does, it uses that version information to determine if it satisfies the minimum CDS version required.
751
+ // If 'cdsVersionInfo' is not available or does not contain version information,it falls back to check the version specified in the package.json file.
752
+ hasMinCdsVersion: cdsVersionInfo?.version
753
+ ? (0, semver_1.satisfies)(cdsVersionInfo?.version, `>=${constants_1.MinCdsVersionUi5Plugin}`)
754
+ : satisfiesMinCdsVersion(packageJson),
755
+ isWorkspaceEnabled: workspaceEnabled,
756
+ hasCdsUi5Plugin: (0, dependencies_1.hasDependency)(packageJson, 'cds-plugin-ui5'),
757
+ isCdsUi5PluginEnabled: false
758
+ };
759
+ cdsInfo.isCdsUi5PluginEnabled = cdsInfo.hasMinCdsVersion && cdsInfo.isWorkspaceEnabled && cdsInfo.hasCdsUi5Plugin;
760
+ return moreInfo ? cdsInfo : cdsInfo.isCdsUi5PluginEnabled;
761
+ }
762
+ /**
763
+ * Get information about the workspaces in the CAP project.
764
+ *
765
+ * @param basePath - root path of the CAP project, where package.json is located
766
+ * @param packageJson - the parsed package.json
767
+ * @returns - appWorkspace containing the path to the appWorkspace including wildcard; workspaceEnabled: boolean that states whether workspace for apps are enabled
768
+ */
769
+ async function getWorkspaceInfo(basePath, packageJson) {
770
+ const capPaths = await getCapCustomPaths(basePath);
771
+ const appWorkspace = capPaths.app.endsWith('/') ? `${capPaths.app}*` : `${capPaths.app}/*`;
772
+ const workspacePackages = getWorkspacePackages(packageJson) ?? [];
773
+ const workspaceEnabled = workspacePackages.includes(appWorkspace);
774
+ return { appWorkspace, workspaceEnabled, workspacePackages };
775
+ }
776
+ /**
777
+ * Return the reference to the array of workspace packages or undefined if not defined.
778
+ * The workspace packages can either be defined directly as workspaces in package.json
779
+ * or in workspaces.packages, e.g. in yarn workspaces.
780
+ *
781
+ * @param packageJson - the parsed package.json
782
+ * @returns ref to the packages in workspaces or undefined
783
+ */
784
+ function getWorkspacePackages(packageJson) {
785
+ let workspacePackages;
786
+ if (Array.isArray(packageJson.workspaces)) {
787
+ workspacePackages = packageJson.workspaces;
788
+ }
789
+ else if (Array.isArray(packageJson.workspaces?.packages)) {
790
+ workspacePackages = packageJson.workspaces?.packages;
791
+ }
792
+ return workspacePackages;
793
+ }
794
+ /**
795
+ * Check if package.json has version or version range that satisfies the minimum version of @sap/cds.
796
+ *
797
+ * @param packageJson - the parsed package.json
798
+ * @returns - true: cds version satisfies the min cds version; false: cds version does not satisfy min cds version
799
+ */
800
+ function satisfiesMinCdsVersion(packageJson) {
801
+ return (hasMinCdsVersion(packageJson) ||
802
+ (0, semver_1.satisfies)(constants_1.MinCdsVersionUi5Plugin, packageJson.dependencies?.['@sap/cds'] ?? '0.0.0'));
803
+ }
804
+ /**
805
+ * Check if package.json has dependency to the minimum min version of @sap/cds,
806
+ * that is required to enable cds-plugin-ui.
807
+ *
808
+ * @param packageJson - the parsed package.json
809
+ * @returns - true: min cds version is present; false: cds version needs update
810
+ */
811
+ function hasMinCdsVersion(packageJson) {
812
+ return (0, semver_1.gte)((0, semver_1.coerce)(packageJson.dependencies?.['@sap/cds']) ?? '0.0.0', constants_1.MinCdsVersionUi5Plugin);
813
+ }
719
814
  //# sourceMappingURL=cap.js.map
@@ -1,6 +1,6 @@
1
- export { clearCdsModuleCache, deleteCapApp, getCapCustomPaths, getCapEnvironment, getCapModelAndServices, getCapProjectType, getCapServiceName, getCdsFiles, getCdsRoots, getCdsServices, isCapProject, isCapJavaProject, isCapNodeJsProject, readCapServiceMetadataEdmx, toReferenceUri } from './cap';
1
+ export { clearCdsModuleCache, deleteCapApp, getCapCustomPaths, getCapEnvironment, getCapModelAndServices, getCapProjectType, getCapServiceName, getCdsFiles, getCdsRoots, getCdsServices, isCapProject, isCapJavaProject, isCapNodeJsProject, readCapServiceMetadataEdmx, toReferenceUri, getWorkspaceInfo, hasMinCdsVersion, checkCdsUi5PluginEnabled } from './cap';
2
2
  export { filterDataSourcesByType } from './service';
3
- export { addPackageDevDependency, getNodeModulesPath } from './dependencies';
3
+ export { addPackageDevDependency, getNodeModulesPath, hasDependency } from './dependencies';
4
4
  export { getCapI18nFolderNames, getI18nPropertiesPaths, getI18nBundles } from './i18n';
5
5
  export { getAppProgrammingLanguage, getAppType, getMinUI5VersionFromManifest, getMinUI5VersionAsArray, getMinimumUI5Version, getProject, getProjectType } from './info';
6
6
  export { loadModuleFromProject } from './module-loader';
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.refreshSpecificationDistTags = exports.getSpecificationPath = exports.getSpecification = exports.hasUI5CliV3 = exports.updatePackageScript = exports.createProjectAccess = exports.createApplicationAccess = exports.getMtaPath = exports.getAllUi5YamlFileNames = exports.readUi5Yaml = exports.getWebappPath = exports.findRootsForPath = exports.findCapProjectRoot = exports.getAppRootFromWebappPath = exports.findProjectRoot = exports.findFioriArtifacts = exports.findCapProjects = exports.findAllApps = exports.loadModuleFromProject = exports.getProjectType = exports.getProject = exports.getMinimumUI5Version = exports.getMinUI5VersionAsArray = exports.getMinUI5VersionFromManifest = exports.getAppType = exports.getAppProgrammingLanguage = exports.getI18nBundles = exports.getI18nPropertiesPaths = exports.getCapI18nFolderNames = exports.getNodeModulesPath = exports.addPackageDevDependency = exports.filterDataSourcesByType = exports.toReferenceUri = exports.readCapServiceMetadataEdmx = exports.isCapNodeJsProject = exports.isCapJavaProject = exports.isCapProject = exports.getCdsServices = exports.getCdsRoots = exports.getCdsFiles = exports.getCapServiceName = exports.getCapProjectType = exports.getCapModelAndServices = exports.getCapEnvironment = exports.getCapCustomPaths = exports.deleteCapApp = exports.clearCdsModuleCache = void 0;
3
+ exports.getSpecificationPath = exports.getSpecification = exports.hasUI5CliV3 = exports.updatePackageScript = exports.createProjectAccess = exports.createApplicationAccess = exports.getMtaPath = exports.getAllUi5YamlFileNames = exports.readUi5Yaml = exports.getWebappPath = exports.findRootsForPath = exports.findCapProjectRoot = exports.getAppRootFromWebappPath = exports.findProjectRoot = exports.findFioriArtifacts = exports.findCapProjects = exports.findAllApps = exports.loadModuleFromProject = exports.getProjectType = exports.getProject = exports.getMinimumUI5Version = exports.getMinUI5VersionAsArray = exports.getMinUI5VersionFromManifest = exports.getAppType = exports.getAppProgrammingLanguage = exports.getI18nBundles = exports.getI18nPropertiesPaths = exports.getCapI18nFolderNames = exports.hasDependency = exports.getNodeModulesPath = exports.addPackageDevDependency = exports.filterDataSourcesByType = exports.checkCdsUi5PluginEnabled = exports.hasMinCdsVersion = exports.getWorkspaceInfo = exports.toReferenceUri = exports.readCapServiceMetadataEdmx = exports.isCapNodeJsProject = exports.isCapJavaProject = exports.isCapProject = exports.getCdsServices = exports.getCdsRoots = exports.getCdsFiles = exports.getCapServiceName = exports.getCapProjectType = exports.getCapModelAndServices = exports.getCapEnvironment = exports.getCapCustomPaths = exports.deleteCapApp = exports.clearCdsModuleCache = void 0;
4
+ exports.refreshSpecificationDistTags = void 0;
4
5
  var cap_1 = require("./cap");
5
6
  Object.defineProperty(exports, "clearCdsModuleCache", { enumerable: true, get: function () { return cap_1.clearCdsModuleCache; } });
6
7
  Object.defineProperty(exports, "deleteCapApp", { enumerable: true, get: function () { return cap_1.deleteCapApp; } });
@@ -17,11 +18,15 @@ Object.defineProperty(exports, "isCapJavaProject", { enumerable: true, get: func
17
18
  Object.defineProperty(exports, "isCapNodeJsProject", { enumerable: true, get: function () { return cap_1.isCapNodeJsProject; } });
18
19
  Object.defineProperty(exports, "readCapServiceMetadataEdmx", { enumerable: true, get: function () { return cap_1.readCapServiceMetadataEdmx; } });
19
20
  Object.defineProperty(exports, "toReferenceUri", { enumerable: true, get: function () { return cap_1.toReferenceUri; } });
21
+ Object.defineProperty(exports, "getWorkspaceInfo", { enumerable: true, get: function () { return cap_1.getWorkspaceInfo; } });
22
+ Object.defineProperty(exports, "hasMinCdsVersion", { enumerable: true, get: function () { return cap_1.hasMinCdsVersion; } });
23
+ Object.defineProperty(exports, "checkCdsUi5PluginEnabled", { enumerable: true, get: function () { return cap_1.checkCdsUi5PluginEnabled; } });
20
24
  var service_1 = require("./service");
21
25
  Object.defineProperty(exports, "filterDataSourcesByType", { enumerable: true, get: function () { return service_1.filterDataSourcesByType; } });
22
26
  var dependencies_1 = require("./dependencies");
23
27
  Object.defineProperty(exports, "addPackageDevDependency", { enumerable: true, get: function () { return dependencies_1.addPackageDevDependency; } });
24
28
  Object.defineProperty(exports, "getNodeModulesPath", { enumerable: true, get: function () { return dependencies_1.getNodeModulesPath; } });
29
+ Object.defineProperty(exports, "hasDependency", { enumerable: true, get: function () { return dependencies_1.hasDependency; } });
25
30
  var i18n_1 = require("./i18n");
26
31
  Object.defineProperty(exports, "getCapI18nFolderNames", { enumerable: true, get: function () { return i18n_1.getCapI18nFolderNames; } });
27
32
  Object.defineProperty(exports, "getI18nPropertiesPaths", { enumerable: true, get: function () { return i18n_1.getI18nPropertiesPaths; } });
@@ -242,5 +242,23 @@ export interface CdsVersionInfo {
242
242
  version: string;
243
243
  root: string;
244
244
  }
245
+ export type CdsUi5PluginInfo = {
246
+ /**
247
+ * Convenience property. The CDS UI5 plugin is considered enabled if `hasCdsUi5Plugin`, `hasMinCdsVersion`, `isWorkspaceEnabled` are all true.
248
+ */
249
+ isCdsUi5PluginEnabled: boolean;
250
+ /**
251
+ * True if the CDS version satisfies the minimum supported CDS version
252
+ */
253
+ hasMinCdsVersion: boolean;
254
+ /**
255
+ * True if NPM workspaces are enabled at the root of a CAP project
256
+ */
257
+ isWorkspaceEnabled: boolean;
258
+ /**
259
+ * True if the CDS ui5 plugin is specified as a dependency
260
+ */
261
+ hasCdsUi5Plugin: boolean;
262
+ };
245
263
  export {};
246
264
  //# sourceMappingURL=index.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sap-ux/project-access",
3
- "version": "1.29.17",
3
+ "version": "1.29.18",
4
4
  "description": "Library to access SAP Fiori tools projects",
5
5
  "repository": {
6
6
  "type": "git",