gajus / create-index

Creates ES6 ./index.js file in target directories that imports and exports all sibling files and directories.
Other
278 stars 87 forks source link

Support exporting directly from subdirectories #7

Closed gausie closed 8 years ago

gausie commented 8 years ago

I have a directory structure like so

components
├── AccordionBox
│   ├── AccordionBox.js
│   └── AccordionTab.js
├── AlertBox
│   └── AlertBox.js
└── Dropdown
    └── Dropdown.js

It would be great if could just run create-index and add an index.js to components that looked like

'create-index';

export AccordionBox from './AccordionBox/AccordionBox';
export AccordionTab from './AccordionBox/AccordionTab';
export AlertBox from './AlertBox/AlertBox';
export Dropdown from './Dropdown/Dropdown';
gajus commented 8 years ago

I cannot think of a versatile API that could achieve this, but if you can, please submit a PR.

gajus commented 8 years ago

Closing as there are no suggestions for the API design.