@sap-ux/cap-config-writer 0.0.2 → 0.1.1
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/cap-config/index.js
CHANGED
|
@@ -9,11 +9,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.checkCdsUi5PluginEnabled = exports.enableCdsUi5Plugin = void 0;
|
|
12
|
+
exports.checkCdsUi5PluginEnabled = exports.enableCdsUi5Plugin = exports.satisfiesMinCdsVersion = void 0;
|
|
13
13
|
const path_1 = require("path");
|
|
14
14
|
const mem_fs_1 = require("mem-fs");
|
|
15
15
|
const mem_fs_editor_1 = require("mem-fs-editor");
|
|
16
16
|
const package_json_1 = require("./package-json");
|
|
17
|
+
var package_json_2 = require("./package-json");
|
|
18
|
+
Object.defineProperty(exports, "satisfiesMinCdsVersion", { enumerable: true, get: function () { return package_json_2.satisfiesMinCdsVersion; } });
|
|
17
19
|
/**
|
|
18
20
|
* Enable workspace and cds-plugin-ui5 for given CAP project.
|
|
19
21
|
*
|
|
@@ -19,12 +19,20 @@ export declare function enableWorkspaces(basePath: string, packageJson: Package)
|
|
|
19
19
|
*/
|
|
20
20
|
export declare function addCdsPluginUi5(packageJson: Package): void;
|
|
21
21
|
/**
|
|
22
|
-
* Check if the min version of @sap/cds
|
|
22
|
+
* Check if package.json has dependency to the minimum min version of @sap/cds,
|
|
23
|
+
* that is required to enable cds-plugin-ui.
|
|
23
24
|
*
|
|
24
25
|
* @param packageJson - the parsed package.json
|
|
25
26
|
* @returns - true: min cds version is present; false: cds version needs update
|
|
26
27
|
*/
|
|
27
28
|
export declare function hasMinCdsVersion(packageJson: Package): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Check if package.json has version or version range that satisfies the minimum version of @sap/cds.
|
|
31
|
+
*
|
|
32
|
+
* @param packageJson - the parsed package.json
|
|
33
|
+
* @returns - true: cds version satisfies the min cds version; false: cds version does not satisfy min cds version
|
|
34
|
+
*/
|
|
35
|
+
export declare function satisfiesMinCdsVersion(packageJson: Package): boolean;
|
|
28
36
|
/**
|
|
29
37
|
* Get information about the workspaces in the CAP project.
|
|
30
38
|
*
|
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.hasCdsPluginUi5 = exports.getWorkspaceInfo = exports.hasMinCdsVersion = exports.addCdsPluginUi5 = exports.enableWorkspaces = exports.ensureMinCdsVersion = void 0;
|
|
12
|
+
exports.hasCdsPluginUi5 = exports.getWorkspaceInfo = exports.satisfiesMinCdsVersion = exports.hasMinCdsVersion = exports.addCdsPluginUi5 = exports.enableWorkspaces = exports.ensureMinCdsVersion = void 0;
|
|
13
13
|
const semver_1 = require("semver");
|
|
14
14
|
const project_access_1 = require("@sap-ux/project-access");
|
|
15
15
|
const minCdsVersion = '6.8.2';
|
|
@@ -69,7 +69,8 @@ function addCdsPluginUi5(packageJson) {
|
|
|
69
69
|
}
|
|
70
70
|
exports.addCdsPluginUi5 = addCdsPluginUi5;
|
|
71
71
|
/**
|
|
72
|
-
* Check if the min version of @sap/cds
|
|
72
|
+
* Check if package.json has dependency to the minimum min version of @sap/cds,
|
|
73
|
+
* that is required to enable cds-plugin-ui.
|
|
73
74
|
*
|
|
74
75
|
* @param packageJson - the parsed package.json
|
|
75
76
|
* @returns - true: min cds version is present; false: cds version needs update
|
|
@@ -79,6 +80,17 @@ function hasMinCdsVersion(packageJson) {
|
|
|
79
80
|
return (0, semver_1.gte)((_b = (0, semver_1.coerce)((_a = packageJson.dependencies) === null || _a === void 0 ? void 0 : _a['@sap/cds'])) !== null && _b !== void 0 ? _b : '0.0.0', minCdsVersion);
|
|
80
81
|
}
|
|
81
82
|
exports.hasMinCdsVersion = hasMinCdsVersion;
|
|
83
|
+
/**
|
|
84
|
+
* Check if package.json has version or version range that satisfies the minimum version of @sap/cds.
|
|
85
|
+
*
|
|
86
|
+
* @param packageJson - the parsed package.json
|
|
87
|
+
* @returns - true: cds version satisfies the min cds version; false: cds version does not satisfy min cds version
|
|
88
|
+
*/
|
|
89
|
+
function satisfiesMinCdsVersion(packageJson) {
|
|
90
|
+
var _a, _b;
|
|
91
|
+
return hasMinCdsVersion(packageJson) || (0, semver_1.satisfies)(minCdsVersion, (_b = (_a = packageJson.dependencies) === null || _a === void 0 ? void 0 : _a['@sap/cds']) !== null && _b !== void 0 ? _b : '0.0.0');
|
|
92
|
+
}
|
|
93
|
+
exports.satisfiesMinCdsVersion = satisfiesMinCdsVersion;
|
|
82
94
|
/**
|
|
83
95
|
* Get information about the workspaces in the CAP project.
|
|
84
96
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { checkCdsUi5PluginEnabled, enableCdsUi5Plugin } from './cap-config';
|
|
1
|
+
export { checkCdsUi5PluginEnabled, enableCdsUi5Plugin, satisfiesMinCdsVersion } from './cap-config';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.enableCdsUi5Plugin = exports.checkCdsUi5PluginEnabled = void 0;
|
|
3
|
+
exports.satisfiesMinCdsVersion = exports.enableCdsUi5Plugin = exports.checkCdsUi5PluginEnabled = void 0;
|
|
4
4
|
var cap_config_1 = require("./cap-config");
|
|
5
5
|
Object.defineProperty(exports, "checkCdsUi5PluginEnabled", { enumerable: true, get: function () { return cap_config_1.checkCdsUi5PluginEnabled; } });
|
|
6
6
|
Object.defineProperty(exports, "enableCdsUi5Plugin", { enumerable: true, get: function () { return cap_config_1.enableCdsUi5Plugin; } });
|
|
7
|
+
Object.defineProperty(exports, "satisfiesMinCdsVersion", { enumerable: true, get: function () { return cap_config_1.satisfiesMinCdsVersion; } });
|
|
7
8
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED