@sap-ux/fe-fpm-writer 0.27.6 → 0.28.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.
|
@@ -56,7 +56,7 @@ function generateBuildingBlock(basePath, config, fs) {
|
|
|
56
56
|
if (!fs) {
|
|
57
57
|
fs = (0, mem_fs_editor_1.create)((0, mem_fs_1.create)());
|
|
58
58
|
}
|
|
59
|
-
(0, validate_1.validateBasePath)(basePath, fs, ['sap.fe.core']);
|
|
59
|
+
(0, validate_1.validateBasePath)(basePath, fs, ['sap.fe.templates', 'sap.fe.core']);
|
|
60
60
|
if (!fs.exists((0, path_1.join)(basePath, config.viewOrFragmentPath))) {
|
|
61
61
|
throw new Error(`Invalid view path ${config.viewOrFragmentPath}.`);
|
|
62
62
|
}
|
|
@@ -7,7 +7,7 @@ import type { Editor } from 'mem-fs-editor';
|
|
|
7
7
|
*/
|
|
8
8
|
export declare function validateVersion(ui5Version?: string): boolean;
|
|
9
9
|
/**
|
|
10
|
-
* Validates the provided base path.
|
|
10
|
+
* Validates the provided base path, checks at least one of expected dependencies is present.
|
|
11
11
|
*
|
|
12
12
|
* @param {string} basePath - the base path
|
|
13
13
|
* @param {Editor} fs - the memfs editor instance
|
package/dist/common/validate.js
CHANGED
|
@@ -20,7 +20,7 @@ function validateVersion(ui5Version) {
|
|
|
20
20
|
}
|
|
21
21
|
exports.validateVersion = validateVersion;
|
|
22
22
|
/**
|
|
23
|
-
* Validates the provided base path.
|
|
23
|
+
* Validates the provided base path, checks at least one of expected dependencies is present.
|
|
24
24
|
*
|
|
25
25
|
* @param {string} basePath - the base path
|
|
26
26
|
* @param {Editor} fs - the memfs editor instance
|
|
@@ -38,11 +38,19 @@ function validateBasePath(basePath, fs, dependencies = ['sap.fe.templates']) {
|
|
|
38
38
|
else {
|
|
39
39
|
const manifest = fs.readJSON(manifestPath);
|
|
40
40
|
const libs = manifest['sap.ui5']?.dependencies?.libs;
|
|
41
|
-
dependencies.
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
const valid = dependencies.length
|
|
42
|
+
? dependencies.some((dependency) => {
|
|
43
|
+
return libs?.[dependency] !== undefined;
|
|
44
|
+
})
|
|
45
|
+
: true;
|
|
46
|
+
if (!valid) {
|
|
47
|
+
if (dependencies.length === 1) {
|
|
48
|
+
throw new Error(`Dependency ${dependencies[0]} is missing in the manifest.json. Fiori elements FPM requires the SAP FE libraries.`);
|
|
44
49
|
}
|
|
45
|
-
|
|
50
|
+
else {
|
|
51
|
+
throw new Error(`All of the dependencies ${dependencies.join(', ')} are missing in the manifest.json. Fiori elements FPM requires the SAP FE libraries.`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
46
54
|
}
|
|
47
55
|
return true;
|
|
48
56
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-ux/fe-fpm-writer",
|
|
3
3
|
"description": "SAP Fiori elements flexible programming model writer",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.28.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/SAP/open-ux-tools.git",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"semver": "7.5.4",
|
|
32
32
|
"xml-formatter": "2.6.1",
|
|
33
33
|
"xpath": "0.0.33",
|
|
34
|
-
"@sap-ux/fiori-annotation-api": "0.1.
|
|
35
|
-
"@sap-ux/project-access": "1.26.
|
|
34
|
+
"@sap-ux/fiori-annotation-api": "0.1.38",
|
|
35
|
+
"@sap-ux/project-access": "1.26.9"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/inquirer": "8.2.6",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@types/mem-fs-editor": "7.0.1",
|
|
43
43
|
"@types/semver": "7.5.2",
|
|
44
44
|
"@types/vinyl": "2.0.7",
|
|
45
|
-
"@sap-ux/ui-prompting": "0.1.
|
|
45
|
+
"@sap-ux/ui-prompting": "0.1.5"
|
|
46
46
|
},
|
|
47
47
|
"engines": {
|
|
48
48
|
"node": ">=18.x"
|