diff --git a/.changeset/rich-sloths-reply.md b/.changeset/rich-sloths-reply.md new file mode 100644 index 0000000000..1c826d3ff9 --- /dev/null +++ b/.changeset/rich-sloths-reply.md @@ -0,0 +1,5 @@ +--- +"@patternfly/pfe-tools": patch +--- + +**React**: corrected syntax error in some generated modules diff --git a/tools/pfe-tools/react/generate-wrappers.ts b/tools/pfe-tools/react/generate-wrappers.ts index a402579ffe..29f69a66ad 100644 --- a/tools/pfe-tools/react/generate-wrappers.ts +++ b/tools/pfe-tools/react/generate-wrappers.ts @@ -80,7 +80,7 @@ function genJavascriptModule(module: CEM.Module, pkgName: string, data: ReactWra return javascript`// ${module.path} import { createComponent } from '@lit/react'; import react from 'react';${data.map(x => javascript` -import { ${x.Class} as elementClass } from '${pkgName}/${module.path}';`)}${data.map(x => javascript` +import { ${x.Class} as elementClass } from '${pkgName}/${module.path}';`).join('')}${data.map(x => javascript` export const ${x.reactComponentName} = createComponent({ tagName: '${x.tagName}', elementClass, @@ -93,8 +93,8 @@ export const ${x.reactComponentName} = createComponent({ function genTypescriptModule(module: CEM.Module, pkgName: string, data: ReactWrapperData[]) { return typescript`// ${module.path} import type { ReactWebComponent } from '@lit/react';${data.map(x => typescript` -import type { ${x.Class} } from '${pkgName}/${module.path}';`)}${data.map(x => typescript` -export const ${x.reactComponentName}: ReactWebComponent<${x.Class}, ${x.eventsInterface}>;`)} +import type { ${x.Class} } from '${pkgName}/${module.path}';`).join('')}${data.map(x => typescript` +export const ${x.reactComponentName}: ReactWebComponent<${x.Class}, ${x.eventsInterface}>;`).join('\n')} `; }