jmeyers91 / barro

Flexible barrel file generation for Javascript and Typescript with watching built-in.
MIT License
4 stars 0 forks source link

Allow dynamic "out" files #3

Open petrzjunior opened 2 years ago

petrzjunior commented 2 years ago

First of all, thank for a fantastic library. It is by far the best barrel generator which just works out of the box.

I'm missing the ability to automate generating barrels in nested directories.

My folder structure looks like this:

src
├── account
│   ├── index.ts
│   ├── account.dto.ts
│   └── account.repository.ts
├── gallery
│   ├── index.ts
│   ├── gallery.dto.ts
│   ├── gallery.repository.ts
├── image
│   ├── index.ts
│   ├── image.dto.ts
│   └── image.repository.ts
├── order
│   ├── index.ts
│   ├── order.dto.ts
│   └── order.repository.ts
└── user
    ├── index.ts
    ├── user.dto.ts
    └── user.repository.ts

I would like to specify something like

module.exports = () => [
  {
    out: "src/*/index.ts",
    match: "*.ts",
  },
];

and get all the index files generated, without the prior knowledge of the directory names.

rubiin commented 2 years ago

same