Skip to content

Commit 3d93069

Browse files
committed
ignore internal type/interface exports
1 parent 044cfbd commit 3d93069

File tree

1 file changed

+19
-1
lines changed
  • packages/cli/src/scripts/codemod/transforms/export-maps

1 file changed

+19
-1
lines changed

packages/cli/src/scripts/codemod/transforms/export-maps/main.cts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@ const compatPackageName = '@ui5/webcomponents-react-compat';
1010

1111
const packageNames = [mainPackageName, basePackageName, chartsPackageName, aiPackageName, compatPackageName];
1212

13+
const ignoredImportedNames = new Set([
14+
'ReducedReactNode',
15+
'ReducedReactNodeWithBoolean',
16+
'UI5WCSlotsNode',
17+
'CommonProps',
18+
'Ui5CustomEvent',
19+
'Ui5DomRef',
20+
]);
21+
1322
// Enums for main package
1423
const libraryPath = require.resolve('@ui5/webcomponents-react/package.json');
1524
const enumsDir = path.join(path.dirname(libraryPath), 'dist', 'enums');
@@ -141,9 +150,18 @@ export default function transform(file: FileInfo, api: API): string | undefined
141150
packageNames.forEach((pkg) => {
142151
root.find(j.ImportDeclaration, { source: { value: pkg } }).forEach((importPath) => {
143152
const specifiers = importPath.node.specifiers || [];
153+
//todo: remove any
144154
specifiers.forEach((spec: any) => {
145-
if (spec.type !== 'ImportSpecifier') return;
155+
if (spec.type !== 'ImportSpecifier') {
156+
return;
157+
}
158+
146159
const importedName = spec.imported.name as string;
160+
161+
if (ignoredImportedNames.has(importedName)) {
162+
return;
163+
}
164+
147165
let componentName = importedName;
148166
if (importedName.endsWith('PropTypes')) {
149167
componentName = importedName.replace(/PropTypes$/, '');

0 commit comments

Comments
 (0)