@sap-ux/preview-middleware 0.16.24 → 0.16.25
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/client/flp/init.js +13 -1
- package/dist/client/flp/init.ts +24 -2
- package/package.json +3 -3
package/dist/client/flp/init.js
CHANGED
|
@@ -42,6 +42,18 @@ sap.ui.define([
|
|
|
42
42
|
}
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
|
+
function getComponentUsageNames(compUsages, customLibs) {
|
|
46
|
+
const compNames = Object.keys(compUsages).map(function (compUsageKey) {
|
|
47
|
+
return compUsages[compUsageKey].name;
|
|
48
|
+
});
|
|
49
|
+
compNames.forEach(function (key) {
|
|
50
|
+
if (!UI5_LIBS.some(function (substring) {
|
|
51
|
+
return key === substring || key.startsWith(substring + '.');
|
|
52
|
+
})) {
|
|
53
|
+
customLibs[key] = true;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
45
57
|
async function getManifestLibs(appUrls) {
|
|
46
58
|
const result = {};
|
|
47
59
|
const promises = [];
|
|
@@ -58,7 +70,7 @@ sap.ui.define([
|
|
|
58
70
|
}
|
|
59
71
|
}
|
|
60
72
|
if (manifest['sap.ui5']?.componentUsages) {
|
|
61
|
-
|
|
73
|
+
getComponentUsageNames(manifest['sap.ui5'].componentUsages, result);
|
|
62
74
|
}
|
|
63
75
|
}
|
|
64
76
|
}));
|
package/dist/client/flp/init.ts
CHANGED
|
@@ -42,7 +42,7 @@ interface Manifest {
|
|
|
42
42
|
libs: Record<string, unknown>;
|
|
43
43
|
components: Record<string, unknown>;
|
|
44
44
|
};
|
|
45
|
-
componentUsages?: Record<string,
|
|
45
|
+
componentUsages?: Record<string, { name: string }>;
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
48
|
|
|
@@ -76,6 +76,28 @@ function addKeys(dependency: Record<string, unknown>, customLibs: Record<string,
|
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
+
/**
|
|
80
|
+
* Check whether a specific ComponentUsage is a custom component, and if yes, add it to the map.
|
|
81
|
+
*
|
|
82
|
+
* @param compUsages ComponentUsage from the manifest
|
|
83
|
+
* @param customLibs map containing the required custom libraries
|
|
84
|
+
*/
|
|
85
|
+
function getComponentUsageNames(compUsages: Record<string, { name: string }>, customLibs: Record<string, true>): void {
|
|
86
|
+
const compNames = Object.keys(compUsages).map(function (compUsageKey: string) {
|
|
87
|
+
return compUsages[compUsageKey].name;
|
|
88
|
+
});
|
|
89
|
+
compNames.forEach(function (key) {
|
|
90
|
+
// ignore libs or Components that start with SAPUI5 delivered namespaces
|
|
91
|
+
if (
|
|
92
|
+
!UI5_LIBS.some(function (substring) {
|
|
93
|
+
return key === substring || key.startsWith(substring + '.');
|
|
94
|
+
})
|
|
95
|
+
) {
|
|
96
|
+
customLibs[key] = true;
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
|
|
79
101
|
/**
|
|
80
102
|
* Fetch the manifest for all the given application urls and generate a string containing all required custom library ids.
|
|
81
103
|
*
|
|
@@ -99,7 +121,7 @@ async function getManifestLibs(appUrls: string[]): Promise<string> {
|
|
|
99
121
|
}
|
|
100
122
|
}
|
|
101
123
|
if (manifest['sap.ui5']?.componentUsages) {
|
|
102
|
-
|
|
124
|
+
getComponentUsageNames(manifest['sap.ui5'].componentUsages, result);
|
|
103
125
|
}
|
|
104
126
|
}
|
|
105
127
|
})
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"bugs": {
|
|
10
10
|
"url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Apreview-middleware"
|
|
11
11
|
},
|
|
12
|
-
"version": "0.16.
|
|
12
|
+
"version": "0.16.25",
|
|
13
13
|
"license": "Apache-2.0",
|
|
14
14
|
"author": "@SAP/ux-tools-team",
|
|
15
15
|
"main": "dist/index.js",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"mem-fs": "2.1.0",
|
|
27
27
|
"mem-fs-editor": "9.4.0",
|
|
28
28
|
"@sap-ux/logger": "0.6.0",
|
|
29
|
-
"@sap-ux/adp-tooling": "0.12.17",
|
|
30
29
|
"@sap-ux/btp-utils": "0.15.0",
|
|
30
|
+
"@sap-ux/adp-tooling": "0.12.17",
|
|
31
31
|
"@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.4.26",
|
|
32
32
|
"@sap-ux/project-access": "1.25.7"
|
|
33
33
|
},
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"supertest": "6.3.3",
|
|
46
46
|
"@sap-ux-private/playwright": "0.1.0",
|
|
47
47
|
"dotenv": "16.3.1",
|
|
48
|
-
"@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.10.
|
|
48
|
+
"@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.10.4",
|
|
49
49
|
"@sap-ux/axios-extension": "1.16.1",
|
|
50
50
|
"@sap-ux/store": "0.7.0",
|
|
51
51
|
"@sap-ux/ui5-info": "0.7.0",
|