@sap-ux/project-access 1.25.6 → 1.25.7
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/info.d.ts +5 -4
- package/dist/project/info.js +16 -10
- package/package.json +2 -2
package/dist/project/info.d.ts
CHANGED
|
@@ -37,15 +37,16 @@ export declare function getProjectType(projectRoot: string): Promise<ProjectType
|
|
|
37
37
|
*/
|
|
38
38
|
export declare function getMinUI5VersionFromManifest(manifest: Manifest): string | string[] | undefined;
|
|
39
39
|
/**
|
|
40
|
-
* Returns the minUI5Version as string[].
|
|
40
|
+
* Returns the valid minUI5Version(s) as string[].
|
|
41
41
|
*
|
|
42
42
|
* @param manifest - manifest object
|
|
43
|
+
* @param noValidation - disables the semver validation
|
|
43
44
|
* @returns minUI5Version, as an array of strings
|
|
44
45
|
*/
|
|
45
|
-
export declare function getMinUI5VersionAsArray(manifest: Manifest): string[];
|
|
46
|
+
export declare function getMinUI5VersionAsArray(manifest: Manifest, noValidation?: boolean): string[];
|
|
46
47
|
/**
|
|
47
|
-
* Returns the minUI5Version in string format.
|
|
48
|
-
* If it is defined as an
|
|
48
|
+
* Returns the minUI5Version in string format (if valid).
|
|
49
|
+
* If it is defined as an array, returns the minimum valid version from it.
|
|
49
50
|
*
|
|
50
51
|
* @param manifest - manifest object
|
|
51
52
|
* @returns the minimum version as string
|
package/dist/project/info.js
CHANGED
|
@@ -210,33 +210,39 @@ function getMinUI5VersionFromManifest(manifest) {
|
|
|
210
210
|
}
|
|
211
211
|
exports.getMinUI5VersionFromManifest = getMinUI5VersionFromManifest;
|
|
212
212
|
/**
|
|
213
|
-
* Returns the minUI5Version as string[].
|
|
213
|
+
* Returns the valid minUI5Version(s) as string[].
|
|
214
214
|
*
|
|
215
215
|
* @param manifest - manifest object
|
|
216
|
+
* @param noValidation - disables the semver validation
|
|
216
217
|
* @returns minUI5Version, as an array of strings
|
|
217
218
|
*/
|
|
218
|
-
function getMinUI5VersionAsArray(manifest) {
|
|
219
|
-
|
|
219
|
+
function getMinUI5VersionAsArray(manifest, noValidation = false) {
|
|
220
|
+
const result = [];
|
|
220
221
|
const minUI5Version = getMinUI5VersionFromManifest(manifest);
|
|
221
222
|
if (minUI5Version) {
|
|
222
|
-
|
|
223
|
+
const minUI5VersionArray = Array.isArray(minUI5Version) ? minUI5Version : [minUI5Version];
|
|
224
|
+
minUI5VersionArray.forEach((version) => {
|
|
225
|
+
if (noValidation || (0, semver_1.valid)(version)) {
|
|
226
|
+
result.push(version);
|
|
227
|
+
}
|
|
228
|
+
});
|
|
223
229
|
}
|
|
224
230
|
return result;
|
|
225
231
|
}
|
|
226
232
|
exports.getMinUI5VersionAsArray = getMinUI5VersionAsArray;
|
|
227
233
|
/**
|
|
228
|
-
* Returns the minUI5Version in string format.
|
|
229
|
-
* If it is defined as an
|
|
234
|
+
* Returns the minUI5Version in string format (if valid).
|
|
235
|
+
* If it is defined as an array, returns the minimum valid version from it.
|
|
230
236
|
*
|
|
231
237
|
* @param manifest - manifest object
|
|
232
238
|
* @returns the minimum version as string
|
|
233
239
|
*/
|
|
234
240
|
function getMinimumUI5Version(manifest) {
|
|
235
241
|
let result;
|
|
236
|
-
const
|
|
237
|
-
if (
|
|
238
|
-
|
|
239
|
-
if (
|
|
242
|
+
const validVersionsArray = getMinUI5VersionAsArray(manifest);
|
|
243
|
+
if (validVersionsArray.length > 0) {
|
|
244
|
+
validVersionsArray.forEach((version) => {
|
|
245
|
+
if (!result || (0, semver_1.gte)(result, version)) {
|
|
240
246
|
result = version;
|
|
241
247
|
}
|
|
242
248
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-ux/project-access",
|
|
3
|
-
"version": "1.25.
|
|
3
|
+
"version": "1.25.7",
|
|
4
4
|
"description": "Library to access SAP Fiori tools projects",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@types/mem-fs": "1.1.2",
|
|
37
37
|
"@types/mem-fs-editor": "7.0.1",
|
|
38
38
|
"@types/semver": "7.5.2",
|
|
39
|
-
"@ui5/manifest": "1.
|
|
39
|
+
"@ui5/manifest": "1.66.0",
|
|
40
40
|
"vscode-uri": "3.0.7",
|
|
41
41
|
"@sap-ux/logger": "0.6.0"
|
|
42
42
|
},
|