Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Child Dir Barrel Generation #46

Closed
distributedlock opened this issue Nov 16, 2017 · 2 comments
Closed

Child Dir Barrel Generation #46

distributedlock opened this issue Nov 16, 2017 · 2 comments
Labels

Comments

@distributedlock
Copy link

distributedlock commented Nov 16, 2017

Hi,

Is there a way to generate child directory barrels and have the parent directory export from the child barrel? Rather than mentioning all the exports in the main directory barrel.

Example

src/app/shared contains directories services and enums. Run barrelsby on src/app/shared and have it recursively generate barrels from bottom-up. So, this would generate barrel for src/app/shared/services then src/app/shared/ barrel will just be a:

export * from './services';

While the child barrel (src/app/shared/services/index.ts) will contain all the individual exports like:

export * from './logger.service';
export * from './state.service';

Awesome job with the project 👍 .

Thanks

@bencoveney
Copy link
Owner

Hi @ranadeeppolavarapu, Thanks for your interest in the library :)

I think it might be possible to achieve our desired results using the following settings, but let me know if I have misunderstood.

  • --location all will ensure all directories get their own barrel. Barrelsby should automatically use barrels from child directories.
  • --structure flat will ensure that all barrels use the format export * from 'myLocation'.
  • --singlequotes will give make all strings use the singleQuotes style from your example.

@distributedlock
Copy link
Author

Hi @bencoveney,

This worked perfectly. Thanks for the clarification :). Amazing library 👍

Best Regards,
Ranadeep

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants