diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d00b7b23b..49c38c124f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -151,6 +151,7 @@ and adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - In React and Vue, a tag for a component the file imports from a package, like `; +} + +export default React.forwardRef(Button); +` + ); + write( + 'components/Toolbar.tsx', + "import ToolbarButton from './Button';\n\nexport function Toolbar() {\n return
;\n}\n" + ); + await index(); + expect(renders('Toolbar')).toEqual(['Button components/Button.tsx:5']); + }); + + it('renders its own app’s component through a barrel when every app has one of that name', async () => { + // bulletproof-react: each app imports `Button` from its own + // `@/components/ui/button`, a barrel of `export * from './button'`. + for (const app of ['nextjs-app', 'react-vite']) { + write(`apps/${app}/tsconfig.json`, JSON.stringify({ compilerOptions: { baseUrl: '.', paths: { '@/*': ['./src/*'] } } })); + write(`apps/${app}/src/components/ui/button/button.tsx`, 'export function Button() {\n return