From 30a3164a96064ee2bd3384b9e065980a910277bb Mon Sep 17 00:00:00 2001 From: Cory LaViska Date: Thu, 19 Oct 2023 10:31:24 -0400 Subject: [PATCH] backport PR 1663 --- docs/pages/resources/changelog.md | 1 + scripts/make-react.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/pages/resources/changelog.md b/docs/pages/resources/changelog.md index eeadb6d2c..61e96cd88 100644 --- a/docs/pages/resources/changelog.md +++ b/docs/pages/resources/changelog.md @@ -25,6 +25,7 @@ New versions of Web Awesome are released as-needed and generally occur when a cr - Added the Croatian translation [#1656] - Fixed a bug that caused the [[Escape]] key to stop propagating when tooltips are disabled [#1607] - Fixed a bug that made it impossible to style placeholders in `` [#1667] +- Fixed a bug that caused `dist/react/index.js` to be blank [#1659] ## 2.10.0 diff --git a/scripts/make-react.js b/scripts/make-react.js index 66989d20e..fe616bea8 100644 --- a/scripts/make-react.js +++ b/scripts/make-react.js @@ -19,7 +19,7 @@ const metadata = JSON.parse(fs.readFileSync(path.join(outdir, 'custom-elements.j const components = getAllComponents(metadata); const index = []; -components.forEach(async component => { +for await (const component of components) { const tagWithoutPrefix = component.tagName.replace(/^wa-/, ''); const componentDir = path.join(reactDir, tagWithoutPrefix); const componentFile = path.join(componentDir, 'index.ts'); @@ -73,7 +73,7 @@ components.forEach(async component => { index.push(`export { default as ${component.name} } from './${tagWithoutPrefix}/index.js';`); fs.writeFileSync(componentFile, source, 'utf8'); -}); +} // Generate the index file fs.writeFileSync(path.join(reactDir, 'index.ts'), index.join('\n'), 'utf8');