bencoveney / barrelsby

Automatic TypeScript barrels (index.ts files) for your entire code base
MIT License
558 stars 47 forks source link

Add support to re-export files that are filtered using a module resolution-like behavior (e.g., file extensions) #654

Open jgornick opened 5 months ago

jgornick commented 5 months ago

Currently, barrelsby allows files to be filtered via a regular expression. However, this is limited when wanting to re-export files with the same name, but different extensions. For example, if I have files component.native.tsx and component.tsx and in my generated barrel file I only want the component.native.tsx file as I'm targeting a "native platform". This is a common use-case for module resolvers where you provide a collection of extensions and the resolver will try each one until it finds a match.

Barrelsby resolution logic is slightly different than a module resolver's logic, but there are some similarities that could allow specific logic to be applied.

Another approach could be to allow a function for include/exclude options that would give the implementer full control over the filtering logic.

github-actions[bot] commented 1 month ago

No activity has been seen recently, marking as stale. If this is a mistake please reach out to a collaborator

jgornick commented 1 month ago

@bencoveney Bump...