Skip to content

Commit b866cae

Browse files
authored
Merge pull request #39 from estruyf/copilot/fix-37
[WIP] Recursive searching of folders
2 parents 609eaa4 + 08ca6b4 commit b866cae

File tree

9 files changed

+10221
-9996
lines changed

9 files changed

+10221
-9996
lines changed

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,34 @@ By default, the barrel file is named `index.ts`. You can customize this name usi
100100

101101
This will generate a barrel file with the specified name instead of index.ts.
102102

103+
### Recursive Folder Search
104+
105+
You can enable recursive searching of subdirectories for TypeScript files using the `exportall.config.recursive` setting. This is useful when you have a folder structure like:
106+
107+
```
108+
components/
109+
button/
110+
button.tsx
111+
button.module.scss
112+
textBox/
113+
textBox.tsx
114+
textBox.module.scss
115+
```
116+
117+
To export TypeScript files from all subdirectories without requiring index files in each subfolder:
118+
119+
```json
120+
"exportall.config.recursive": true
121+
```
122+
123+
When enabled, running the export command on the `components` folder will create:
124+
125+
```typescript
126+
// components/index.ts
127+
export * from './button/button';
128+
export * from './textBox/textBox';
129+
```
130+
103131
## ⚙️ Configuration / Settings
104132

105133
The extension makes use of the following settings:
@@ -117,6 +145,7 @@ The extension makes use of the following settings:
117145
| `exportall.config.exportFileExtension` | Specify the file extension to append to the exported files. Example: `js`, `ts`, `null` (no extension). | `string` \| `null` | `null` |
118146
| `exportall.config.barrelName` | Specify the name of the barrel file. | `string` | `index.ts` |
119147
| `exportall.config.exportFullPath` | Specify if you want to use the full path in the export statement. This will be applied to the generated barrel file. | `boolean` | `false` |
148+
| `exportall.config.recursive` | Specify if you want to recursively search subdirectories for TypeScript files to export. When enabled, all TypeScript files in subdirectories will be included without requiring index files in each subfolder. | `boolean` | `false` |
120149

121150
<p align="center">
122151
<img src="./assets/config.png" alt="Config settings example" style="display: inline-block" />

0 commit comments

Comments
 (0)