Skip to content

Commit c0697ad

Browse files
committed
refactor: Cleanups
1 parent e9aec3b commit c0697ad

3 files changed

Lines changed: 4 additions & 69 deletions

File tree

internal/npm-integration-poc/lib/templates/package-export-template.js

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,40 +4,6 @@
44
* Generates package export files for @ui5/webcomponents packages
55
*/
66

7-
/**
8-
* Generate package export with relative paths (for gen/ namespace)
9-
*
10-
* @param packageInfo
11-
*/
12-
export function generatePackageExportGen(packageInfo) {
13-
const {packageName, version, chunkName} = packageInfo;
14-
15-
return `/*!
16-
* UI5 WebComponents Package Export
17-
*/
18-
sap.ui.define([
19-
"../../../${chunkName || packageName.split("/").pop()}"
20-
], function(WebCPackage) {
21-
"use strict";
22-
23-
// Re-export package object
24-
const pkg = Object.assign({}, WebCPackage);
25-
26-
// Export UI5 metadata
27-
pkg["_ui5metadata"] = {
28-
"name": "@ui5/${packageName.split("/").pop()}",
29-
"version": "${version}",
30-
"dependencies": ["sap.ui.core"],
31-
"types": [],
32-
"interfaces": [],
33-
"controls": [],
34-
"elements": []
35-
};
36-
37-
return pkg;
38-
});`;
39-
}
40-
417
/**
428
* Generate package export with absolute paths (for thirdparty/ namespace)
439
*

internal/npm-integration-poc/lib/templates/ui5-control-template.js

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,6 @@
44
* Generates UI5 control wrapper code that extends sap.ui.core.webc.WebComponent
55
*/
66

7-
/**
8-
* Generate UI5 control wrapper with relative paths (for gen/ namespace)
9-
*
10-
* @param metadata
11-
* @param options
12-
*/
13-
export function generateUI5ControlGen(metadata, options) {
14-
const {componentName, ui5Metadata} = metadata;
15-
16-
return `/*!
17-
* UI5 WebComponent Wrapper
18-
*/
19-
sap.ui.define([
20-
"sap/ui/core/webc/WebComponent",
21-
"../../../@ui5/webcomponents",
22-
"../../../${componentName}"
23-
], function(WebComponent) {
24-
"use strict";
25-
26-
const ${componentName} = WebComponent.extend("@ui5.webcomponents.dist.${componentName}", {
27-
metadata: ${JSON.stringify(ui5Metadata, null, 2)}
28-
});
29-
30-
return ${componentName};
31-
});`;
32-
}
33-
347
/**
358
* Generate UI5 control wrapper with absolute paths (for thirdparty/ namespace)
369
*

internal/npm-integration-poc/lib/utils/UI5MetadataTransformer.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ export class UI5MetadataTransformer {
3333
qualifiedNamespace: `${qualifiedNamespace}.${thirdpartyNamespace}.@ui5.webcomponents`,
3434
tag: scopedTag,
3535
interfaces: [],
36-
properties: this.transformProperties(webComponentMetadata.properties, namespace, thirdpartyNamespace),
37-
aggregations: this.transformSlots(webComponentMetadata.slots, namespace, thirdpartyNamespace),
36+
properties: this.transformProperties(webComponentMetadata.properties),
37+
aggregations: this.transformSlots(webComponentMetadata.slots),
3838
associations: {},
3939
events: this.transformEvents(webComponentMetadata.events),
4040
getters: [],
@@ -79,10 +79,8 @@ export class UI5MetadataTransformer {
7979
* Transform properties
8080
*
8181
* @param properties
82-
* @param namespace
83-
* @param thirdpartyNamespace
8482
*/
85-
transformProperties(properties, namespace, thirdpartyNamespace) {
83+
transformProperties(properties) {
8684
const ui5Properties = {};
8785

8886
for (const prop of properties) {
@@ -112,10 +110,8 @@ export class UI5MetadataTransformer {
112110
* Transform slots to aggregations
113111
*
114112
* @param slots
115-
* @param namespace
116-
* @param thirdpartyNamespace
117113
*/
118-
transformSlots(slots, namespace, thirdpartyNamespace) {
114+
transformSlots(slots) {
119115
const ui5Aggregations = {
120116
content: {
121117
type: "sap.ui.core.Control",

0 commit comments

Comments
 (0)