From 7b803cb1b02796b59b2e249db508143e21074745 Mon Sep 17 00:00:00 2001 From: Benny Powers Date: Wed, 7 Jan 2026 15:49:32 +0200 Subject: [PATCH] fix(tools): don't crash on modules that have no exports --- .changeset/clear-tips-train.md | 4 ++++ tools/pfe-tools/react/generate-wrappers.ts | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 .changeset/clear-tips-train.md diff --git a/.changeset/clear-tips-train.md b/.changeset/clear-tips-train.md new file mode 100644 index 0000000000..99bd137740 --- /dev/null +++ b/.changeset/clear-tips-train.md @@ -0,0 +1,4 @@ +--- +"@patternfly/pfe-tools": patch +--- +React Wrappers Generator: skip module that have no exports diff --git a/tools/pfe-tools/react/generate-wrappers.ts b/tools/pfe-tools/react/generate-wrappers.ts index 1bf035ee5a..203e6933e8 100644 --- a/tools/pfe-tools/react/generate-wrappers.ts +++ b/tools/pfe-tools/react/generate-wrappers.ts @@ -43,7 +43,7 @@ function getDeprefixedClassName(className: string, prefix: string) { * @param str string to convert to camelcase */ function camel(str: string): string { - return str.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g, (m, chr) => chr.toUpperCase()); + return str.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g, (_, chr) => chr.toUpperCase()); } function getEventReactPropName(event: CEM.Event) { @@ -183,7 +183,7 @@ export async function generateReactWrappers( try { for (const module of manifest.modules) { if (!module.exports) { - throw new Error(`module has no exports: ${module.path}`); + continue; } const { js, ts, tagNames } = genWrapperModules(module, packageName, elPrefix, classPrefix); written.push(await writeReactWrappers(js, ts, tagNames, module.path, outDirPathOrURL));